A production-oriented food delivery backend built with FastAPI, SQLAlchemy Async ORM, MySQL, JWT authentication, role-based access control, Docker, and a service-layer architecture.
The system supports restaurant management, menu management, order processing, payments, delivery partner management, notifications, and order tracking.
- Async FastAPI architecture
- JWT Authentication & RBAC
- SQLAlchemy 2.0 Async ORM
- Redis caching
- MySQL
- Docker & Docker Compose
- Service Layer architecture
- OpenAPI documentation
- JWT Authentication
- Role-Based Access Control
- Async FastAPI + Async SQLAlchemy
- Dockerized Backend & Frontend
- Shared MySQL & Redis Infrastructure
- Redis Caching
- Admin Management
- Health Monitoring Endpoint
- Rate Limiting using SlowAPI
| Layer | Technology |
|---|---|
| Backend | FastAPI |
| Database | MySQL |
| Cache | Redis |
| ORM | SQLAlchemy 2.x Async |
| Async Driver | aiomysql |
| Frontend | React + Vite |
| Authentication | JWT |
| Password Hashing | bcrypt + passlib |
| Authorization | RBAC |
| Server | Uvicorn / Gunicorn |
| Containerization | Docker + Docker Compose |
.
├── backend/
│ ├── app/
│ │ ├── api/
│ │ │ └── routes/ # FastAPI route modules
│ │ ├── core/ # Config, security, constants, logging, exceptions
│ │ ├── db/ # Async database session
│ │ │ └── models/ # SQLAlchemy models
│ │ ├── repositories/ # Repository layer placeholders
│ │ ├── schemas/ # Pydantic request/response schemas
│ │ ├── services/ # Business logic modules
│ │ ├── tasks/ # Background task placeholders
│ │ ├── tests/ # Test placeholders
│ │ ├── websocket/ # Realtime event and handler placeholders
│ │ │
│ │ ├── lifespan.py
│ │ └── main.py
│ │
│ ├──.env.example
│ └── requirements.txt
│
├── db_queries/ # Database setup tables creation and permissions
├── docker/ # Dockerfiles
├── docs/ # Documentaion about project
├── frontend/ # Frontend
├── images/ # Image about project
├── k6/ # Load test
├── nginx/ # Nginx placeholder
├── scripts/ # Utility script
│
├── docker-compose.oss.yml # Whole project Container
├── docker-compose.yml # Api Container
├── LICENSE
├── progress.md
└── README.md
Installation
├── Clone repository
├── Configure .env
├── Install dependencies
├── Run database
├── Run backend
└── Run frontend
git clone https://github.com/Dhruv-Cmds/Delivery-System.git
cd Delivery-Systemcp .env.example .env
python -m venv .venv.venv\Scripts\activatesource .venv/bin/activatepip install -r requirements.txtuvicorn app.main:app --reload --port 8000Protected routes require:
Authorization: Bearer <your_token>
curl -X POST http://127.0.0.1:8003/api/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"admin123"}'curl http://127.0.0.1:8003/api/order \
-H "Authorization: Bearer <ACCESS_TOKEN>"Swagger Docs:
http://127.0.0.1:8003/docs
ReDoc:
http://127.0.0.1:8003/redoc
Detailed documentation is available in the docs/ directory.
| Document | Description |
|---|---|
| Architecture | System architecture, service layers, domain model, and core modules. |
| Docker | Docker workflows, shared infrastructure, and local development. |
| Security | Authentication, authorization, validation, and production security. |
This project is intended for educational and portfolio purposes.
See LICENSE for details.the LICENSE file for details.




