Skip to content
carlagesaPublic

About

A train-booking application made from 50 cooperating microservices.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

50 Microservices Project by DevOps Shack

YouTube Website License

Microservices Go Node.js Python Java PostgreSQL Redis

A train-booking application made from 50 cooperating microservices.

RailShack lets users search trains, book tickets, check PNR status, view trips, and cancel bookings. This checkout is intentionally focused on the application: service source, shared libraries, local execution, and application tests. Production cloud deployment is out of scope, but a local kind-based Kubernetes workflow is provided for development and testing.

What is in the application?

Area Services
Users & Auth 6: auth, user-profile, passengers, KYC, notifications, preferences
Trains & Search 8: stations, trains, routes, schedules, search, seat-map, fares, quota
Booking 10: booking, PNR, seat-allocation, waitlist, RAC, Tatkal, cancellation, refunds, booking-history, ticket-PDF
Payments 6: payment-gateway, wallet, UPI, invoices, offers, settlements
Travel Extras 8: live-status, platform-info, food-ordering, retiring-rooms, tourism, cab-booking, insurance, chart-preparation
Platform 12: API gateway, config, rate-limiter, audit-log, analytics, search-indexer, email, SMS, scheduler, feedback, admin, frontend

services.json is the service catalog. It assigns each service a language, business domain, and local port from 9001 to 9050. The frontend is on 9050 and the API gateway is on 9039.

The browser talks to the frontend. The frontend sends API requests through the gateway, which calls the appropriate service over HTTP. Services use the language-specific shared kits in libs/ for health checks, logging, metrics, and downstream calls.

RailShack service call map

PostgreSQL is the shared durable store when DATABASE_URL is set. Redis is an optional cache configured with REDIS_ADDR. Some services fall back to in-memory state if these dependencies are not configured; that data disappears when the processes stop.

Run locally

The app runs directly from source; the runner starts all 50 services without building application containers. Run the commands from WSL or another Bash shell. Required runtimes are Go 1.24, Node.js 22, Python 3.13, and JDK 21, plus Python 3 and curl.

For persistent database and cache behavior, start local PostgreSQL 16 and Redis 7 (installed natively or in local-only containers). Create a railshack database, then set the connection variables in the same Bash shell:

export DATABASE_URL='postgres://railshack:railshack-local@127.0.0.1:5432/railshack?sslmode=disable'
export REDIS_ADDR='127.0.0.1:6379'

From the repository root, start the services and run the end-to-end smoke test:

bash scripts/start-services.sh
bash scripts/smoke-test.sh http://localhost:9050

The runner compiles Go and Java services, starts each service on its catalog port, and checks all /healthz endpoints. Logs and process IDs are stored under .run/. If DATABASE_URL and REDIS_ADDR are unset, the application uses its in-memory paths where supported.

The smoke test exercises sign-up/sign-in, train search, booking, PNR lookup, trip history, and cancellation. The test-only GitHub Actions workflow runs the same checks against PostgreSQL and Redis, and builds all 50 service images. Images are validated only: CI does not publish them or deploy the application.

Repository map

Path Purpose
services/ The 50 application services and their runtime source
libs/ Shared Go, Node.js, Python, and Java support libraries
docker/ / .dockerignore Reusable per-runtime Dockerfiles and lean build context
compose.yaml Local network for all services, PostgreSQL, and Redis
k8s/dependencies.yaml kind namespace, shared configuration, PostgreSQL, and Redis
services.json Service names, languages, domains, and local ports
scripts/start-services.sh Build and start the application from source
scripts/load-kind-images.sh / scripts/render-k8s-services.py Load local images and render catalog-based Kubernetes workloads
scripts/smoke-test.sh / scripts/smoke-test.ps1 End-to-end application smoke tests
.github/workflows/ci.yml Syntax, Go vet, and end-to-end application tests
docs/architecture/ Service call-map and service-to-service edges

For a staged guide to rebuilding the removed deployment locally, see the WSL-first local development guide. It starts with one local container and progresses toward a local Kubernetes cluster; no AWS account or credentials are required.

See it in action

RailShack home page

Home — search trains across 20 stations

Live microservice mesh

Live mesh — one booking lights up services it touches

Search results

Search — live availability and fares

Booking and e-ticket

Book — PNR, e-ticket and invoice

Learn with DevOps Shack

This project was created by DevOps Shack. Watch the project and related learning material on YouTube.

License and attribution

RailShack is © 2026 DevOps Shack (Aditya Jaiswal) and licensed under the Apache License 2.0.

Original project and attribution: RailShack by DevOps Shack, created by DevOps Shack (Aditya Jaiswal). If you redistribute this project or a derivative work, retain copyright and license notices, source headers, and mark changed files. Credit shared work as RailShack by DevOps Shack.

About

A train-booking application made from 50 cooperating microservices.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

Contributors

Languages