Skip to content

nalindard/deliveroo-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍽️ Food Delivery Platform

Disclaimer

This project was initially developed as part of an internship assignment in early 2024. It represents an experimental and in-progress phase, where various approaches and techniques were explored. The codebase is not fully finalized or production-ready and has been uploaded to GitHub primarily for reference and archival purposes.


Food Delivery Platform TypeScript React Node.js Express.js MySQL

A modern, full-stack food delivery platform built with React, Node.js, and TypeScript

πŸš€ Live Demo β€’ πŸ“– Documentation β€’ πŸ› Report Bug β€’ ✨ Request Feature


✨ Features

🎯 Core Functionality

  • πŸͺ Restaurant Management - Complete restaurant onboarding and menu management
  • πŸ›’ Smart Shopping Cart - Persistent cart with real-time updates
  • πŸ“± Responsive Design - Seamless experience across all devices
  • πŸ” Authentication - Secure Google OAuth integration
  • πŸ’³ Order Processing - End-to-end order management system
  • πŸ“ Location Services - Area-based restaurant discovery

🎨 User Experience

  • ⚑ Lightning Fast - Optimized performance with Vite and modern bundling
  • 🎭 Interactive UI - Smooth animations and transitions
  • πŸ” Smart Search - Advanced filtering and categorization
  • πŸ“Š Real-time Updates - Live order tracking and status updates
  • β™Ώ Accessibility - WCAG compliant design

πŸ› οΈ Technical Excellence

  • πŸ—οΈ Modular Architecture - Clean, maintainable codebase
  • πŸ§ͺ Comprehensive Testing - Unit, integration, and E2E tests
  • πŸ“š API Documentation - Swagger/OpenAPI integration
  • πŸ”’ Security First - Helmet.js, CORS, and input validation
  • πŸ“ˆ Scalable Database - Sequelize ORM with MySQL

πŸ—οΈ Architecture

graph TB
    A[React Frontend] --> B[Express API Server]
    B --> C[MySQL Database]
    B --> D[Authentication Service]
    B --> E[Email Service]
    A --> F[Google OAuth]
    
    subgraph "Frontend Stack"
        A1[React 18]
        A2[TypeScript]
        A3[Redux Toolkit]
        A4[Tailwind CSS]
        A5[Vite]
    end
    
    subgraph "Backend Stack"
        B1[Node.js]
        B2[Express.js]
        B3[Sequelize ORM]
        B4[JWT Auth]
        B5[Swagger Docs]
    end
Loading

πŸš€ Quick Start

Prerequisites

Ensure you have the following installed:

  • Node.js (v18 or higher)
  • npm or yarn
  • MySQL (v8.0 or higher)
  • Git

πŸ”§ Installation

  1. Clone the repository

    git clone https://github.com/yourusername/food-delivery-platform.git
    cd food-delivery-platform
  2. Install dependencies

    # Install server dependencies
    cd server
    npm install
    
    # Install client dependencies
    cd ../client
    npm install
  3. Environment Setup

    Create .env files in both server and client directories:

    Server (.env)

    # Database Configuration
    DB_HOST=localhost
    DB_PORT=3306
    DB_NAME=food_delivery
    DB_USER=your_username
    DB_PASSWORD=your_password
    
    # JWT Configuration
    JWT_SECRET=your_super_secret_jwt_key
    JWT_EXPIRES_IN=7d
    
    # Google OAuth
    GOOGLE_CLIENT_ID=your_google_client_id
    GOOGLE_CLIENT_SECRET=your_google_client_secret
    
    # Email Configuration
    SMTP_HOST=smtp.gmail.com
    SMTP_PORT=587
    SMTP_USER=your_email@gmail.com
    SMTP_PASS=your_app_password
    
    # Server Configuration
    PORT=5000
    NODE_ENV=development

    Client (.env)

    VITE_API_BASE_URL=http://localhost:5000/api
    VITE_GOOGLE_CLIENT_ID=your_google_client_id
  4. Database Setup

    cd server
    
    # Run migrations
    npm run db:migrate
    
    # Seed the database with sample data
    npm run seed
  5. Start the application

    # Terminal 1: Start the server
    cd server
    npm run dev
    
    # Terminal 2: Start the client
    cd client
    npm run dev
  6. Access the application


πŸ“ Project Structure

food-delivery-platform/
β”œβ”€β”€ πŸ“ client/                    # React frontend application
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/        # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/            # Page components
β”‚   β”‚   β”œβ”€β”€ πŸ“ hooks/            # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ πŸ“ store/            # Redux store configuration
β”‚   β”‚   β”œβ”€β”€ πŸ“ types/            # TypeScript type definitions
β”‚   β”‚   └── πŸ“ utils/            # Utility functions
β”‚   β”œβ”€β”€ πŸ“„ package.json
β”‚   β”œβ”€β”€ πŸ“„ vite.config.ts
β”‚   └── πŸ“„ tailwind.config.js
β”‚
β”œβ”€β”€ πŸ“ server/                    # Node.js backend application
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ controllers/       # Request handlers
β”‚   β”‚   β”œβ”€β”€ πŸ“ models/           # Database models
β”‚   β”‚   β”œβ”€β”€ πŸ“ routes/           # API routes
β”‚   β”‚   β”œβ”€β”€ πŸ“ middleware/       # Custom middleware
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/         # Business logic
β”‚   β”‚   β”œβ”€β”€ πŸ“ seeders/          # Database seeders
β”‚   β”‚   └── πŸ“ __tests__/        # Test files
β”‚   β”œβ”€β”€ πŸ“ configs/              # Configuration files
β”‚   β”œβ”€β”€ πŸ“„ package.json
β”‚   └── πŸ“„ jest.config.js
β”‚
β”œβ”€β”€ πŸ“„ README.md
└── πŸ“„ .gitignore

πŸ§ͺ Testing

Running Tests

# Server tests
cd server
npm test                    # Run all tests
npm run test:unit          # Unit tests only
npm run test:integration   # Integration tests only
npm run test:e2e          # End-to-end tests

# Client tests
cd client
npm test                   # Run React tests
npm run test:watch        # Watch mode

Test Coverage

# Generate coverage report
cd server
npm run test:coverage

πŸ“š API Documentation

The API is fully documented using Swagger/OpenAPI. Once the server is running, visit:

http://localhost:5000/api-docs

Key Endpoints

Method Endpoint Description
GET /api/restaurants Get all restaurants
GET /api/restaurants/:id Get restaurant details
POST /api/auth/login User authentication
POST /api/orders Create new order
GET /api/orders/:id Get order details

πŸ› οΈ Development

Code Style

This project uses ESLint and Prettier for code formatting:

# Lint code
npm run lint

# Fix linting issues
npm run lint:fix

# Format code
npm run format

Git Hooks

Pre-commit hooks ensure code quality:

  • Runs ESLint
  • Runs Prettier
  • Runs type checking
  • Runs tests

Database Migrations

# Create new migration
npx sequelize-cli migration:generate --name migration-name

# Run migrations
npm run db:migrate

# Rollback migration
npx sequelize-cli db:migrate:undo

πŸš€ Deployment

Production Build

# Build client
cd client
npm run build

# Build server
cd server
npm run build

Docker Deployment

# Build and run with Docker Compose
docker-compose up --build

# Production deployment
docker-compose -f docker-compose.prod.yml up -d

Environment Variables

Ensure all production environment variables are set:

  • Database credentials
  • JWT secrets
  • OAuth credentials
  • SMTP configuration

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code of Conduct

Please read our Code of Conduct before contributing.


πŸ“„ License

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


πŸ™ Acknowledgments

  • React Team - For the amazing React framework
  • Express.js - For the robust web framework
  • Sequelize - For the excellent ORM
  • Tailwind CSS - For the utility-first CSS framework
  • All Contributors - Thank you for your contributions!

πŸ“ž Support


Made with ❀️ by the Food Delivery Platform Team

⭐ Star this repo if you find it helpful! ⭐

About

deliveroo clone using node, TS, Express, Sequalize, MySql, React, Vite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors