Skip to content

TheComputationalCore/sarathi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

77 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸš€ Sarathi --- Civilizational Mobility Platform

CI Java Spring Boot React PostgreSQL Redis Docker Architecture Realtime Payments License

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.


🌐 Live Deployment

Frontend
https://sarathi-frontend-3zg8.onrender.com


πŸ“Œ Table of Contents

  • 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

🧠 Overview

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.


✨ Key Features

🚍 Intelligent Route Exploration

Users can explore heritage routes and circuits across culturally significant locations.

🎟 Real-Time Seat Booking

Seats are locked using Redis concurrency control, preventing double booking during payment.

⚑ Live Seat Updates

WebSockets broadcast seat changes to all users.

πŸ’³ Secure Payments

Payments are processed through Razorpay with server-side verification.

πŸ“„ Digital Ticket Generation

Successful bookings generate: - PDF tickets - QR codes - booking confirmation

πŸ›  Admin Control Panel

Admins can manage: - routes - users - bookings - system operations


πŸ–Ό Screenshots

Homepage


Login


Register


Theme Selection


Available Journeys


Seat Selection


Seat Locking


Payment Options


Payment Success


User Profile


Ticket PDF


πŸ— System Architecture

React Frontend
       β”‚
       β–Ό
Spring Boot Backend API
       β”‚
 β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                     β”‚
 β–Ό                     β–Ό
PostgreSQL           Redis
Primary Data         Seat Locks

πŸ“‘ Real-Time Seat Updates

Seat availability is synchronized using WebSockets.

/topic/seat-updates

All users receive instant updates when seats are locked or booked.


πŸ”’ Seat Locking Strategy

Example Redis lock:

SET seat:bus_12:seat_22 locked EX 300
  • Lock expires after 5 minutes
  • Prevents double booking during payment

πŸ” Booking Flow

User selects seats
       β”‚
       β–Ό
Seat Lock (Redis)
       β”‚
       β–Ό
Booking Creation
       β”‚
       β–Ό
Razorpay Order
       β”‚
       β–Ό
Payment Verification
       β”‚
       β–Ό
Booking Confirmed
       β”‚
       β–Ό
Ticket Generated

🧭 Domain Model

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
Loading

πŸ—„ Database Schema

Database stores:

  • users
  • circuits
  • buses
  • schedules
  • route stops
  • heritage nodes
  • bookings
  • payments

πŸ“˜ API Documentation

Detailed API docs:

docs/api/api_reference.md

πŸ›  Technology Stack

Backend

  • Spring Boot 3
  • Spring Security
  • Spring Data JPA
  • PostgreSQL
  • Redis
  • WebSockets
  • Razorpay
  • JWT Authentication

Frontend

  • React
  • React Router
  • TailwindCSS
  • Axios
  • Zustand
  • Framer Motion
  • Leaflet Maps
  • STOMP WebSocket Client

Infrastructure

  • Docker
  • Render
  • PostgreSQL (Neon)
  • Redis

πŸ“‚ Project Structure

sarathi
β”‚
β”œβ”€β”€ frontend
β”‚   └── src
β”‚
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ controllers
β”‚   β”œβ”€β”€ services
β”‚   β”œβ”€β”€ repositories
β”‚   β”œβ”€β”€ entities
β”‚   └── security
β”‚
β”œβ”€β”€ docs
β”‚   β”œβ”€β”€ api
β”‚   β”œβ”€β”€ architecture
β”‚   β”œβ”€β”€ database
β”‚   └── screenshots
β”‚
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ docker-compose.yml
└── README.md

πŸš€ Deployment

Sarathi is deployed using Render Cloud Infrastructure.

Frontend β†’ Render Static Site
Backend β†’ Render Web Service
Database β†’ PostgreSQL
Cache β†’ Redis

βš™οΈ Running Locally

Clone the repository:

git clone https://github.com/TheComputationalCore/sarathi.git
cd sarathi

Backend

Requirements

  • Java 17
  • PostgreSQL
  • Redis

Run backend:

./mvnw spring-boot:run

Backend runs at:

http://localhost:8080

Frontend

cd frontend
npm install
npm start

Frontend runs at:

http://localhost:3000

πŸ“„ License

MIT License


πŸ‘¨β€πŸ’» Author

TheComputationalCore

If you find this project interesting, please ⭐ the repository!

About

Real-time distributed bus booking platform modeling civilizational mobility networks with Spring Boot, React, Redis, and WebSockets.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors