Tools & Apps · 2026
RailYatri
Railway reservation system where PostgreSQL itself guarantees a berth is sold once

RailYatri is a full-stack railway reservation system on PostgreSQL, FastAPI, React and TypeScript: train search, seat availability, booking, wallet payments, e-tickets, cancellations, refunds and analytics, with the hard rules enforced inside the database.
When Tatkal opens, hundreds of people press Book on the same few berths in the same second. RailYatri answers the hard questions inside PostgreSQL, where a buggy client cannot skip them: a berth is free only for a stretch of the route, it is sold exactly once, a retried payment charges once, and a cancellation promotes RAC and waiting-list passengers in order.
Built by 17 students in six groups, each owning one module of the same schema. I worked on the rail network and journey planner: station search over 8,151 stations, and direct and one-change journeys over 186,124 timetable rows.
What it does
- 35 tables in 3NF across 73 idempotent migrations
- An exclusion constraint on berth, date and stop range: twenty parallel requests for the last berth sell it once
- Double-entry wallet ledger checked by a deferred constraint trigger at commit
- Row-level security hides other people's bookings even if the API forgets a WHERE
- Trigram station autocomplete and one-change journey search with window functions
Built with
- PostgreSQL
- FastAPI
- Python
- React
- TypeScript