(Ahmedabad <-> Mumbai)
A web-based sleeper bus booking system with integrated meal selection and a mock AI-based booking confirmation prediction feature.
The system demonstrates real-world backend concepts such as concurrency handling, transaction safety, and probabilistic prediction logic.
- Interactive seat selection (Upper & Lower deck)
- Meal booking during checkout (Full / Half meal)
- Concurrency-safe seat booking (prevents double booking)
- Booking cancellation with seat release
- Mock prediction API for booking confirmation probability
- GET /seat – List all seats with availability
- POST /booking/preview – Calculate price before confirmation
- POST /booking/confirm – Confirm booking
- POST /booking/cancel – Cancel booking and release seats
- POST /booking/predict – Predict booking confirmation probability
- Successful booking with seat and meal
- Seat availability reflected in real time
- Booking cancellation releases seats
- Two users attempting to book the same seat concurrently
- Booking attempt without selecting any seat
- Backend: Python (FastAPI)
- Database: SQLite
- Frontend: React + Vite
- Navigate to
serverfolder. - Install dependencies:
pip install -r requirements.txt - Run the server:
uvicorn app.main:app --reload - API runs at:
http://localhost:8000 - Docs available at:
http://localhost:8000/docs
- Navigate to
clientfolder. - Install dependencies:
npm install - Run the app:
npm run dev