The Recipe App is your ultimate culinary companion, built with the power of Next.js to deliver a seamless and enjoyable experience for food enthusiasts. Whether you're a seasoned chef or a kitchen novice, this app simplifies your recipe discovery journey and brings delicious possibilities to your fingertips.
Why You'll Love It: 🍳 Explore Recipes with Ease Discover a diverse collection of recipes tailored to your tastes. Filter by categories, tags, or cooking steps to find the perfect dish for any occasion.
🔍 Smart Search & Powerful Sorting Easily search for recipes or sort them based on your preferences, saving time and making decision-making effortless.
📋 Step-by-Step Instructions View detailed recipes with clear, step-by-step guidance, ensuring a stress-free cooking experience from start to finish.
💬 Text-to-Voice Conversion Turn your kitchen into a hands-free zone! With our text-to-voice feature, the app reads out instructions and content, letting you focus on cooking without missing a beat.
📱 Progressive Web App (PWA) Take the app with you wherever you go. As a PWA, it works seamlessly across devices and offers offline access, so you can cook even when you're off the grid.
💡 Manage Preferences Effortlessly Keep track of your favorite recipes and personalize your experience with easy preference management.
Whether you're exploring new cuisines or perfecting a family classic, the Recipe App is here to inspire and guide you every step of the way.
🚀 Live Demo Check out the live demo of the Recipe App in action! Explore recipes, leave reviews, and experience the features firsthand:
Visit Live Demo
Find your desired recipes quickly by searching with keywords, titles, or ingredients.
Delve into a curated library of recipes, each thoughtfully detailed with:
🥕 Ingredients – All the essentials you need for every dish. 🍳 Cooking Steps – Clear, step-by-step instructions to guide you effortlessly. ⏱️ Prep & Cook Time – Plan your meals with accurate time estimates. 🍽️ Servings – Easily scale recipes to match your needs.
Narrow down your search by category, cooking time, difficulty, tags, or dietary preferences. Sort recipes by popularity, newest, or preparation time.
🔐 Secure Login & account management 🍴 Personalized Recipe Recommendations based on preferences ✨ Profile Customization with favorite cuisines and saved recipes 📊 Track Cooking History for easy access
❤️ Favorite Recipes Save your favorite recipes for quick access anytime.
📂 Custom Recipe Collections Organize saved recipes into personalized collections, such as “Dinner Ideas” or “Quick Snacks.”
📝 Recipe Notes Add your own notes or tweaks to recipes for future reference.
⭐ Rate & Review Recipes – Share your feedback and help others discover the best dishes. 💬 Add Comments – Join the conversation by discussing recipes and sharing your experiences. 🍴 Share Your Cooking Tips – Contribute your expertise to help the community elevate their culinary skills.
📥 Offline Recipe Access Download recipes to view them offline anytime, even without an internet connection.
📢 Push Notifications Stay updated with the latest recipe recommendations, reminders, or personalized cooking tips.
🗣️ Text-to-Voice Conversion Enjoy hands-free cooking with audio playback of recipe instructions and content.
📱 Cross-Device Compatibility Access the app seamlessly on mobile, tablet, and desktop.
🛠️ Offline Functionality Use the app without an internet connection to view downloaded recipes or saved collections.
⚡ Fast Loading Experience lightning-fast performance, even on slow networks.
🌐 Share Your Favorite Recipes 📲 Social Media Sharing – Easily share recipes directly to platforms like Facebook, Twitter, and Instagram. ✉️ Email Recipes – Send delicious ideas straight to your friends' inboxes. 🔗 Create Shareable Links – Generate links to share recipes with anyone, anytime.
- Implements meta tags and dynamic metadata for better search engine visibility.
- ⚡ Next.js (v13+) – A powerful framework for server-rendered React applications.
- ⚛️ React (v18+) – A robust library for building dynamic user interfaces.
- 🎨 Tailwind CSS (v3+) – For sleek, responsive, and modern styling.
- 🧩 Radix UI Components – Accessible, customizable, and high-quality UI components.
- 🔽 React Dropdown Select – Smooth and interactive dropdown menus for enhanced UX.
- 🍃 MongoDB – A scalable and flexible NoSQL database.
- 🔒 Authentication – Secure user login and session management.
- ⚡ Realtime Database – Instant updates to keep data fresh and synchronized.
- 🔥 Cloud Functions – Serverless backend logic for optimized performance.
- 🖼️ Image Optimization – High-quality visuals with reduced load times.
- 📂 Recipe Asset Management – Effortless storage and retrieval of recipe-related assets.
- 🛠️ ESLint & Prettier – For clean, consistent, and error-free code.
- 🌱 Git – Reliable version control to track and manage development changes.
- 📝 Markdown Support – Simplified formatting for seamless documentation.
- ✅ Jest – Comprehensive testing to ensure app stability and quality.
This robust stack ensures a fast, reliable, and enjoyable experience for developers and users alike! 🚀
Ensure you have the following installed on your machine before proceeding:
- Node.js (v18.x or later) – Download Here
- **npm ** – Comes with Node.js
- Git – Download Here
- Visual Studio Code (recommended) – Download Here
-
Clone the Repository
Clone the project to your local machine using Git:git clone https://github.com/Cheplusplus/ASE_2024_GROUP_C.git
-
Navigate to the Project Directory
If necessary, move into the project directory:cd recipe-app
-
Install Dependencies
Install the required dependencies using npm:npm install
-
Configure Environment Variables
Copy the example environment file to create your own configuration:cp .env.example .env.local
-
Edit the Environment File
Open.env.local
in a code editor and provide your Firebase configuration:NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
-
Start the Development Server
Run the server in development mode and access it athttp://localhost:3000
:npm run dev
-
Build for Production
If you need a production-ready build, use the following command:npm run build
-
Troubleshooting
- If you encounter build issues, clear the
.next
folder:rm -rf .next
- If there are dependency issues, reset the
node_modules
folder:rm -rf node_modules npm install
- If you encounter build issues, clear the
These step-by-step instructions should ensure a smooth setup for your project.
Environment variables are essential for securely storing sensitive configuration details like API keys, project IDs, and other settings required by the app. Here's how you can set them up for local development:
-
Locate the
.env.example
File
In the root directory of your project, there should be a file named.env.example
. This file contains placeholders for the required environment variables. -
Create a Local Environment File
Copy the.env.example
file to a new file named.env.local
:cp .env.example .env.local
-
Edit the
.env.local
File
Open the.env.local
file in your code editor (e.g., Visual Studio Code) and replace the placeholders with your actual configuration values.Example:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
-
Obtain Your Firebase Configuration
- Go to the Firebase Console: Firebase Console
- Select your project.
- Navigate to Project Settings > General > Your apps (Firebase SDK snippet).
- Copy the Firebase configuration object and extract the required values.
Example Firebase Configuration Object:
const firebaseConfig = { apiKey: "your_api_key", authDomain: "your_auth_domain", projectId: "your_project_id", storageBucket: "your_storage_bucket", messagingSenderId: "your_messaging_sender_id", appId: "your_app_id", };
-
Verify the Setup
- Ensure the
.env.local
file is saved and properly formatted. - Double-check that there are no spaces around the
=
signs.
- Ensure the
-
Restart the Development Server
After setting up or modifying the.env.local
file, restart your development server to apply the changes:
bash
npm run dev
-
Do Not Commit the
.env.local
File:
Add.env.local
to your.gitignore
file to ensure sensitive information is not pushed to version control. -
Use Descriptive Variable Names:
Clearly label environment variables to make them understandable for future developers. -
Validate Your Configuration:
Test the app locally to confirm that the environment variables are correctly applied.
This setup ensures your app runs locally with all the necessary configurations while keeping sensitive information secure.
All API requests are made to the following base URL:<!--https://your-api-url.com/api
HTTP Method | Endpoint Path | Description |
---|---|---|
GET | /recipes |
Fetch a list of all recipes. |
GET | /recipes/{id} |
Fetch a single recipe by its ID. |
POST | /recipes |
Add a new recipe to the database. |
PUT | /recipes/{id} |
Update an existing recipe by ID. |
DELETE | /recipes/{id} |
Delete a recipe by its ID. |
GET | /categories |
Fetch all available categories. |
POST | /reviews |
Add a review to a recipe. |
GET | /reviews/{recipeId} |
Get all reviews for a specific recipe. |
Fetch a list of all recipes with the option to filter, sort, and paginate results.
Query Parameters:
page
(optional): Page number for pagination (default is 1).limit
(optional): Number of recipes per page (default is 10).sort
(optional): Sort order for recipes. Can beasc
(ascending) ordesc
(descending).category
(optional): Filter by category (e.g.,vegan
,dessert
).
GET /api/recipes?page=1&limit=10&sort=asc&category=vegan
{
"data": [
{
"id": "1",
"title": "Vegan Pancakes",
"ingredients": ["Flour", "Almond Milk", "Baking Powder", "Sugar"],
"steps": ["Mix ingredients", "Cook on griddle"],
"category": "Vegan",
"prep_time": "10 minutes",
"cook_time": "15 minutes",
"servings": 4
},
{
"id": "2",
"title": "Vegan Burger",
"ingredients": ["Black Beans", "Lettuce", "Tomato", "Vegan Mayo"],
"steps": ["Mash beans", "Form patties", "Cook on grill"],
"category": "Vegan",
"prep_time": "20 minutes",
"cook_time": "25 minutes",
"servings": 2
}
],
"pagination": {
"page": 1,
"total_pages": 5,
"total_count": 50
}
}
Fetch the details of a single recipe by its unique ID.
GET /api/recipes/1
{
"id": "1",
"title": "Vegan Pancakes",
"ingredients": ["Flour", "Almond Milk", "Baking Powder", "Sugar"],
"steps": ["Mix ingredients", "Cook on griddle"],
"category": "Vegan",
"prep_time": "10 minutes",
"cook_time": "15 minutes",
"servings": 4,
"reviews": [
{
"user": "Jane Doe",
"rating": 5,
"comment": "Delicious and easy to make!"
}
]
}
Create a new recipe and add it to the database.
{
"title": "Spaghetti Aglio e Olio",
"ingredients": ["Spaghetti", "Garlic", "Olive Oil", "Chili Flakes", "Parsley"],
"steps": ["Boil spaghetti", "Sauté garlic in olive oil", "Toss spaghetti in oil"],
"category": "Italian",
"prep_time": "5 minutes",
"cook_time": "10 minutes",
"servings": 2
}
{
"message": "Recipe created successfully",
"data": {
"id": "10",
"title": "Spaghetti Aglio e Olio",
"ingredients": ["Spaghetti", "Garlic", "Olive Oil", "Chili Flakes", "Parsley"],
"steps": ["Boil spaghetti", "Sauté garlic in olive oil", "Toss spaghetti in oil"],
"category": "Italian",
"prep_time": "5 minutes",
"cook_time": "10 minutes",
"servings": 2
}
}
Update the details of an existing recipe.
{
"title": "Vegan Pancakes",
"ingredients": ["Flour", "Almond Milk", "Baking Powder", "Sugar", "Vanilla Extract"],
"steps": ["Mix ingredients", "Cook on griddle", "Serve with syrup"],
"category": "Vegan",
"prep_time": "10 minutes",
"cook_time": "15 minutes",
"servings": 4
}
{
"message": "Recipe updated successfully",
"data": {
"id": "1",
"title": "Vegan Pancakes",
"ingredients": ["Flour", "Almond Milk", "Baking Powder", "Sugar", "Vanilla Extract"],
"steps": ["Mix ingredients", "Cook on griddle", "Serve with syrup"],
"category": "Vegan",
"prep_time": "10 minutes",
"cook_time": "15 minutes",
"servings": 4
}
}
Delete a recipe by its ID.
DELETE /api/recipes/1
{
"message": "Recipe deleted successfully"
}
Fetch a list of all available recipe categories.
GET /api/categories
{
"data": [
"Vegan",
"Dessert",
"Italian",
"Mexican",
"Asian"
]
}
Add a review for a recipe.
{
"recipe_id": "1",
"user": "John Doe",
"rating": 5,
"comment": "Fantastic recipe! Loved it."
}
{
"message": "Review added successfully",
"data": {
"user": "John Doe",
"rating": 5,
"comment": "Fantastic recipe! Loved it."
}
}
Fetch all reviews for a specific recipe by its ID.
GET /api/reviews/1
{
"data": [
{
"user": "Jane Doe",
"rating": 5,
"comment": "Delicious and easy to make!"
},
{
"user": "John Doe",
"rating": 4,
"comment": "Tasty, but I would add more seasoning next time."
}
]
}
If your app requires authentication, you will need to include authentication headers with your API requests.
Authorization: Bearer YOUR_JWT_TOKEN
In case of errors, your API should return appropriate HTTP status codes and error messages.
{
"error": "Bad Request",
"message": "Missing required field 'title'"
}
This API documentation should provide you with the necessary information to interact with the recipe app's backend. You can use the endpoints to create, read, update, delete, and interact with recipes and reviews, as well as handle categories and more.
Feel free to adjust and extend the documentation based on your app's specific features and functionality!
-📧 Email: support@recipeapp.dev
-📞 Phone: +1 555 123 4567
-💬 Discord: Join our community
-📝 Documentation: docs.recipeapp.dev
We welcome contributions! Please see our Contributing Guide for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.