Skip to main content

Architecture

The Tee Time system comprises:

  1. App: apps/teetime/teetime-backend
  • NestJS HTTP API with global prefix api and Swagger docs at /api/docs.
  • Wraps and exposes controllers from @digiwedge/tee-time-services for core domain endpoints (clubs, tee sheets, players, weather, pricing).
  • Hosts a small set of pass‑through legacy endpoints under /api/mca-v1/* for compatibility with older mobile/web clients (see API doc for the list).
  • Exposes IP location endpoints using the shared GeoIP service (separate from MCA v1; no proxy):
    • /api/ip-location → minimal { latitude, longitude } (approximate)
    • /api/ip-location/details → enriched with countryIso, city, accuracyRadius
    • Responses are marked Cache-Control: no-store and Vary: X-Forwarded-For to avoid intermediary cache key collisions.

Admin controllers are exposed under /admin/* and are consumed by the teetime-admin portal via the workspace API client @digiwedge/teetime-api-client.

  1. Library: libs/tee-time-services
  • Business logic and NestJS module (TeeTimeServicesModule) with controllers and providers for tee sheet search, pricing, enrichment, and user features.
  • Uses Prisma repositories for tee‑sheet data and optional provider adapters (GolfNow, Lightspeed, Foreup) via a bridge service.
  1. Shared utilities & data
  • Prisma data packages (e.g. @prisma/teetime) for persistence.
  • Observability, rate‑limiting, caching, and scheduling are wired in the app.
  • API client for frontends: libs/services/client/teetime-api-client.

Backend boundaries

The backend hosts high‑level endpoints and leaves business logic to @digiwedge/tee-time-services. This keeps Nest modules small and focused on transport concerns while the library owns the domain model and rules.

Ingress & routing

Traefik terminates TLS and routes external traffic:

  • teetime-api.uat.digiwedge.com → backend Service teetime-backend (port 80 → 3300)
  • teetime.uat.digiwedge.com → frontend Service teetime-frontend (port 80)
  • teetime-docs.uat.digiwedge.com → docs Service teetime-docs (port 80)
  • teetime-db.kub-jhb-01.digiwedge.com (TCP SNI) → PostgreSQL StatefulSet (port 5438 → 5432)

Access control

See ./access-control.md for roles, permissions and seeding commands.