A comprehensive microservices-based food ordering and delivery platform built with modern technologies. Supports four distinct user roles with real-time tracking, secure payments, and complete observability.
- π― Overview
- β¨ Features
- ποΈ Architecture
- π οΈ Tech Stack
- π Quick Start
- π API Documentation
- π³ Docker Deployment
- βΈοΈ Kubernetes Deployment
- π Monitoring & Observability
- π§ͺ Testing
- π€ Contributing
- π License
- π₯ Team
Fastie.Saigon is a full-featured food delivery platform that connects customers, restaurants, and delivery personnel through a seamless digital experience. The platform supports real-time order tracking, secure payment processing, and comprehensive analytics.
- π€ Customers: Browse restaurants, place orders, track deliveries in real-time
- πͺ Restaurant Admins: Manage menus, process orders, update order statuses
- π΄ Delivery Personnel: Accept deliveries, update locations, manage assignments
- π Super Admin: Oversee all users, restaurants, and system operations
- Browse restaurants and menus with rich media
- Advanced search and filtering by cuisine, price, rating
- Shopping cart with real-time updates
- Secure checkout with Stripe integration
- Real-time order tracking with delivery personnel location
- Order history and reordering
- Customer reviews and ratings
- Complete menu management (CRUD operations)
- Order management with status updates
- Real-time order notifications
- Sales analytics and reporting
- Customer feedback management
- Restaurant profile customization
- Real-time delivery assignments
- GPS location sharing
- Order status updates
- Delivery history and earnings tracking
- Route optimization suggestions
- User management across all roles
- Restaurant onboarding and approval
- System-wide analytics and monitoring
- Payment reconciliation
- Customer support tools
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend Apps β β API Gateway β β Monitoring β
β β β (Nginx) β β Stack β
β β’ Client (3000) βββββΊβ β β β’ Prometheus β
β β’ Admin (3001) β β β’ Load Balance β β β’ Grafana β
β β’ Restaurant β β β’ SSL/TLS β β β’ Loki β
β (3002) β β β’ Rate Limiting β β β’ Promtail β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Auth Service β β Order Service β βPayment Service β
β (Port 5001) β β (Port 5005) β β (Port 5004) β
β β’ JWT Auth β β β’ WebSocket β β β’ Stripe β
β β’ User Mgmt β β β’ Real-time β β β’ Webhooks β
βββββββββββββββββββ β β’ Order Logic β βββββββββββββββββββ
βββββββββββββββββββ β
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
βRestaurant Serviceβ βDelivery Service β
β (Port 5002) β β (Port 5003) β
β β’ Menu Mgmt β β β’ GPS Tracking β
β β’ File Upload β β β’ Real-time β
β β’ Analytics β β β’ Assignments β
βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Databases β
β (MongoDB) β
β β’ Auth DB β
β β’ Restaurant DB β
β β’ Order DB β
β β’ Payment DB β
β β’ Delivery DB β
βββββββββββββββββββ
| Service | Port | Technology | Database | Description |
|---|---|---|---|---|
| Auth Service | 5001 | NestJS + TypeScript | MongoDB | JWT authentication, user management |
| Restaurant Service | 5002 | Express.js | MongoDB | Menu management, file uploads |
| Order Service | 5005 | NestJS + WebSocket | MongoDB | Order processing, real-time updates |
| Payment Service | 5004 | Express.js | MongoDB | Stripe integration, webhooks |
| Delivery Service | 5003 | Express.js + Socket.IO | MongoDB | GPS tracking, delivery management |
| Client Frontend | 3000 | Next.js 15 + React 19 | - | Customer-facing application |
| Admin Frontend | 3001 | Next.js + React | - | Super admin dashboard |
| Restaurant Frontend | 3002 | Next.js + React | - | Restaurant management interface |
- Framework: NestJS, Express.js
- Language: TypeScript, JavaScript
- Database: MongoDB with Mongoose ODM
- Authentication: JWT with Passport.js
- Real-time: WebSocket (Socket.IO), Server-Sent Events
- File Storage: Multer for uploads, local storage
- Framework: Next.js 15 (App Router)
- Language: TypeScript, JavaScript
- UI Library: React 19
- Styling: Tailwind CSS, Bootstrap 5
- State Management: React Context, Custom Hooks
- HTTP Client: Axios
- Animations: Framer Motion
- Containerization: Docker & Docker Compose
- Orchestration: Kubernetes (K8s)
- CI/CD: GitHub Actions
- Monitoring: Prometheus + Grafana + Loki
- Load Balancing: Nginx
- Database: MongoDB with StatefulSets
- Payment Processing: Stripe
- Email Service: Resend
- SMS Service: Twilio
- Container Registry: Docker Hub
- Node.js 18+ and npm
- Docker and Docker Compose
- MongoDB (local or cloud)
- Git
git clone https://github.com/CallmeSen/CNPM-Final-Project.git
cd CNPM-Final-Project# Copy environment template
cp env.template .env
# Edit .env with your configuration
# Required: MongoDB URIs, JWT secret, Stripe keys, etc.# Start all services
docker-compose up --build
# Or start individual services
docker-compose up mongodb auth-service restaurant-service# Install dependencies for all services
npm run install:all
# Start MongoDB (if not using Docker)
mongod
# Start backend services
npm run dev:auth # Port 5001
npm run dev:restaurant # Port 5002
npm run dev:order # Port 5005
npm run dev:payment # Port 5004
npm run dev:delivery # Port 5003
# Start frontend applications
cd frontend/client && npm run dev # Port 3000
cd frontend/admin && npm run dev # Port 3001
cd frontend/restaurant && npm run dev # Port 3002- Customer App: http://localhost:3000
- Admin Dashboard: http://localhost:3001
- Restaurant Dashboard: http://localhost:3002
- API Documentation: http://localhost:5001/api (Auth Service)
POST /api/auth/login
POST /api/auth/register
POST /api/auth/refresh
GET /api/auth/profileGET /api/restaurant
POST /api/restaurant
GET /api/restaurant/:id
PUT /api/restaurant/:id
DELETE /api/restaurant/:id
# Menu Management
GET /api/food-items
POST /api/food-items
PUT /api/food-items/:id
DELETE /api/food-items/:idGET /api/orders
POST /api/orders
GET /api/orders/:id
PUT /api/orders/:id/status
WebSocket: /api/orders/eventsPOST /api/payment/create-session
POST /api/payment/webhook
GET /api/payment/status/:orderIdGET /api/delivery/assignments
PUT /api/delivery/:id/status
PUT /api/delivery/:id/location
WebSocket: /api/delivery/tracking# Start complete development stack
docker-compose up --build
# View logs
docker-compose logs -f
# Stop services
docker-compose down# Build production images
docker-compose -f docker-compose.prod.yml build
# Deploy production stack
docker-compose -f docker-compose.prod.yml up -d# Start specific service
docker-compose up auth-service
# Rebuild and restart service
docker-compose up --build --force-recreate auth-service- Kubernetes cluster (Docker Desktop, Minikube, or cloud)
- kubectl configured
- Docker Hub account for image registry
# Push to main branch to trigger deployment
git add .
git commit -m "Deploy to production"
git push origin main# Set Docker Hub credentials
kubectl create secret docker-registry dockerhub-secret \
--docker-server=https://index.docker.io/v1/ \
--docker-username=YOUR_USERNAME \
--docker-password=YOUR_PASSWORD \
# Deploy to Kubernetes
kubectl apply -f infra/k8s/
kubectl apply -f infra/k8s/monitoring
kubectl apply -f infra/k8s/jobs
# Check deployment status
kubectl get pods -n cnpm-food-delivery
kubectl get services -n cnpm-food-delivery- Prometheus: Metrics collection and alerting
- Grafana: Visualization dashboards
- Loki: Log aggregation
- Promtail: Log shipping from containers
- Backend Services Overview: Monitor all microservices
- Frontend Services Overview: Track frontend performance
- System Overview: Infrastructure metrics
- Loki Logs Dashboard: Centralized logging
- Node.js Application Dashboard: Runtime metrics
# Run the monitoring access script
.\start-k8s-port-forward.ps1
# Run tests for specific service
npm run tests:unit
# Run tests with coverage
npm run test:cov
# Run e2e tests
npm run test:e2e# Run load tests
npm run tests:intergration- 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
- TypeScript: Strict mode enabled
- ESLint: Airbnb config with React rules
- Prettier: Code formatting
- Husky: Pre-commit hooks for linting
feat: add new payment method
fix: resolve order status bug
docs: update API documentation
style: format code with Prettier
refactor: optimize database queries
test: add unit tests for auth service
This project is licensed under the GNU License - see the LICENSE file for details.
-
π¨βπ» CallmeSen - Members
-
π¨βπ» Nguyen Huynh Phuong Loc - Members