Sarathi is a production-grade real-time bus booking platform designed to model civilizational mobility networks connecting heritage circuits, pilgrimage routes, and cultural destinations.
The platform demonstrates distributed system design patterns used in modern booking infrastructure.
Frontend
https://sarathi-frontend-3zg8.onrender.com
- Overview
- Key Features
- Screenshots
- Architecture
- Booking Flow
- Real-Time Seat Locking
- Domain Model
- Database Schema
- API Documentation
- Technology Stack
- Project Structure
- Deployment
- Running Locally
- License
Sarathi is designed as a heritage mobility infrastructure.
Instead of modeling simple routes, the system represents:
Circuit β Route β Heritage Nodes β Travelers
This enables the platform to support:
- pilgrimage logistics
- heritage tourism networks
- cultural route exploration
- real-time seat booking infrastructure
The system architecture mirrors patterns used in high-scale booking systems.
Users can explore heritage routes and circuits across culturally significant locations.
Seats are locked using Redis concurrency control, preventing double booking during payment.
WebSockets broadcast seat changes to all users.
Payments are processed through Razorpay with server-side verification.
Successful bookings generate: - PDF tickets - QR codes - booking confirmation
Admins can manage: - routes - users - bookings - system operations
React Frontend
β
βΌ
Spring Boot Backend API
β
βββββββ΄ββββββββββββββββ
β β
βΌ βΌ
PostgreSQL Redis
Primary Data Seat Locks
Seat availability is synchronized using WebSockets.
/topic/seat-updates
All users receive instant updates when seats are locked or booked.
Example Redis lock:
SET seat:bus_12:seat_22 locked EX 300
- Lock expires after 5 minutes
- Prevents double booking during payment
User selects seats
β
βΌ
Seat Lock (Redis)
β
βΌ
Booking Creation
β
βΌ
Razorpay Order
β
βΌ
Payment Verification
β
βΌ
Booking Confirmed
β
βΌ
Ticket Generated
erDiagram
User ||--o{ Booking : makes
Booking ||--|{ Passenger : contains
Booking ||--|| Payment : has
Bus ||--o{ BusSchedule : operates
Bus ||--o{ RouteStop : contains
Bus }o--|| Circuit : belongs_to
BusSchedule ||--o{ Passenger : holds
RouteStop }o--|| YatraPoint : references
YatraPoint }o--o{ Theme : categorized_by
YatraPoint }o--o{ Era : belongs_to
Database stores:
- users
- circuits
- buses
- schedules
- route stops
- heritage nodes
- bookings
- payments
Detailed API docs:
docs/api/api_reference.md
- Spring Boot 3
- Spring Security
- Spring Data JPA
- PostgreSQL
- Redis
- WebSockets
- Razorpay
- JWT Authentication
- React
- React Router
- TailwindCSS
- Axios
- Zustand
- Framer Motion
- Leaflet Maps
- STOMP WebSocket Client
- Docker
- Render
- PostgreSQL (Neon)
- Redis
sarathi
β
βββ frontend
β βββ src
β
βββ src
β βββ controllers
β βββ services
β βββ repositories
β βββ entities
β βββ security
β
βββ docs
β βββ api
β βββ architecture
β βββ database
β βββ screenshots
β
βββ Dockerfile
βββ docker-compose.yml
βββ README.md
Sarathi is deployed using Render Cloud Infrastructure.
Frontend β Render Static Site
Backend β Render Web Service
Database β PostgreSQL
Cache β Redis
Clone the repository:
git clone https://github.com/TheComputationalCore/sarathi.git
cd sarathi
Requirements
- Java 17
- PostgreSQL
- Redis
Run backend:
./mvnw spring-boot:run
Backend runs at:
http://localhost:8080
cd frontend
npm install
npm start
Frontend runs at:
http://localhost:3000
MIT License
TheComputationalCore
If you find this project interesting, please β the repository!










