A production-style Flight Reservation Backend System built using Django and Django REST Framework with authentication, flight search, passenger reservation management, Dockerized deployment, and Nginx load balancing support.
This project demonstrates:
- REST API development
- Authentication using DRF Token Auth
- Dockerized Django deployment
- Nginx reverse proxy + load balancing
- Reservation system architecture
- Frontend integration using Vanilla JavaScript
- Environment-based configuration
- Flight Management APIs (CRUD)
- Passenger Management APIs
- Reservation Management APIs
- Flight Search API
- Save Reservation API
- Token-based Authentication
- Input Validation
- Environment Variable Configuration
- Dockerized Application
- Docker Compose Multi-Service Setup
- Nginx Reverse Proxy
- Nginx Load Balancer
- Multiple Django Containers (
web-1,web-2) - Environment-based settings
| Category | Technology |
|---|---|
| Backend | Python 3 |
| Framework | Django 5 |
| API Framework | Django REST Framework |
| Authentication | DRF Token Authentication |
| Database | PostgreSQL / SQLite |
| Deployment | Docker |
| Reverse Proxy | Nginx |
| Frontend | HTML + CSS + Vanilla JS |
flights/
β
βββ flightApp/
β βββ models.py
β βββ serializers.py
β βββ views.py
β
βββ flights/
β βββ settings.py
β βββ urls.py
β
βββ nginx/
β βββ default.conf
β
βββ docker-compose.yml
βββ Dockerfile
βββ .dockerignore
βββ .env.docker
β
βββ frontend/
β βββ index.html
β
βββ manage.pyThe project contains three main entities:
Stores flight information.
| Field | Type |
|---|---|
| flightNumber | CharField |
| airlines | CharField |
| departureCity | CharField |
| arrivalCity | CharField |
| departureDate | DateTimeField |
| departureTime | TimeField |
Stores passenger details.
| Field | Type |
|---|---|
| name | CharField |
| CharField | |
| phone | CharField |
Maps passengers to flights.
| Relationship | Type |
|---|---|
| flight | ForeignKey β Flight |
| passenger | OneToOneField β Passenger |
erDiagram
FLIGHT {
int id PK
string flightNumber
string airlines
string departureCity
string arrivalCity
datetime departureDate
time departureTime
}
PASSENGER {
int id PK
string name
string email
string phone
}
RESERVATION {
int id PK
int flight_id FK
int passenger_id FK
}
FLIGHT ||--o{ RESERVATION : contains
PASSENGER ||--|| RESERVATION : books
graph TD
U[User]
F[Frontend<br/>HTML + CSS + JavaScript]
N[Nginx Reverse Proxy<br/>+ Load Balancer]
W1[Django Container<br/>web-1]
W2[Django Container<br/>web-2]
DB[(Database)]
U --> F
F --> N
N --> W1
N --> W2
W1 --> DB
W2 --> DB
The application uses DRF Token Authentication.
POST /api-token-auth/{
"username": "admin",
"password": "password"
}{
"token": "your_token_here"
}Add token in request headers:
Authorization: Token your_token_here| Method | Endpoint | Description |
|---|---|---|
| GET | /flights/ |
Get all flights |
| POST | /flights/ |
Create flight |
| PUT | /flights/{id}/ |
Update flight |
| DELETE | /flights/{id}/ |
Delete flight |
| Method | Endpoint |
|---|---|
| GET | /passengers/ |
| POST | /passengers/ |
| Method | Endpoint |
|---|---|
| GET | /reservations/ |
| POST | /reservations/ |
POST /flights/findflights{
"departureCity": "Kolkata",
"arrivalCity": "Delhi",
"departureDate": "2026-05-20"
}POST /flights/savereservation{
"flightNumber": 1,
"name": "Aranya",
"email": "aranya@gmail.com",
"phone": "9876543210"
}The project validates flight numbers using regex validation.
^[A-Za-z0-9]*$Only alphanumeric flight numbers are allowed.
Configured using .env.docker.
Example:
SECRET_KEY=your_secret_key
DEBUG=False
ALLOWED_HOSTS=localhost,127.0.0.1
DATABASE_URL=your_database_urlThe application is fully Dockerized.
- Django Application
- PostgreSQL Database
- Nginx Reverse Proxy
git clone <your-repo-url>
cd flightsdocker compose builddocker compose up -ddocker compose exec web python manage.py migratedocker compose exec web python manage.py createsuperuserThe project uses:
- Reverse Proxy
- Least Connection Load Balancing
- Multiple Django Containers
upstream django_cluster {
least_conn;
server web-1:8000;
server web-2:8000;
}This distributes traffic between multiple Django instances.
The frontend is built using:
- HTML
- CSS
- Vanilla JavaScript
Frontend Features:
- Login Page
- Flight Search
- Reservation Booking
- Token Storage
- API Integration
User
β
Frontend
β
Nginx Reverse Proxy
β
Django REST APIs
β
Database
- REST API Design
- Token Authentication
- Reverse Proxy
- Load Balancing
- Docker Networking
- Environment Variables
- Serializer Validation
- Django ORM Relationships
- CRUD Operations
- Multi-container Architecture
- JWT Authentication
- Swagger/OpenAPI Documentation
- Payment Gateway Integration
- Booking History
- Seat Selection
- Email Notifications
- Kubernetes Deployment
- CI/CD Pipeline
- Redis Caching
- Celery Background Tasks
Aranya Majumdar
Backend Developer | Python Developer | DevOps Enthusiast
This project is created for educational and portfolio purposes.