Skip to content

ChefSync is a comprehensive food delivery ecosystem that enables home chefs to monetize their culinary skills by connecting them with customers who crave authentic, homemade meals. The platform facilitates the entire journey from menu discovery to order tracking, ensuring a seamless experience for all stakeholders.

License

Notifications You must be signed in to change notification settings

CroosRRAF/ChefSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍽️ ChefSync - Food Delivery Platform

Connecting Local Home Chefs with Food Lovers

A full-stack food delivery platform built with Django and React, designed to bring authentic home-cooked meals from local chefs directly to your doorstep.

Django React TypeScript MySQL License: MIT

Features β€’ Setup β€’ Documentation β€’ Demo β€’ Contributing


πŸ“– About ChefSync

ChefSync is a comprehensive food delivery ecosystem that enables home chefs to monetize their culinary skills by connecting them with customers who crave authentic, homemade meals. The platform facilitates the entire journey from menu discovery to order tracking, ensuring a seamless experience for all stakeholders.

🌟 What Makes ChefSync Unique

  • Multi-role Platform: Serves customers, chefs, delivery partners, and administrators
  • Location-Based Services: GPS tracking, route optimization, and real-time delivery updates
  • AI-Powered Features: Intelligent food recommendations and interactive chat assistant
  • Comprehensive Order Management: From cart to delivery with real-time status tracking
  • Document Verification System: Secure document upload and admin approval workflow
  • Analytics & Reporting: Detailed insights for chefs and administrators

✨ Key Features

πŸ‘₯ For Customers

  • πŸ›’ Smart Shopping Cart - Easy-to-use cart with item management
  • πŸ“ Multi-Address Support - Save and manage multiple delivery locations
  • πŸ“± Real-Time Order Tracking - Track your order from kitchen to doorstep
  • ⭐ Rating & Reviews - Share your dining experience
  • πŸ”” Order Notifications - Stay updated on your order status
  • πŸ’° Flexible Payment - Cash on delivery support

πŸ‘¨β€πŸ³ For Chefs

  • πŸ“‹ Menu Management - Create and manage your food offerings
  • πŸ“Š Kitchen Dashboard - Monitor incoming orders and preparation schedule
  • πŸ’΅ Earnings Tracking - Track revenue and order statistics
  • πŸ“Έ Bulk Menu Upload - Efficiently add multiple items with images
  • πŸ“ Kitchen Location Management - Set up and manage multiple kitchen locations
  • ⏰ Preparation Time Management - Set realistic time estimates

🚚 For Delivery Partners

  • πŸ—ΊοΈ Dual Navigation System - Integrated map + Google Maps for optimal routing
  • πŸ“¦ Order Management - Accept, pick up, and deliver orders efficiently
  • πŸ’° Earnings Dashboard - Track deliveries and earnings
  • πŸ“ Pickup & Delivery Tracking - Navigate to chefs and customers
  • πŸ“ž Direct Communication - Contact chefs and customers with one tap

πŸ”§ For Administrators

  • βœ… User Approval System - Review and approve chef/delivery partner applications
  • πŸ“„ Document Management - Secure document review and verification
  • πŸ“Š Analytics Dashboard - Platform-wide metrics and insights
  • 🎯 AI-Powered Insights - Automated report generation and recommendations
  • πŸ›‘οΈ User Management - Comprehensive user administration tools
  • πŸ’³ Order Oversight - Monitor and manage all platform orders

πŸ—οΈ Technology Stack

Backend

  • Framework: Django 5.2.5 (Python 3.11+)
  • Database: MySQL 8.0
  • API: Django REST Framework
  • Authentication: JWT (JSON Web Tokens) + OAuth 2.0
  • Storage: Cloudinary (Image/Media Management)
  • Background Tasks: Django APScheduler
  • PDF Processing: pdf2image, PyPDF2
  • Email Service: Brevo SMTP

Frontend

  • Framework: React 18.3.1 with TypeScript
  • Build Tool: Vite
  • State Management: Zustand
  • UI Components: Shadcn/UI (Radix UI primitives)
  • Styling: Tailwind CSS
  • Forms: React Hook Form + Zod validation
  • Routing: React Router v6
  • Maps: Google Maps API
  • AI Chat: Google Gemini API

Additional Tools

  • Version Control: Git
  • Package Managers: pip, npm
  • PDF Utilities: Poppler (Windows installation required)

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

Requirement Version Description
Python 3.11+ Backend runtime
Node.js 18+ Frontend runtime
MySQL 8.0+ Database server
Git Latest Version control
Poppler Latest PDF processing (Windows)

Note: For Windows users, install Poppler from the official repository. Extract to C:\poppler\ and add C:\poppler\bin to your PATH.

Installation

1. Clone the Repository

git clone https://github.com/yourusername/chefsync.git
cd chefsync

2. Backend Setup

cd backend

# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Copy environment template
cp env.example .env

# Edit .env file with your configuration
# See Environment Variables section below

# Run migrations
python manage.py migrate

# Create superuser (optional)
python manage.py createsuperuser

# Start development server
python manage.py runserver

The backend server will run on http://127.0.0.1:8000

3. Frontend Setup

cd frontend

# Install dependencies
npm install

# Copy environment template
cp .env.example .env.local

# Edit .env.local with your API keys
# See Environment Variables section below

# Start development server
npm run dev

The frontend application will run on http://localhost:8081


βš™οΈ Environment Variables

Backend (.env)

Create a .env file in the backend directory:

# Django Settings
SECRET_KEY=your-super-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1

# Database Configuration
DB_NAME=chefsync_db
DB_USER=root
DB_PASSWORD=your-mysql-password
DB_HOST=localhost
DB_PORT=3306

# Email Configuration (Brevo SMTP)
EMAIL_HOST_USER=your-email@domain.com
EMAIL_HOST_PASSWORD=your-smtp-password
DEFAULT_FROM_EMAIL=noreply@chefsync.com

# Google OAuth
GOOGLE_OAUTH_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
GOOGLE_OAUTH_CLIENT_SECRET=your-google-client-secret

# Cloudinary (Media Storage)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

# Google AI (Gemini)
GOOGLE_AI_API_KEY=your-google-ai-api-key

# CORS Configuration
CORS_ALLOWED_ORIGINS=http://localhost:8081,http://127.0.0.1:8081

Frontend (.env.local)

Create a .env.local file in the frontend directory:

# API Configuration
VITE_API_BASE_URL=http://127.0.0.1:8000/api

# Google OAuth
VITE_GOOGLE_OAUTH_CLIENT_ID=your-google-client-id.apps.googleusercontent.com

# Google Maps API
VITE_GOOGLE_MAPS_API_KEY=your-google-maps-api-key

# Google AI API
VITE_GOOGLE_AI_API_KEY=your-google-ai-api-key

# App Information
VITE_APP_NAME=ChefSync
VITE_APP_VERSION=1.0.0

πŸ—ΊοΈ Google API Setup

ChefSync integrates with several Google services to enhance functionality:

Required APIs

  1. Google Maps API - Location services, address autocomplete, route planning

  2. Google OAuth 2.0 - Social authentication

    • Enable Google Identity API
    • Configure authorized origins and redirect URIs

Optional APIs

  1. Google AI (Gemini) - AI chat assistant

Quick Setup

  1. Visit /setup in the application for interactive API configuration
  2. Or manually add keys to frontend/.env.local
  3. Restart the development server

Note: The app works without API keys but with limited functionality. Location-based features require Google Maps API.


πŸ“ Project Structure

ChefSync/
β”œβ”€β”€ backend/                           # Django Backend
β”‚   β”œβ”€β”€ apps/
β”‚   β”‚   β”œβ”€β”€ authentication/            # User authentication & JWT
β”‚   β”‚   β”‚   β”œβ”€β”€ models.py             # User, JWTToken, EmailOTP
β”‚   β”‚   β”‚   β”œβ”€β”€ views.py              # Auth endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ services/             # JWT, Email services
β”‚   β”‚   β”‚   └── management/           # Django commands
β”‚   β”‚   β”œβ”€β”€ users/                    # User profiles
β”‚   β”‚   β”‚   β”œβ”€β”€ models.py             # Customer, Chef, Delivery profiles
β”‚   β”‚   β”‚   └── views.py              # Profile management
β”‚   β”‚   β”œβ”€β”€ food/                     # Food management
β”‚   β”‚   β”‚   β”œβ”€β”€ models.py             # Food, Cuisine, Category
β”‚   β”‚   β”‚   β”œβ”€β”€ views.py              # Menu endpoints
β”‚   β”‚   β”‚   └── cloudinary_utils.py   # Image handling
β”‚   β”‚   β”œβ”€β”€ orders/                   # Order processing
β”‚   β”‚   β”‚   β”œβ”€β”€ models.py             # Order, OrderItem
β”‚   β”‚   β”‚   β”œβ”€β”€ views.py              # Order management
β”‚   β”‚   β”‚   └── services/             # Order logic
β”‚   β”‚   β”œβ”€β”€ payments/                 # Payment handling
β”‚   β”‚   β”œβ”€β”€ admin_management/         # Admin features
β”‚   β”‚   β”œβ”€β”€ analytics/                # Analytics & reporting
β”‚   β”‚   └── communications/           # Notifications
β”‚   β”œβ”€β”€ config/                       # Django settings
β”‚   β”‚   β”œβ”€β”€ settings.py               # Main configuration
β”‚   β”‚   β”œβ”€β”€ urls.py                   # URL routing
β”‚   β”‚   └── middleware.py             # Custom middleware
β”‚   β”œβ”€β”€ templates/emails/             # Email templates
β”‚   β”œβ”€β”€ utils/                        # Shared utilities
β”‚   β”œβ”€β”€ scripts/                      # Utility scripts
β”‚   β”œβ”€β”€ requirements.txt              # Python dependencies
β”‚   └── manage.py
β”‚
β”œβ”€β”€ frontend/                         # React Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/              # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/               # Auth components
β”‚   β”‚   β”‚   β”œβ”€β”€ layout/             # Nav, Footer, Sidebar
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/              # Admin components
β”‚   β”‚   β”‚   β”œβ”€β”€ cook/               # Chef components
β”‚   β”‚   β”‚   β”œβ”€β”€ delivery/           # Delivery components
β”‚   β”‚   β”‚   └── ui/                 # Shadcn/UI components
β”‚   β”‚   β”œβ”€β”€ pages/                  # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/               # Login, Register
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/              # Admin dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ cook/               # Chef dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ customer/           # Customer pages
β”‚   β”‚   β”‚   └── delivery/           # Delivery dashboard
β”‚   β”‚   β”œβ”€β”€ services/               # API services
β”‚   β”‚   β”œβ”€β”€ store/                  # State management
β”‚   β”‚   β”œβ”€β”€ context/                # React Context
β”‚   β”‚   β”œβ”€β”€ hooks/                  # Custom hooks
β”‚   β”‚   β”œβ”€β”€ types/                  # TypeScript types
β”‚   β”‚   └── utils/                  # Utilities
β”‚   β”œβ”€β”€ public/                     # Static assets
β”‚   β”œβ”€β”€ package.json                # Dependencies
β”‚   └── vite.config.ts              # Vite config
β”‚
β”œβ”€β”€ docs/                            # Additional documentation
β”œβ”€β”€ README.md                        # This file
└── LICENSE                          # MIT License

πŸ” Authentication & Security

Authentication Flow

  1. Registration: Multi-step process with email verification
  2. Email Verification: OTP-based system (6-digit code)
  3. Role Selection: Choose Customer, Chef, or Delivery Partner
  4. Document Upload: Required for Chefs and Delivery Partners
  5. Admin Approval: Manual review for privileged roles
  6. JWT Token Issuance: Secure access and refresh tokens
  7. Automatic Token Refresh: Seamless session management

Security Features

  • πŸ”’ JWT Authentication - Secure token-based auth
  • πŸ”‘ Token Blacklisting - Immediate revocation of compromised tokens
  • πŸ›‘οΈ Rate Limiting - Protection against brute force
  • πŸ” Account Locking - Temporary suspension after failed attempts
  • πŸ”„ Password Hashing - Bcrypt with Django's password validators
  • πŸ“§ Email Verification - OTP-based email confirmation
  • 🚫 CSRF Protection - Cross-site request forgery prevention
  • πŸ” Input Validation - Comprehensive form validation
  • πŸ“„ Document Security - Secure cloud storage with access control

🎨 Key Features Deep Dive

Order Management System

  • Comprehensive Workflow: Cart β†’ Placed β†’ Confirmed β†’ Preparing β†’ Ready β†’ Out for Delivery β†’ Delivered
  • Real-Time Updates: Status changes broadcasted instantly
  • Payment Tracking: Independent payment status management
  • Auto-Cancellation: Unconfirmed orders automatically cancelled after 15 minutes
  • Delivery Fee Calculation: Distance-based pricing with time surcharges

Document Management

  • Drag & Drop Upload: Intuitive file upload interface
  • Multi-Format Support: PDF, JPG, PNG, JPEG
  • PDF Processing: Automatic conversion to images with validation
  • Cloud Storage: Secure Cloudinary integration
  • Admin Review: Document visibility control
  • Proxy Download: Secure document access

AI-Powered Features

  • Smart Recommendations: Personalized food suggestions
  • Chat Assistant: Interactive help powered by Google Gemini
  • Automated Reports: AI-generated insights for administrators
  • Natural Language Processing: Enhanced search capabilities

Delivery Partner Navigation

Dual Navigation System:

  1. Navigate (Google): Full-featured Google Maps with turn-by-turn directions
  2. Quick Navigate: Integrated map modal with instant access

Features:

  • πŸ—ΊοΈ Real-time traffic updates
  • πŸ›£οΈ Route optimization
  • πŸ“ Multi-point routing
  • πŸ“ž Direct contact integration
  • πŸ“ Pickup location detection

πŸ“Š API Documentation

Authentication Endpoints

Method Endpoint Description
POST /api/auth/register/ User registration
POST /api/auth/login/ User login
POST /api/auth/logout/ Logout & token revocation
POST /api/auth/token/refresh/ Refresh JWT tokens
POST /api/auth/send-otp/ Send verification OTP
POST /api/auth/verify-otp/ Verify OTP
POST /api/auth/google/login/ Google OAuth login

Document Endpoints

Method Endpoint Description
GET /api/auth/documents/types/ Get document types
POST /api/auth/documents/upload/ Upload document
GET /api/auth/documents/ Get user documents
DELETE /api/auth/documents/<id>/delete/ Delete document

Order Endpoints

Method Endpoint Description
GET /api/orders/ List orders
POST /api/orders/create/ Create order
GET /api/orders/<id>/ Get order details
PUT /api/orders/<id>/update/ Update order status
DELETE /api/orders/<id>/cancel/ Cancel order

Food Endpoints

Method Endpoint Description
GET /api/food/menus/ List menus
GET /api/food/menus/<id>/ Get menu details
POST /api/food/menus/create/ Create menu (Chef)
GET /api/food/cuisines/ List cuisines

πŸ§ͺ Testing

Backend Tests

cd backend
python manage.py test

Frontend Tests

cd frontend
npm test

Manual Testing Checklist

  • User registration and email verification
  • Document upload (PDF and images)
  • Admin approval workflow
  • Login (email/password and Google OAuth)
  • Order creation and tracking
  • Real-time status updates
  • Payment processing
  • Role-based dashboard access
  • Navigation features (delivery partners)
  • AI chat assistant

πŸš€ Deployment

Production Checklist

  • Set DEBUG=False in environment variables
  • Configure production database
  • Set up SSL/HTTPS certificates
  • Configure production email service
  • Set up Google OAuth for production domain
  • Configure Cloudinary for production
  • Update CORS allowed origins
  • Set up monitoring and logging
  • Configure backup strategy
  • Enable security headers
  • Set up CDN for static files

Docker Deployment (Optional)

# Backend Dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

# Frontend Dockerfile
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
CMD ["npm", "run", "preview"]

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and test thoroughly
  4. Commit your changes: git commit -m 'Add amazing feature'
  5. Push to the branch: `git push """

Branch Strategy:

  • main - Production-ready code
  • develop - Development branch
  • feature/* - New features
  • bugfix/* - Bug fixes
  • hotfix/* - Critical fixes

Code Standards

  • Python: Follow PEP 8 style guide
  • TypeScript: Use strict mode and proper typing
  • React: Use functional components with hooks
  • CSS: Use Tailwind CSS utility classes
  • Commits: Use conventional commit messages

πŸ“š Documentation

Additional Resources

Troubleshooting

Common Issues

  1. Database Connection Error

    • Check database credentials in .env
    • Ensure MySQL server is running
    • Verify database exists
  2. CORS Error

    • Verify CORS_ALLOWED_ORIGINS in settings
    • Check frontend URL matches allowed origins
  3. Google OAuth Error

    • Verify client ID and secret
    • Check authorized origins in Google Console
    • Ensure redirect URIs are configured
  4. Token Refresh Error

    • Check JWT settings in settings.py
    • Verify token expiration times
  5. PDF Processing Error

  6. Email Not Sending

    • Check SMTP configuration
    • Verify Brevo credentials
    • Test with console backend first

Getting Help

  • Check existing Issues
  • Create a new issue with detailed description
  • Include error logs and environment details
  • Provide steps to reproduce the issue

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Django - Web framework for Python
  • React - JavaScript library for UIs
  • Shadcn/UI - Beautiful component library
  • Tailwind CSS - Utility-first CSS framework
  • Zustand - State management
  • Google Cloud - Maps, OAuth, and AI services
  • Cloudinary - Media management
  • Brevo - Email service

πŸ“ž Contact & Support


Made with ❀️ by the ChefSync Team

⭐ Star this repo if you find it helpful!

About

ChefSync is a comprehensive food delivery ecosystem that enables home chefs to monetize their culinary skills by connecting them with customers who crave authentic, homemade meals. The platform facilitates the entire journey from menu discovery to order tracking, ensuring a seamless experience for all stakeholders.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •