Architecture
The Tee Time system comprises:
- App:
apps/teetime/teetime-backend
- NestJS HTTP API with global prefix
apiand Swagger docs at/api/docs. - Wraps and exposes controllers from
@digiwedge/tee-time-servicesfor 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 withcountryIso,city,accuracyRadius- Responses are marked
Cache-Control: no-storeandVary: X-Forwarded-Forto 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.
- 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.
- 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 Serviceteetime-backend(port 80 → 3300)teetime.uat.digiwedge.com→ frontend Serviceteetime-frontend(port 80)teetime-docs.uat.digiwedge.com→ docs Serviceteetime-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.