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.
A modern, full-stack food delivery platform built with React, Node.js, and TypeScript
π Live Demo β’ π Documentation β’ π Report Bug β’ β¨ Request Feature
- πͺ 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
- β‘ 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
- ποΈ 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
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
Ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- MySQL (v8.0 or higher)
- Git
-
Clone the repository
git clone https://github.com/yourusername/food-delivery-platform.git cd food-delivery-platform -
Install dependencies
# Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
-
Environment Setup
Create
.envfiles in bothserverandclientdirectories: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
-
Database Setup
cd server # Run migrations npm run db:migrate # Seed the database with sample data npm run seed
-
Start the application
# Terminal 1: Start the server cd server npm run dev # Terminal 2: Start the client cd client npm run dev
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- API Documentation: http://localhost:5000/api-docs
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
# 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# Generate coverage report
cd server
npm run test:coverageThe API is fully documented using Swagger/OpenAPI. Once the server is running, visit:
http://localhost:5000/api-docs
| 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 |
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 formatPre-commit hooks ensure code quality:
- Runs ESLint
- Runs Prettier
- Runs type checking
- Runs tests
# 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# Build client
cd client
npm run build
# Build server
cd server
npm run build# Build and run with Docker Compose
docker-compose up --build
# Production deployment
docker-compose -f docker-compose.prod.yml up -dEnsure all production environment variables are set:
- Database credentials
- JWT secrets
- OAuth credentials
- SMTP configuration
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please read our Code of Conduct before contributing.
This project is licensed under the MIT License - see the LICENSE file for details.
- 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!
- π§ Email: support@fooddelivery.com
- π¬ Discord: Join our community
- π Issues: GitHub Issues
- π Wiki: Project Wiki
Made with β€οΈ by the Food Delivery Platform Team
β Star this repo if you find it helpful! β