High-Availability Flash Sale Travel Booking Platform — Event-Driven Microservices Architecture.
Repos: github.com/aldoprogrammer/VoyageX
Full gallery (flights, hotels, packages, PayPulse checkout, orders, chat, admin): docs/preview/PLATFORM_PREVIEW.md
Payments: hotel/package checkout uses sister project PayPulse API (wallet gateway on :4100) — see docs/VoyageX-PayPulse-Integration-v1.0.md.
Quick PayPulse demo: start PayPulse on :4100, run npm run bootstrap:voyagex, set PAYPULSE_API_KEY in .env, then docker compose up -d --force-recreate booking-service. Book a hotel/package → Continue to PayPulse → hosted checkout → /dashboard.
┌─────────────────┐ REST (catalog/orders/KPIs) ┌──────────────────┐
│ frontend-service│◄────────────────────────────────│ booking-service │
│ (Next.js) │ Webhook POST │ (NestJS) │
│ Port 3000 │◄────────────────────────────────│ Port 4000 │
└────────▲────────┘ └────────┬─────────┘
│ │
│ ┌──────────┼──────────┐
│ │ │ │
┌────────┴────────┐ ┌──────▼──┐ ┌─────▼────┐ ┌──▼──────┐
│ notification- │◄──RabbitMQ───────────────│PostgreSQL│ │ Redis │ │RabbitMQ │
│ service :4001 │ WebSocket (Chat) └──────────┘ └──────────┘ └─────────┘
└─────────────────┘
Project docs (RBAC, SLA, realtime, admin): see docs/README.md.
- Docker Desktop (recommended)
- Node.js 20+ (only if running services locally without Docker)
No .env file existed before — all config was hardcoded in docker-compose.yml. Now:
cp .env.example .env| Variable | Default | Used by |
|---|---|---|
POSTGRES_USER / POSTGRES_PASSWORD |
voyagex / voyagex_secret |
PostgreSQL |
RABBITMQ_USER / RABBITMQ_PASSWORD |
voyagex / voyagex_secret |
RabbitMQ + RABBITMQ_URL |
JWT_SECRET |
(see .env.example) |
booking-service |
NEXT_PUBLIC_* |
localhost URLs | frontend (browser) |
PAYPULSE_ENABLED |
true |
booking-service — set false to force offline PAID |
PAYPULSE_API_URL |
http://host.docker.internal:4100 |
booking-service → PayPulse API |
PAYPULSE_API_KEY |
(empty) | From PayPulse bootstrap:voyagex; required for UNPAID flow |
PAYPULSE_CALLBACK_URL |
http://host.docker.internal:4000/api/v1/webhooks/paypulse |
PayPulse webhook target |
RabbitMQ credentials:
- AMQP:
amqp://voyagex:voyagex_secret@localhost:5672 - Management UI: http://localhost:15672 → login
voyagex/voyagex_secret
Per-service local dev: see booking-service/.env.example, notification-service/.env.example, frontend-service/.env.example
cd VoyageXFirst time only (builds images):
docker compose up --buildDaily dev (code changes hot-reload automatically):
docker compose upNo --build needed unless you change a Dockerfile or Node base image.
Adding npm packages only needs a container restart:
docker compose restart booking-servicenpm install runs automatically when package-lock.json changes.
PayPulse / .env changes: recreate booking container (env is injected at create time):
docker compose up -d --force-recreate booking-serviceLook for these logs:
booking-service→Booking service running on port 4000notification-service→Notification service running on port 4001frontend-service→Ready on http://0.0.0.0:3000
RabbitMQ login: voyagex / voyagex_secret
After docker compose up, open Swagger UI in your browser:
How to use (Booking API):
- Open http://localhost:4000/api/docs
- Expand auth →
POST /api/v1/auth/login→ Try it out - Use demo credentials (e.g.
[email protected]/customer123) - Copy
accessTokenfrom the response - Click Authorize (top right) → paste token → Authorize
- Try protected endpoints (bookings, flights, simulation, etc.)
Notification Swagger has no auth — e.g. POST /api/v1/notifications/payment for payment chat notifications.
Do not run npx prisma from project root — it downloads Prisma 7.x (needs Node 22+).
This repo uses Prisma 5.22 (Node 20 compatible) inside each service.
Generate client (from root):
npm run prisma:generatePrisma Studio (Prisma GUI — postgres auto-starts if needed):
npm run prisma:studioBuka 2 tab (Prisma cuma 1 DB per instance):
Satu service saja:
npm run prisma:studio:booking
npm run prisma:studio:notification# Stop containers (keep data)
docker compose down
# Stop + delete volumes (fresh DB)
docker compose down -vdocker compose up -d # daily dev
docker compose up --build -d # first time only
docker compose logs -f # watch logsRun each service in a separate terminal. Start infra first:
# Terminal 1 — only PostgreSQL, Redis, RabbitMQ
docker compose up postgres redis rabbitmqBooking service (port 4000):
cd booking-service
npm install
npx prisma generate
npx prisma db push
npm run seed
npm run start:devNotification service (port 4001):
cd notification-service
npm install
npx prisma generate
npx prisma db push
npm run start:devFrontend (port 3000):
cd frontend-service
npm install
npm run dev| Role | Password | |
|---|---|---|
| Admin | [email protected] | admin123 |
| Customer | [email protected] | customer123 |
| Manager | [email protected] | manager123 |
Admin UI no longer hosts the flash-sale button. Use CLI (optional: open seat map in another tab):
node scripts/flash-sale-stress-test.jsOr call POST /api/v1/simulation/flash-sale as ADMIN (see Swagger / RBAC docs).
Open checkout: http://localhost:3000/flights/{flightId}/checkout
Open live seat monitor: http://localhost:3000/flights/{flightId}/seat-map
| Route | Description |
|---|---|
/ |
Flights marketplace |
/hotels |
Hotel listings (catalog API) |
/hotels/[id]/checkout |
Hotel checkout → Continue to PayPulse → UNPAID order |
/packages |
Travel packages (catalog API) |
/packages/[id]/checkout |
Package checkout → Continue to PayPulse → UNPAID order |
/paypulse/checkout |
Hosted PayPulse checkout (TEST MODE · Card / PulsePay Wallet · 5s → /dashboard) |
/dashboard |
Customer orders table + detail; collapsible live chat |
/login |
Sign in |
/flights/[id]/checkout |
Flight checkout — instant PAID (seat lock; no PayPulse) |
/flights/[id]/seat-map |
Live seat monitor |
/admin |
Admin: Overview, Orders, Hotels, Packages, Support Chat |
Admin details: docs/admin-dashboard.md · UX backlog: docs/VoyageX-UX-Notifications-Backlog-v1.0.md
- Login as Customer →
/dashboardfor orders + chat (unread badge on nav only when leaving this page) - Login as Admin at
/admin→ Support Chat tab (unread bubble on tab when elsewhere) to reply to Customer {name}
# Linux/macOS
./scripts/verify-system.sh
# Windows (PowerShell)
.\scripts\verify-system.ps1- Redis distributed lock: < 50ms
- Prisma DB transaction write: < 150ms
- WebSocket broadcast: < 20ms
- Zero double-booking via
$transaction+ RedisSET NX