Skip to content

ramzi-bouzaiene/Meal-Planner-V2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍽️ Meal Planner

Overview

Meal Planner is a full-stack web application that allows users to search for recipes, plan their meals, and manage their dietary preferences efficiently.

Features

  • πŸ” Search Recipes: Find recipes based on ingredients, cuisine, and dietary restrictions.
  • πŸ“… Meal Planning: Add recipes to meal plans for different days of the week.
  • βœ… Authentication: Secure login and registration system.
  • πŸ”’ Protected Routes: Certain features require authentication.
  • πŸ“„ Swagger API Documentation: Easily explore API endpoints.
  • πŸ“œ Winston Logging: Centralized logging for debugging and monitoring.

Tech Stack

Frontend:

  • React (TypeScript) – Component-based UI development
  • React Router – Navigation and protected routes
  • CSS – Styling and responsive design

Backend:

  • Node.js & Express – Server-side logic
  • MongoDB & Mongoose – Database and ORM
  • JWT (JSON Web Tokens) – Secure authentication
  • Bcrypt.js – Password hashing
  • Swagger – API documentation
  • Winston – Logging middleware

Installation

Prerequisites

  • Node.js (>=16)
  • MongoDB (local or cloud-based)

Setup

Clone the repository

git clone https://github.com/ramzibouzaiene/meal-planner.git
cd meal-planner

Install dependencies

Backend
cd Back
npm install
Frontend
cd ../Front
npm install

Environment Variables

Create a .env file in the backend folder and add:

MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret

Start the application

Backend
npm run dev
Frontend
npm run dev

API Endpoints

Authentication

  • POST /api/auth/login - User login
  • POST /api/auth/register - User registration

Favorites

  • POST /api/favorites - Create a favorite meal
  • GET /api/favorites - Get all favorites
  • PUT /api/favorites/:id - Update favorite
  • DELETE /api/favorites/:id - Delete favorite

Meal Plans

  • POST /api/mealPlans - Create a meal plan
  • GET /api/mealPlans - Get all meal plans
  • PUT /api/mealPlans/:id - Update meal plan
  • DELETE /api/mealPlans/:id - Delete meal plan

API Documentation (Swagger)

The API documentation is available via Swagger. To access it, start the backend and visit:

http://localhost:5000/api-docs

Protected Routes

Some routes require authentication using JWT tokens. The frontend handles this with a protected route component.

Screenshots

image image image image image image

About

Meal Planner is a full-stack web application that allows users to search for recipes, plan their meals, and manage their dietary preferences efficiently.

Topics

Resources

Stars

Watchers

Forks

Contributors