A NestJS backend for train ticketing integrating:
- Go7 WorldTicket OTA API - Train reservation system
- Xendit QRIS - Indonesian QR payment
- Bank Mandiri - IDR/SAR exchange rate scraping
# 1. Copy environment variables
cp .env.example .env
# 2. Update .env with your credentials
# - DATABASE_URL (PostgreSQL)
# - OTA_* (Go7 WorldTicket credentials)
# - XENDIT_* (Xendit credentials)
# 3. Setup database
npm run db:setup
# 4. Start development server
npm run start:devAccess Swagger UI at: http://localhost:3000/api
| Role | Password | |
|---|---|---|
| Admin | admin@hhr.com | admin123 |
| B2B | agent@sampletravelagency.com | b2b123 |
| B2C | customer@example.com | user123 |
- JWT-based auth with role guards (ADMIN, B2B, B2C)
- Registration, login, profile endpoints
- Route search
- Low fare search (one-way/round-trip)
- Create, read, cancel bookings
- Ticket download
- QRIS code generation via Xendit
- Webhook handling
- Payment status tracking
- Refunds (Admin only)
- Auto-scrape Bank Mandiri every 30 minutes
- Manual sync endpoint
- Rate history
- User management (CRUD)
- Organization management (B2B markup settings)
- Statistics endpoints
src/
├── config/ # Environment configuration
├── common/ # Guards, decorators
├── prisma/ # Database service
└── modules/
├── auth/ # JWT authentication
├── ota/ # Go7 WorldTicket integration
├── payment/ # Xendit QRIS
├── exchange-rate/# Bank Mandiri scraping
├── users/ # User management
└── organizations/# B2B management
npm run start:dev # Development
npm run build # Build
npm run prisma:push # Sync schema to DB
npm run prisma:seed # Seed test data