Skip to content

i-himanshu29/Food-Delivery-Website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ͺ Tomato β€” Food Delivery Website

Tomato is a full-stack food delivery web application designed to provide users with a seamless experience for ordering their favorite meals online. Built using the MERN stack (MongoDB, Express, React, Node.js), Tomato features user authentication , Intuitive UI to browse restaurants, menus, and customize orders.Precise delivery location selection, ensuring efficient and accurate delivery services.

Badges

React TailwindCSS Node.js Express.js Redux MongoDB Mongoose Authentication Payment Gateway Cloudinary Nodemailer Environment Variables

Tech Stack

Client: TailwindCSS, React, Redux

Server: Nodejs , Expressjs , MongoDB ### 🌟 Features

  • User Authentication β€” Secure signup and login with JWT-based authentication.

  • Browse Foods & Menus β€” Explore multiple Food with detailed menus and item descriptions.

  • Add to Cart & Order β€” Easily add items to the cart, customize orders, and place secure orders.

  • Address Selection β€” Easily enter and save your delivery address accurately for smooth order processing.

  • Responsive Design β€” Fully responsive UI that works smoothly on mobile, tablet, and desktop devices.

  • Admin Dashboard β€” Manage restaurants, menus, and orders efficiently (if implemented).

  • Order History β€” Users can view past orders for quick reordering.

βœ… Tables to created

  • UserModel
  • OrderModel
  • LocationModel
  • foodModel## API Reference

Authentication Routes

Register User

  POST /api/user/signup
Parameter Type Description
Name string Required. The name of the user
email string Required. The email address of the user
password string Required. The password for the account

login User

  POST /api/user/login
Parameter Type Description
email string Required. The name of the email
password string Required. The name of the password

food Routes

add food

  POST /api/food/add
Parameter Type Description
name string Required. The name of the food item
description string Required. A brief description of the item
price number Required. The price of the food item
category string Required. The category of the food (e.g., Pizza, Burger, Dessert)
image string Required. The image URL of the food item

food list

  GET /api/food/list

remove food

  POST /api/food/remove
Parameter Type Description
id string Required. The unique ID of the food item to remove

Cart Routes

add to cart

  POST /api/cart/add
Parameter Type Description
userId string Required. The unique ID of the user adding the item to cart
itemId string Required. The unique ID of the food item to add
quantity number Required. The number of units of the food item

remove from cart

  POST /api/cart/remove
Parameter Type Description
userId string Required. The unique ID of the user whose cart is being updated
itemId string Required. The unique ID of the food item to remove (decrease quantity by 1)

get cart

  POST /api/cart/get
Parameter Type Description
userId string Required. The unique ID of the user whose cart data is being fetched

location Routes

get coordinates

  POST /api/location/get-coordinates
Parameter Type Description
address string Required. The full delivery address to fetch latitude and longitude coordinates

Order Routes

place order

  POST /api/order/place
Parameter Type Description
userId string Required. The unique ID of the user placing the order
items array Required. List of food items in the order, including name, price, and quantity
amount number Required. The total order amount (excluding delivery charges)
address string Required. The delivery address for the order

verify order

  POST /api/order/verify
Parameter Type Description
orderId string Required. The unique ID of the order to verify
success boolean or string Required. Indicates whether the payment was successful (true or "true")

users order

  POST /api/order/userorders
Parameter Type Description
userId string Required. The unique ID of the user whose orders are being fetched

list order

  GET /api/order/list

status order

  GET /api/order/status
Parameter Type Description
orderId string Required. The unique ID of the order whose status needs updating
status string Required. The new status of the order (e.g., "Preparing", "Out for Delivery", "Delivered")

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

MONGODB_URI =

PORT =

JWT_SECRET =

STRIPE_SECRET_KEY =

Installation

Install my-project with npm

  npm install my-project
  cd my-project

Dependencies Installation

admin

  npm install 
  npm install axios
  npm i vite@latest
  npm i react
  npm i react-router-dom
  npm i react-toastify
  npm i -D @type/react
  npm i -D @type/react-dom
  npm i -D eslint

backend

  npm install 
  npm install express
  npm i dotenv
  npm i axios
  npm i body-parser
  npm i bcryptjs
  npm i multer
  npm i stripe
  npm i @stripe/react-stripe-js
  npm i @stripe/stripe-js
  npm i jsonwebtoken
  npm i mongoose 
  npm i validator
  npm i cors 
  npm i -D nodemon

frontend

  npm i vite@latest
  npm i react
  npm i @react-google-maps/api
  npm i @react-google-maps
  npm i @stripe/react-stripe-js
  npm i @stripe/stripe-js
  npm i axios
  npm i react-dom
  npm i react-router-dom
  npm i eslint

Run Locally

Clone the project

  git clone https://github.com/i-himanshu29/Food-Delivery-Website.git

Go to the admin directory

  cd admin

Install dependencies

  npm install vite@latest

Start the admin

  npm run dev

Go to the server directory

  cd backend

Install dependencies

  npm install

Start the server

  node ./server.js

Go to the frontend directory

  cd frontend

Install dependencies

  npm install vite@latest

Start the server

  npm run dev

Deployment

The Project is deployed on Render.

πŸ“½οΈ Demo

Check out the live demo of the project here:
Project Demo

Click the thumbnail above to watch the demo on YouTube.

Screenshots

Some S.S of Landing Page

Landing Page SS-1

Landing Page SS-2

Signup SS

Signup

Login SS

Login

Profile

Course

addCourse

Roadmap

tomato-food-delivery/
β”‚
β”œβ”€β”€ πŸ“ backend/                      # Backend - Node.js + Express
β”‚   β”œβ”€β”€ πŸ“ config/                   # Config files (DB, etc.)
β”‚   β”œβ”€β”€ πŸ“ controllers/              # Route controllers
β”‚   β”œβ”€β”€ πŸ“ middleware/               # Middleware functions
β”‚   β”œβ”€β”€ πŸ“ models/                   # Mongoose models
β”‚   β”œβ”€β”€ πŸ“ routes/                   # Express routes
β”‚   β”œβ”€β”€ πŸ“ utils/                    # Utility functions
β”‚   β”œβ”€β”€ πŸ“„ server.js                 # Entry point for backend
β”‚   └── πŸ“„ package.json              # Backend dependencies
β”‚
β”œβ”€β”€ πŸ“ frontend/                     # Frontend - React app
β”‚   β”œβ”€β”€ πŸ“ public/                   # Static files (index.html, favicon)
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ assets/               # Images, icons, fonts
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/           # Reusable React components
β”‚   β”‚   β”œβ”€β”€ πŸ“ contexts/             # React context providers
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/                # React pages/views
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/             # API service calls
β”‚   β”‚   β”œβ”€β”€ πŸ“ styles/               # CSS / Tailwind files
β”‚   β”‚   β”œβ”€β”€ πŸ“ utils/                # Utility/helper functions
β”‚   β”‚   β”œβ”€β”€ πŸ“„ App.js                # Main React component
β”‚   β”‚   β”œβ”€β”€ πŸ“„ index.js              # React DOM rendering
β”‚   β”‚   └── πŸ“„ package.json          # Frontend dependencies
β”‚
β”œβ”€β”€ πŸ“„ .gitignore                   # Git ignore file
β”œβ”€β”€ πŸ“„ README.md                    # Project readme
└── πŸ“„ README.so                    # (If used for editor version)

Hi, I'm Himanshu Maurya! πŸ‘‹

πŸš€ About Me

Hello, I'm Himanshu Maurya, a passionate Software Developer who loves building innovative and efficient software.

πŸ›  Skills

JavaScript , React.js , Tailwindcss , Next.js , Node.js , Express.js , MongoDB , PostgreSql , Redis , Kafka , Deployment , Docker , WebSocket , Testing , Git/GitHub , AWS , etc.

πŸ”— Links

portfolio

linkedin

twitter

Releases

No releases published

Packages

 
 
 

Contributors