Skip to content
aldoprogrammerPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

VoyageX

High-Availability Flash Sale Travel Booking Platform — Event-Driven Microservices Architecture.

Repos: github.com/aldoprogrammer/VoyageX

Demo Video

VoyageX Demo Video

Screenshots & UI preview

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.

Architecture

┌─────────────────┐     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.

Prerequisites

  • Docker Desktop (recommended)
  • Node.js 20+ (only if running services locally without Docker)

Environment Variables

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:

Per-service local dev: see booking-service/.env.example, notification-service/.env.example, frontend-service/.env.example

How to Run (Docker — Recommended)

1. Clone & open project

cd VoyageX

2. Start all services

First time only (builds images):

docker compose up --build

Daily dev (code changes hot-reload automatically):

docker compose up

No --build needed unless you change a Dockerfile or Node base image. Adding npm packages only needs a container restart:

docker compose restart booking-service

npm 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-service

3. Wait until services are ready

Look for these logs:

  • booking-service → Booking service running on port 4000
  • notification-service → Notification service running on port 4001
  • frontend-service → Ready on http://0.0.0.0:3000

4. Open the app

Service URL
Frontend http://localhost:3000
Booking API http://localhost:4000
Booking Swagger http://localhost:4000/api/docs
Notification API http://localhost:4001
Notification Swagger http://localhost:4001/api/docs
RabbitMQ Management http://localhost:15672
Prisma Studio (booking) http://localhost:5555
Prisma Studio (notification) http://localhost:5556

RabbitMQ login: voyagex / voyagex_secret

API Docs (Swagger)

After docker compose up, open Swagger UI in your browser:

Service Swagger URL
Booking http://localhost:4000/api/docs
Notification http://localhost:4001/api/docs

How to use (Booking API):

  1. Open http://localhost:4000/api/docs
  2. Expand auth → POST /api/v1/auth/login → Try it out
  3. Use demo credentials (e.g. [email protected] / customer123)
  4. Copy accessToken from the response
  5. Click Authorize (top right) → paste token → Authorize
  6. Try protected endpoints (bookings, flights, simulation, etc.)

Notification Swagger has no auth — e.g. POST /api/v1/notifications/payment for payment chat notifications.

Prisma (DB GUI & CLI)

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:generate

Prisma Studio (Prisma GUI — postgres auto-starts if needed):

npm run prisma:studio

Buka 2 tab (Prisma cuma 1 DB per instance):

URL Models
http://localhost:5555 User, Flight, Seat, Booking
http://localhost:5556 WebhookLog

Satu service saja:

npm run prisma:studio:booking
npm run prisma:studio:notification

5. Stop services

# Stop containers (keep data)
docker compose down

# Stop + delete volumes (fresh DB)
docker compose down -v

Run in background

docker compose up -d          # daily dev
docker compose up --build -d  # first time only
docker compose logs -f        # watch logs

How to Run (Local — Without Docker)

Run each service in a separate terminal. Start infra first:

# Terminal 1 — only PostgreSQL, Redis, RabbitMQ
docker compose up postgres redis rabbitmq

Booking service (port 4000):

cd booking-service
npm install
npx prisma generate
npx prisma db push
npm run seed
npm run start:dev

Notification service (port 4001):

cd notification-service
npm install
npx prisma generate
npx prisma db push
npm run start:dev

Frontend (port 3000):

cd frontend-service
npm install
npm run dev

Demo Credentials

Role Email Password
Admin [email protected] admin123
Customer [email protected] customer123
Manager [email protected] manager123

Flash Sale Stress Test

Admin UI no longer hosts the flash-sale button. Use CLI (optional: open seat map in another tab):

node scripts/flash-sale-stress-test.js

Or 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

Frontend Routes

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

Live Chat Demo

  1. Login as Customer → /dashboard for orders + chat (unread badge on nav only when leaving this page)
  2. Login as Admin at /admin → Support Chat tab (unread bubble on tab when elsewhere) to reply to Customer {name}

Verification

# Linux/macOS
./scripts/verify-system.sh

# Windows (PowerShell)
.\scripts\verify-system.ps1

SLA Targets

  • Redis distributed lock: < 50ms
  • Prisma DB transaction write: < 150ms
  • WebSocket broadcast: < 20ms
  • Zero double-booking via $transaction + Redis SET NX

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages