System Architecture
A short map of the platform. Each statement here is taken from the workspace-root CLAUDE.md
(the HMP multi-repo root, one directory above this repo); the linked pages carry the detail.
High-Level Architecture
What is true of every part
- Gateway.
hmp-api-gatewayis a NestJS service written for this platform, not a third-party gateway product. It routes by path prefix, proxies to the owning service, rate-limits, strips client-suppliedx-tenant-id/x-property-idheaders and re-injects them from the JWT when the token carries the claim. - Services. Each backend is an independent NestJS repo that owns its own data. A service
reads another service's data over HTTP through a typed client in
@hmp/service-clients, never through a shared database. There are no foreign-key constraints across services. - Multi-tenancy. One schema per service, shared by all tenants; every query is scoped by
an indexed
tenantIdcolumn. It is not schema-per-tenant. - Events. The event bus is Redis Streams, published and consumed through
@hmp/messaging. That package's class is namedKafkaServicefor call-site compatibility only; there is no Kafka. Consume is at-least-once; a direct publish is best-effort unless it goes through the transactional outbox. - Search.
@hmp/searchis a Meilisearch client. The platform does not use Elasticsearch or OpenSearch. - Frontends. All frontends call relative
/apipaths; no API URL is baked in at build time. - Runtime. Services run as containers on Kubernetes (AWS EKS, region
ap-south-1), with Terraform for the infrastructure and ArgoCD syncing the manifests.