How d-exponent/guard works
NCA is a Go modular-monolith backend for location-aware community alerts. The main user flow is a client calling the versioned REST API: identity authenticates the request, then group coverage and alert workflows support creating alerts and escalating them through background jobs; authenticated members receive realtime delivery. Billing and operational metrics are distinct capabilities. The graph follows documented process wiring and sampled handler calls; unsampled service internals are represented at their listed paths, without asserting unverified calls between them.
Main entry points: app/app.go API Composition · handler.go Billing Endpoints · app/app.go Realtime Composition · alerts Alert Workflows
Components 24
REST API
- API Composition
cmd/api/app/app.go - Versioned Routes
cmd/api/routes/v1.go
Community Domains
- Identity and Sessions
internal/modules/identity - Auth Endpoints
internal/modules/identity/handler_auth.go - Groups and Coverage
internal/modules/groups - Group Endpoints
internal/modules/groups/handler.go - Alert Workflows
internal/modules/alerts - Alert Endpoints
internal/modules/alerts/handler.go - Plans and Purchases
internal/modules/billing - Billing Endpoints
internal/modules/billing/handler.go - Domain Types
internal/kernel/models/enums.go
Async Delivery
- Worker Bootstrap
cmd/workers/bootstrap/app.go - Escalation Worker
internal/modules/alerts/jobs.go - River Job Queue
internal/platform/jobs/client.go
Realtime Service
- Realtime Composition
cmd/realtime/app/app.go - Realtime Access
internal/modules/realtime/svc.go - WebSocket Node
internal/platform/realtime/node.go
Platform Infrastructure
- PostgreSQL and PostGIS
internal/platform/postgres/pool.go - Redis Client
internal/platform/redis/client.go - SMS Delivery
internal/platform/messaging/sms.go - Prometheus Metrics
internal/platform/metrics/metrics.go
Other components
- API Client
- Paystack
- Community Member
Connections 23
- API Client → API Composition: sends requests
- API Composition → Versioned Routes: mounts routes
cmd/api/app/app.go - API Composition → Auth Endpoints: wires handler
cmd/api/app/app.go - API Composition → Group Endpoints: wires handler
cmd/api/app/app.go - API Composition → Alert Endpoints: wires handler
cmd/api/app/app.go - API Composition → Billing Endpoints: wires handler
cmd/api/app/app.go - Auth Endpoints → Identity and Sessions: calls service
internal/modules/identity/handler_auth.go - Group Endpoints → Groups and Coverage: serves requests
- Alert Endpoints → Alert Workflows: serves requests
- Billing Endpoints → Plans and Purchases: calls service
internal/modules/billing/handler.go - Billing Endpoints → Paystack: accepts webhooks
internal/modules/billing/handler.go - Alert Workflows → River Job Queue: queues escalation
- Worker Bootstrap → Escalation Worker: registers worker
cmd/workers/bootstrap/app.go - Worker Bootstrap → River Job Queue: creates client
cmd/workers/bootstrap/app.go - Community Member → Realtime Composition: opens socket
- Realtime Composition → Realtime Access: configures access
cmd/realtime/app/app.go - Realtime Composition → WebSocket Node: starts node
cmd/realtime/app/app.go - API Composition → PostgreSQL and PostGIS: builds repositories
cmd/api/app/app.go - API Composition → Redis Client: builds cache
cmd/api/app/app.go - API Composition → SMS Delivery: builds sender
cmd/api/app/app.go - API Composition → Prometheus Metrics: instruments routes
cmd/api/app/app.go - API Composition → WebSocket Node: creates broker node
cmd/api/app/app.go - Domain Types → Alert Workflows: models domain