Skip to content

umar-devv/FoodDelivery-Database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Food Delivery Database Management System (MongoDB)


πŸ“– Introduction

The Food Delivery Database Management System is a NoSQL database project developed using MongoDB. This project simulates a modern online food delivery platform where customers can browse restaurants, order food, make payments, and receive deliveries through riders.

The project is designed for students, beginners, and developers who want to learn MongoDB database design and implementation through a real-world application. It demonstrates proper database modeling, collection relationships, CRUD operations, aggregation pipelines, and report generation.


🎯 Project Objectives

The main objectives of this project are:

  • Design a complete food delivery database using MongoDB.
  • Implement a real-world NoSQL database structure.
  • Store and manage customer, restaurant, order, payment, and rider information.
  • Perform CRUD operations efficiently.
  • Generate useful business reports.
  • Practice aggregation pipelines and data analysis.
  • Understand document-based database architecture.
  • Develop hands-on experience with MongoDB Compass and Mongo Shell.

🌟 Features

βœ… Complete MongoDB Database Project

βœ… 6 Interconnected Collections

βœ… Realistic Food Delivery Data

βœ… Customer Management

βœ… Restaurant Management

βœ… Menu Item Management

βœ… Order Tracking System

βœ… Payment Processing Records

βœ… Rider Management System

βœ… MongoDB Aggregation Pipelines

βœ… Report Generation

βœ… MongoDB Compass Compatible

βœ… Beginner-Friendly Structure


πŸ— System Overview

The Food Delivery System consists of six major entities:

πŸ‘€ Customers

Stores customer information, contact details, city, and spending history.

🍽 Restaurants

Stores restaurant details including ratings, cuisine types, and delivery fees.

πŸ• Menu Items

Contains food products available for customers to order.

πŸ“¦ Orders

Maintains all order transactions and delivery statuses.

πŸ’³ Payments

Stores payment methods, payment amounts, and transaction statuses.

πŸ›΅ Riders

Manages delivery personnel information and earnings.


πŸ—‚ Database Collections

1️⃣ Customers Collection

Stores customer information.

Sample Document

{
  "_id": ObjectId(),
  "name": "Ali Khan",
  "email": "ali@gmail.com",
  "phone": "03001234567",
  "city": "Lahore",
  "total_spent": 2500
}

Fields

Field Description
_id Unique Customer ID
name Customer Name
email Customer Email
phone Contact Number
city Customer City
total_spent Total Amount Spent

2️⃣ Restaurants Collection

Stores restaurant details.

Sample Document

{
  "_id": ObjectId(),
  "name": "Biryani House",
  "cuisine": "Pakistani",
  "rating": 4.8,
  "delivery_fee": 150,
  "is_open": true
}

Fields

Field Description
_id Restaurant ID
name Restaurant Name
cuisine Cuisine Type
rating Customer Rating
delivery_fee Delivery Charges
is_open Availability Status

3️⃣ Menu Items Collection

Stores available food items.

Sample Document

{
  "_id": ObjectId(),
  "name": "Chicken Biryani",
  "category": "Main Course",
  "price": 650,
  "restaurant": "Biryani House"
}

Fields

Field Description
_id Menu Item ID
name Food Item Name
category Food Category
price Food Price
restaurant Restaurant Name

4️⃣ Orders Collection

Stores customer orders.

Sample Document

{
  "_id": ObjectId(),
  "customer_name": "Ali Khan",
  "restaurant_name": "Biryani House",
  "items": [
    "Chicken Biryani",
    "Cold Drink"
  ],
  "status": "Delivered",
  "grand_total": 800
}

Fields

Field Description
_id Order ID
customer_name Customer Name
restaurant_name Restaurant Name
items Ordered Food Items
status Current Status
grand_total Final Amount

5️⃣ Payments Collection

Stores payment records.

Sample Document

{
  "_id": ObjectId(),
  "method": "Cash",
  "amount": 800,
  "status": "Paid"
}

Fields

Field Description
_id Payment ID
method Payment Method
amount Payment Amount
status Payment Status

6️⃣ Riders Collection

Stores rider information.

Sample Document

{
  "_id": ObjectId(),
  "name": "Usman Ali",
  "vehicle": "Bike",
  "status": "Available",
  "earnings": 12000
}

Fields

Field Description
_id Rider ID
name Rider Name
vehicle Vehicle Type
status Availability Status
earnings Total Earnings

πŸ”— Database Relationships

CUSTOMERS
    β”‚
    β–Ό
ORDERS
    β”‚
    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β–Ί PAYMENTS
    β”‚
    β–Ό
RESTAURANTS
    β”‚
    β–Ό
MENU ITEMS

RIDERS
    β”‚
    β–Ό
ORDERS

Relationship Summary

Relationship Type
Customer β†’ Orders One-to-Many
Order β†’ Payment One-to-One
Restaurant β†’ Orders One-to-Many
Restaurant β†’ Menu Items One-to-Many
Rider β†’ Orders One-to-Many

πŸ“Š Database Statistics

Collection Documents
Customers 10
Restaurants 10
Menu Items 15
Orders 10
Payments 10
Riders 5

Additional Insights

  • Total Revenue: ₨ 8,500+
  • Delivered Orders: 7
  • Preparing Orders: 2
  • Out For Delivery Orders: 1
  • Active Customers: 10
  • Available Riders: 5
  • Restaurants Across Multiple Cities
  • Multiple Food Categories Available

πŸ“ Project Structure

FoodDelivery-Database/
β”‚
β”œβ”€β”€ README.md
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ customers.json
β”‚   β”œβ”€β”€ restaurants.json
β”‚   β”œβ”€β”€ menuitems.json
β”‚   β”œβ”€β”€ orders.json
β”‚   β”œβ”€β”€ payments.json
β”‚   └── riders.json
β”‚
β”œβ”€β”€ queries/
β”‚   β”œβ”€β”€ find_queries.txt
β”‚   β”œβ”€β”€ update_queries.txt
β”‚   β”œβ”€β”€ delete_queries.txt
β”‚   └── aggregate_queries.txt
β”‚
β”œβ”€β”€ reports/
β”‚   β”œβ”€β”€ revenue_report.txt
β”‚   β”œβ”€β”€ customer_analysis.txt
β”‚   β”œβ”€β”€ payment_analysis.txt
β”‚   β”œβ”€β”€ restaurant_analysis.txt
β”‚   └── order_status_report.txt
β”‚
β”‚
β”œβ”€β”€ documentation/
β”‚   └── project_documentation.pdf
β”‚
└── LICENSE

πŸš€ Installation Guide

Step 1: Install MongoDB

Download MongoDB Community Server:

https://www.mongodb.com/try/download/community

Install using the default settings.


Step 2: Install MongoDB Compass

Download MongoDB Compass:

https://www.mongodb.com/products/compass

Install and launch MongoDB Compass.


Step 3: Connect to MongoDB

Connection String:

mongodb://localhost:27017

Click Connect.


Step 4: Create Database

use FoodDeliveryDB

Step 5: Import JSON Files

Using MongoDB Compass:

  1. Create Collection
  2. Click Add Data
  3. Select Import JSON
  4. Choose File
  5. Import Data

Repeat for all collections.


πŸ” Sample Queries

Find Customers from Lahore

db.customers.find({
  city: "Lahore"
})

Find Delivered Orders

db.orders.find({
  status: "Delivered"
})

Find Available Riders

db.riders.find({
  status: "Available"
})

Find Top Rated Restaurants

db.restaurants.find({
  rating: {
    $gte: 4.5
  }
})

πŸ“ˆ Aggregation Queries

Revenue by Restaurant

db.orders.aggregate([
{
 $group:{
   _id:"$restaurant_name",
   totalRevenue:{
     $sum:"$grand_total"
   }
 }
}
])

Customer Spending Analysis

db.customers.aggregate([
{
 $group:{
   _id:"$city",
   totalSpent:{
     $sum:"$total_spent"
   }
 }
}
])

Payment Method Analysis

db.payments.aggregate([
{
 $group:{
   _id:"$method",
   count:{
     $sum:1
   }
 }
}
])

πŸŽ“ Learning Outcomes

This project demonstrates:

  • MongoDB Fundamentals
  • NoSQL Database Design
  • Collections and Documents
  • CRUD Operations
  • Aggregation Pipelines
  • Data Modeling
  • Database Relationships
  • Report Generation
  • Database Analysis
  • Real-World Database Development

πŸ’Ό Portfolio Benefits

This project can be used for:

  • University Database Projects
  • Advanced Database Lab Submission
  • MongoDB Practice
  • GitHub Portfolio
  • Internship Applications
  • Entry-Level Developer Portfolio
  • Database Administrator Learning
  • NoSQL Development Practice

πŸ›  Technologies Used

  • MongoDB
  • MongoDB Compass
  • JSON
  • JavaScript Queries
  • NoSQL Database Architecture

🀝 Contribution

Contributions are welcome.

  1. Fork the repository
  2. Create a new branch
  3. Commit your changes
  4. Push to your branch
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Muhammad Umar

ADP Computer Science Student

Advanced Database Management System Project


⭐ Support

If you found this project useful:

⭐ Star the repository

🍴 Fork the repository

πŸ“’ Share with friends

πŸ’‘ Suggest improvements


πŸ” Food Delivery Database Management System πŸš€
Built with MongoDB for Learning and Practice.

About

A fully structured NoSQL database designed to manage the complete lifecycle of a food delivery application. This project simulates backend data interactions for customers, restaurants, menu items, orders, riders, and payments. Built with MongoDB for high flexibility and scalability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors