Recipe Nest is a Node.js web application built with Express.js and MongoDB that allows users to browse, search, and view recipes. Users can also add new categories and recipes, edit their profiles, and save their favorite recipes for easy access.
- Browse Recipes: View a collection of recipes categorized for easy navigation.
- Search Functionality: Find recipes quickly by searching by keywords.
- Add New Recipes and Categories: Users can contribute by adding new recipes and categories.
- Favorite Recipes: Save recipes to a personal favorites list for later access.
- User Authentication: Secure user signup, login, and profile management.
- Responsive Design: Optimized for desktop and mobile devices.
- Error Handling: Custom 404 and server error pages for a seamless user experience.
- Node.js: Backend server and application logic.
- Express.js: Framework for building APIs and handling routes.
- MongoDB: Database for storing user, recipe, and category information.
- EJS: Template engine for rendering dynamic views.
- CSS: For responsive and attractive styling.
- JavaScript: For interactive client-side functionality.
recipe-nest/
โโโ config/ # Configuration files
โ โโโ dbConfig.js # MongoDB connection configuration
โ โโโ emailConfig.js # Email service configuration
โ โโโ multerConfig.js # File upload configuration
โโโ controllers/ # Controller logic for handling routes
โ โโโ indexController.js # Homepage and general controllers
โ โโโ otpController.js # OTP-related logic
โ โโโ userController.js # User-related controllers
โโโ middlewares/ # Middleware for route handling
โ โโโ jwtMiddleware.js # JWT authentication middleware
โโโ models/ # MongoDB models (schemas)
โ โโโ categoryModel.js # Schema for recipe categories
โ โโโ otpModel.js # Schema for OTP storage
โ โโโ recipeModel.js # Schema for recipes
โ โโโ userModel.js # Schema for users
โโโ public/ # Static assets (CSS, JS, images)
โ โโโ css/ # CSS files for styling
โ โโโ images/ # Static images (categories, recipes, etc.)
โ โโโ js/ # JavaScript files for client-side logic
โโโ routes/ # API and view routes
โ โโโ indexRoutes.js # General routes
โ โโโ otpRoutes.js # OTP-related routes
โ โโโ userRoutes.js # User-related routes
โโโ utils/ # Utility functions
โ โโโ emailUtils.js # Email sending utilities
โ โโโ httpStatusCode.js # HTTP status code constants
โ โโโ messageUtils.js # Utility functions for messages
โ โโโ otpUtils.js # Logic for OTP generation/validation
โ โโโ userUtils.js # Utility functions for user operations
โโโ views/ # EJS templates for rendering pages
โ โโโ layouts/ # Layout templates
โ โโโ partials/ # Reusable components (header, footer, etc.)
โ โโโ users/ # User-specific templates
โ โโโ 404.ejs # 404 error page
โ โโโ categories.ejs # Categories page
โ โโโ contact.ejs # Contact page
โ โโโ index.ejs # Homepage
โ โโโ recipeDetails.ejs # Recipe details page
โ โโโ recipes.ejs # Recipes page
โ โโโ serverError.ejs # Server error page
โโโ .gitignore # Git ignored files and folders
โโโ app.js # Main application entry point
โโโ package.json # Project metadata and dependencies
โโโ package-lock.json # Lock file for dependencies
- Node.js (v16+ recommended)
- MongoDB (local or cloud instance)
- npm (Node Package Manager)
-
Clone the repository:
git clone https://github.com/your-username/recipe-nest.git cd recipe-nest
-
Install dependencies:
npm install
-
Set up environment variables:
Create a.env
file in the root directory and add the following:PORT=3000 DB_URI=mongodb://localhost:27017/your_database_name SESSION_SECRET=your_session_secret [email protected] SEND_EMAIL_PASS=your_email_password
-
Run the application:
npm start
-
Open your browser and go to:
http://localhost:3000
-
Browse Recipes
- View all available recipes on the homepage or categorized pages.
-
Search Recipes
- Use the search bar to find recipes by keywords.
-
Add Recipes and Categories
- Log in to contribute new recipes and categories.
-
Favorite Recipes
- Save recipes to your favorites for easy access later.
- Building RESTful APIs with Express.js.
- Creating dynamic views with EJS.
- Managing data with MongoDB.
- Using JWT for secure authentication.
- File uploads and image management with Multer.
This project is licensed under the MIT License.
- Open-source libraries and tools for building this project.