# kvreddy9120/50-microservices-project architecture

> Architecture diagram of the GitHub repository kvreddy9120/50-microservices-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kvreddy9120/50-microservices-project
- Repository: https://github.com/kvreddy9120/50-microservices-project

## Overview

RailShack is an IRCTC-style train-booking platform split across 50 microservices. The principal journey is browser access through the frontend and API gateway to train search, booking, payment, and ticket results; the README also documents accounts, trip history, cancellation/refunds, live status, and ancillary travel services. The graph preserves major product capabilities, but the supplied excerpts do not expose most service-to-service booking calls, so those links are intentionally omitted. Shared runtime kits and data infrastructure are shown at the documented level.

Main entry points: [`services/api-gateway/main.go`](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/api-gateway/main.go) (API gateway), [`services/booking/main.go`](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/booking/main.go) (Ticket booking), [`services/auth/main.go`](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/auth/main.go) (Authentication), [`services/cancellation/index.js`](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/cancellation/index.js) (Cancellation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_frontend["Web frontend<br/>[index.js]"]
  node_gateway["API gateway<br/>[main.go]"]
end

subgraph group_journey["Rail journey"]
  node_search["Train search<br/>[main.go]"]
  node_trains["Train details<br/>[main.go]"]
  node_routes["Routes<br/>[main.go]"]
  node_stations["Stations<br/>[main.go]"]
  node_schedules["Schedules<br/>[Main.java]"]
  node_fares["Fare quotes<br/>[Main.java]"]
  node_availability["Seat availability<br/>[main.go]"]
  node_booking["Ticket booking<br/>[main.go]"]
  node_pnr["PNR status<br/>[main.go]"]
  node_live["Live train status<br/>[main.go]"]
  node_ticket["E-ticket rendering<br/>[app.py]"]
end

subgraph group_account["Accounts and finance"]
  node_auth["Authentication<br/>[main.go]"]
  node_profile["User profile<br/>[index.js]"]
  node_history["Booking history<br/>[index.js]"]
  node_cancellation["Cancellation<br/>[index.js]"]
  node_refunds["Refunds<br/>[main.go]"]
  node_payment["Payment gateway<br/>[main.go]"]
  node_wallet["Wallet<br/>[main.go]"]
  node_upi["UPI payments<br/>[index.js]"]
  node_invoices["Tax invoices<br/>[Main.java]"]
end

subgraph group_extras["Travel services"]
  node_food["Food ordering<br/>[index.js]"]
  node_rooms["Retiring rooms<br/>[app.py]"]
  node_cab["Cab booking<br/>[main.go]"]
  node_tourism["Holiday packages<br/>[index.js]"]
  node_kyc["Identity verification<br/>[app.py]"]
end

subgraph group_runtime["Runtime and data"]
  node_gokit["Go runtime kit<br/>[kit.go]"]
  node_javakit["Java runtime kit<br/>[Kit.java]"]
  node_pykit["Python runtime kit<br/>[railkit.py]"]
  node_nodekit["Node runtime kit<br/>[index.js]"]
  node_postgres[("PostgreSQL")]
  node_redis[("Redis cache")]
end

node_traveler(("Traveler"))

node_traveler -->|"uses"| node_frontend
node_frontend -->|"sends API calls"| node_gateway
node_gateway -->|"routes requests"| node_search
node_gateway -->|"routes requests"| node_booking
node_gateway -->|"routes requests"| node_auth
node_gateway -->|"routes requests"| node_history
node_gateway -->|"routes requests"| node_cancellation
node_booking -->|"checks identity"| node_auth
node_history -->|"checks identity"| node_auth
node_cancellation -->|"checks identity"| node_auth
node_search -.-> node_fares
node_booking -.-> node_ticket
node_booking -.-> node_payment
node_cancellation -.-> node_refunds
node_postgres -->|"cached by"| node_redis

click node_frontend "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/frontend/index.js"
click node_gateway "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/api-gateway/main.go"
click node_search "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/search/main.go"
click node_trains "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/trains/main.go"
click node_routes "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/routes/main.go"
click node_stations "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/stations/main.go"
click node_schedules "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/schedules/Main.java"
click node_fares "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/fares/Main.java"
click node_availability "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/seat-map/main.go"
click node_booking "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/booking/main.go"
click node_pnr "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/pnr/main.go"
click node_live "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/live-status/main.go"
click node_ticket "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/ticket-pdf/app.py"
click node_auth "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/auth/main.go"
click node_profile "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/user-profile/index.js"
click node_history "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/booking-history/index.js"
click node_cancellation "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/cancellation/index.js"
click node_refunds "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/refunds/main.go"
click node_payment "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/payment-gateway/main.go"
click node_wallet "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/wallet/main.go"
click node_upi "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/upi/index.js"
click node_invoices "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/invoices/Main.java"
click node_food "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/food-ordering/index.js"
click node_rooms "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/retiring-rooms/app.py"
click node_cab "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/cab-booking/main.go"
click node_tourism "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/tourism/index.js"
click node_kyc "https://github.com/kvreddy9120/50-microservices-project/blob/main/services/kyc/app.py"
click node_gokit "https://github.com/kvreddy9120/50-microservices-project/blob/main/libs/gokit/kit.go"
click node_javakit "https://github.com/kvreddy9120/50-microservices-project/blob/main/libs/javakit/Kit.java"
click node_pykit "https://github.com/kvreddy9120/50-microservices-project/blob/main/libs/pykit/railkit.py"
click node_nodekit "https://github.com/kvreddy9120/50-microservices-project/blob/main/libs/nodekit/railshack-kit/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend,node_gateway toneBlue
class node_search,node_trains,node_routes,node_stations,node_schedules,node_fares,node_availability,node_booking,node_pnr,node_live,node_ticket toneAmber
class node_auth,node_profile,node_history,node_cancellation,node_refunds,node_payment,node_wallet,node_upi,node_invoices toneMint
class node_food,node_rooms,node_cab,node_tourism,node_kyc toneRose
class node_gokit,node_javakit,node_pykit,node_nodekit,node_postgres,node_redis,node_traveler toneIndigo
```

## Components

### User entry

- [Web frontend](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/frontend/index.js): `services/frontend/index.js`
- [API gateway](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/api-gateway/main.go): `services/api-gateway/main.go`

### Rail journey

- [Train search](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/search/main.go): `services/search/main.go`
- [Train details](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/trains/main.go): `services/trains/main.go`
- [Routes](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/routes/main.go): `services/routes/main.go`
- [Stations](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/stations/main.go): `services/stations/main.go`
- [Schedules](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/schedules/Main.java): `services/schedules/Main.java`
- [Fare quotes](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/fares/Main.java): `services/fares/Main.java`
- [Seat availability](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/seat-map/main.go): `services/seat-map/main.go`
- [Ticket booking](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/booking/main.go): `services/booking/main.go`
- [PNR status](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/pnr/main.go): `services/pnr/main.go`
- [Live train status](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/live-status/main.go): `services/live-status/main.go`
- [E-ticket rendering](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/ticket-pdf/app.py): `services/ticket-pdf/app.py`

### Accounts and finance

- [Authentication](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/auth/main.go): `services/auth/main.go`
- [User profile](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/user-profile/index.js): `services/user-profile/index.js`
- [Booking history](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/booking-history/index.js): `services/booking-history/index.js`
- [Cancellation](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/cancellation/index.js): `services/cancellation/index.js`
- [Refunds](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/refunds/main.go): `services/refunds/main.go`
- [Payment gateway](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/payment-gateway/main.go): `services/payment-gateway/main.go`
- [Wallet](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/wallet/main.go): `services/wallet/main.go`
- [UPI payments](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/upi/index.js): `services/upi/index.js`
- [Tax invoices](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/invoices/Main.java): `services/invoices/Main.java`

### Travel services

- [Food ordering](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/food-ordering/index.js): `services/food-ordering/index.js`
- [Retiring rooms](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/retiring-rooms/app.py): `services/retiring-rooms/app.py`
- [Cab booking](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/cab-booking/main.go): `services/cab-booking/main.go`
- [Holiday packages](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/tourism/index.js): `services/tourism/index.js`
- [Identity verification](https://github.com/kvreddy9120/50-microservices-project/blob/main/services/kyc/app.py): `services/kyc/app.py`

### Runtime and data

- [Go runtime kit](https://github.com/kvreddy9120/50-microservices-project/blob/main/libs/gokit/kit.go): `libs/gokit/kit.go`
- [Java runtime kit](https://github.com/kvreddy9120/50-microservices-project/blob/main/libs/javakit/Kit.java): `libs/javakit/Kit.java`
- [Python runtime kit](https://github.com/kvreddy9120/50-microservices-project/blob/main/libs/pykit/railkit.py): `libs/pykit/railkit.py`
- [Node runtime kit](https://github.com/kvreddy9120/50-microservices-project/blob/main/libs/nodekit/railshack-kit/index.js): `libs/nodekit/railshack-kit/index.js`
- **PostgreSQL**
- **Redis cache**

### Other components

- **Traveler**

## Connections

- Traveler → Web frontend: uses (evidence: `README.md`)
- Web frontend → API gateway: sends API calls (evidence: `README.md`)
- API gateway → Train search: routes requests (evidence: `README.md`)
- API gateway → Ticket booking: routes requests (evidence: `README.md`)
- API gateway → Authentication: routes requests (evidence: `README.md`)
- API gateway → Booking history: routes requests (evidence: `README.md`)
- API gateway → Cancellation: routes requests (evidence: `README.md`)
- Ticket booking → Authentication: checks identity (evidence: `README.md`)
- Booking history → Authentication: checks identity (evidence: `README.md`)
- Cancellation → Authentication: checks identity (evidence: `README.md`)
- Train search → Fare quotes
- Ticket booking → E-ticket rendering
- Ticket booking → Payment gateway
- Cancellation → Refunds
- PostgreSQL → Redis cache: cached by (evidence: `README.md`)
