How actualacademie/holbietrips works
HolbieTrips is a local travel-booking and OWASP security-training lab. The main user flow runs from the browser through the local gateway to the React app, then through the API for discovery, authentication, booking, payment, profile, or support operations. PostgreSQL holds business and audit state; payment and mail are local simulators. The API composition root registers the route modules, while the React composition root coordinates feature hooks and screens. The README documents the service topology and capabilities; some route and simulator internals were not excerpted, so those connections are cited only where documented.
Main entry points: app.ts Fastify API · App.tsx React app · api.ts API client · auth.ts Accounts and reset
Components 25
Browser application
- React app
apps/web/src/App.tsx - Session state
apps/web/src/hooks/useSession.ts - Travel data
apps/web/src/hooks/useTravelData.ts - Booking workflow
apps/web/src/hooks/useBookingWorkflow.ts - Catalogue screen
apps/web/src/pages/DiscoverPage.tsx - Booking screens
apps/web/src/pages/BookingsPage.tsx - Profile screen
apps/web/src/pages/ProfilePage.tsx - Support screen
apps/web/src/pages/SupportPage.tsx - Audit screen
apps/web/src/pages/AuditPage.tsx - API client
apps/web/src/api.ts
API and business
- Fastify API
apps/api/src/app.ts - Accounts and reset
apps/api/src/routes/auth.ts - Trip catalogue
apps/api/src/routes/catalog.ts - Booking lifecycle
apps/api/src/routes/bookings.ts - Checkout
apps/api/src/routes/payments.ts - Traveller profile
apps/api/src/routes/profile.ts - Tickets and audit
apps/api/src/routes/support.ts - Health operations
apps/api/src/routes/system.ts - Security helpers
apps/api/src/security.ts - Challenge flags
apps/api/src/challenge-flags.ts
Local runtime
- Local gateway
services/local-gateway/src/server.ts - Payment simulator
services/fake-payment/src/server.ts - Mail simulator
services/fake-mail/src/server.ts
Persistence
- PostgreSQL
Other components
- Traveller
Connections 37
- Traveller → Local gateway: requests app
- Local gateway → Fastify API: proxies traffic
- Fastify API → React app: serves frontend
apps/api/src/app.ts - React app → Session state: restores session
apps/web/src/App.tsx - Session state → API client: validates session
apps/web/src/hooks/useSession.ts - React app → Travel data: loads travel data
apps/web/src/App.tsx - React app → Booking workflow: coordinates booking
apps/web/src/App.tsx - React app → Catalogue screen: renders discovery
apps/web/src/App.tsx - React app → Booking screens: renders bookings
apps/web/src/App.tsx - React app → Profile screen: renders profile
apps/web/src/App.tsx - React app → Support screen: renders support
apps/web/src/App.tsx - React app → Audit screen: renders audit
apps/web/src/App.tsx - Travel data → API client: requests data
apps/web/src/hooks/useTravelData.ts - Booking workflow → API client: runs actions
apps/web/src/hooks/useBookingWorkflow.ts - Profile screen → API client: updates profile
apps/web/src/pages/ProfilePage.tsx - Support screen → API client: manages tickets
apps/web/src/pages/SupportPage.tsx - API client → Fastify API: sends API requests
- Fastify API → Accounts and reset: registers routes
apps/api/src/app.ts - Fastify API → Trip catalogue: registers routes
apps/api/src/app.ts - Fastify API → Booking lifecycle: registers routes
apps/api/src/app.ts - Fastify API → Checkout: registers routes
apps/api/src/app.ts - Fastify API → Traveller profile: registers routes
apps/api/src/app.ts - Fastify API → Tickets and audit: registers routes
apps/api/src/app.ts - Fastify API → Health operations: registers routes
apps/api/src/app.ts - Accounts and reset → PostgreSQL: reads and writes
apps/api/src/routes/auth.ts - Booking lifecycle → PostgreSQL: reads and writes
apps/api/src/routes/bookings.ts - Checkout → PostgreSQL: records checkout
- Traveller profile → PostgreSQL: stores traveller data
- Tickets and audit → PostgreSQL: stores tickets and audit
- Fastify API → PostgreSQL: uses connection pool
apps/api/src/app.ts - Accounts and reset → Mail simulator: sends reset message
apps/api/src/routes/auth.ts - Checkout → Payment simulator: requests payment outcome
- Accounts and reset → Security helpers: uses token helpers
apps/api/src/routes/auth.ts - Booking lifecycle → Security helpers: uses security helpers
apps/api/src/routes/bookings.ts - Checkout → Security helpers: uses signature helpers
apps/api/src/routes/payments.ts - Fastify API → Challenge flags: creates flag provider
apps/api/src/app.ts - Accounts and reset → Challenge flags: returns challenge flag
apps/api/src/routes/auth.ts