A premium Django-based booking platform for intercity sleeper bus travel, featuring real-time seat selection, meal integration, and AI-powered booking predictions.
- Backend API Implementation: Robust RESTful API using Django REST Framework with
ViewSetsandRouters. - Visual Seat Selection: Interactive map distinguishing Lower (L1-L15) vs. Upper (U1-U15) deck sleeper seats.
- Smart Prediction Logic: Mock AI algorithm calculating a "Confirmation Probability %" based on user intent signals (meal choice, group size).
- Concurrency Handling: Prevents double-booking using Atomic Transactions and Row Locking.
- Integrated Add-ons: Seamless meal booking (Veg/Snack) affecting total fare calculation.
- Seat Booking Flow: User selects seat -> Fills Passenger Details -> Booking Creation Success.
- API Validation: Rejects invalid phone numbers (non-10 digits) and names (special characters).
- Race Condition Check: Concurrent requests for the same seat results in one success and one failure.
- Zero Availability: System gracefully handles full bus scenario.
- Data Integrity: Checks ensuring Seat status updates strictly match Booking records.
- Clone the Repository:
git clone <repository-url> cd sleeper_bus_project
- Install Dependencies:
pip install django djangorestframework
- Initialize Database:
python manage.py migrate python manage.py shell -c "import populate_db; populate_db.run()" - Run Application:
python manage.py runserver