CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Railways & Public Transport

🚆 Railways & Public Transport · C4 Architecture · Pro

Train Ticket Reservation System

A railway reservation system in the style of IRCTC: seat inventory per train and class, waitlists, Tatkal quota, payments and e-tickets.

More Railways & Public Transport templates

C4 Architecture diagrams are part of Pro. Anyone can view this one; generating and editing it needs Pro.

Drawing diagram…

What this diagram shows

  • Seat inventory is locked per coach and berth during booking
  • Waitlisted tickets confirm automatically when others cancel
  • Tatkal booking opens at fixed times with extra load protection

Prompt used

Train reservation system: passengers book on the web and mobile app through an API gateway with a queue for Tatkal rush. The availability service answers seat availability per train, date and class from a cache. The booking service locks berths in the seat inventory, creates the PNR, and calls the payment service. The waitlist service confirms waitlisted PNRs when cancellations happen. Tickets are sent by SMS and email, and the chart preparation service finalises berths before departure.

Mermaid code
C4Container
title Train Reservation System
Person(pax, "Passenger", "Books and cancels tickets")
System_Boundary(rs, "Reservation System") {
  Container(gw, "API Gateway and Queue", "NGINX + virtual waiting room", "Handles Tatkal rush")
  Container(av, "Availability Service", "Java", "Seats per train, date, class")
  Container(bk, "Booking Service", "Java", "PNR creation and berth locking")
  Container(wl, "Waitlist Service", "Java", "Confirms on cancellation")
  Container(chart, "Chart Preparation", "Batch job", "Final berth allocation")
  ContainerDb(inv, "Seat Inventory", "Oracle", "Berths per coach")
  ContainerDb(cache, "Availability Cache", "Redis", "Fast seat counts")
}
System_Ext(pg, "Payment Gateway", "UPI, cards, netbanking")
System_Ext(sms, "SMS and Email", "E-tickets")
Rel(pax, gw, "Books", "HTTPS")
Rel(gw, av, "Checks seats")
Rel(av, cache, "Reads")
Rel(gw, bk, "Books")
Rel(bk, inv, "Locks berths")
Rel(bk, pg, "Takes payment")
Rel(bk, sms, "Sends e-ticket")
Rel(wl, inv, "Reallocates berths")
Rel(chart, inv, "Finalises chart")

Related templates

State MachineRailways & Public Transport

Train Ticket (PNR) Status

The states of a train ticket from booking to journey, including RAC and waitlist confirmation and cancellation.

SequenceRailways & Public Transport

Metro Smart Card Fare Collection

How a metro fare is charged with a smart card or bank card: tap in at the entry gate, tap out at the exit, fare by distance and balance update.

Data FlowRailways & Public Transport

Live Bus Tracking and Arrival Times

How a city bus app shows live bus positions and arrival times: GPS devices on buses, a prediction model and updates to apps and stop displays.

NetworkRailways & Public Transport

Railway Signalling and Train Control Network

How a modern railway signalling network is connected: interlocking at stations, track circuits, train control radio and the central traffic control centre.

C4 ArchitectureProRailways & Public Transport

Multimodal Journey Planner

A journey planner that combines metro, bus, suburban train and last-mile options into one trip plan with a single ticket.

Database ERDRailways & Public Transport

Train Operations Database Schema

Tables for train operations: trains, routes, stations, scheduled stops, coaches and daily running with actual times.