Skip to main content

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-gateway is 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-supplied x-tenant-id / x-property-id headers 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 tenantId column. It is not schema-per-tenant.
  • Events. The event bus is Redis Streams, published and consumed through @hmp/messaging. That package's class is named KafkaService for 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/search is a Meilisearch client. The platform does not use Elasticsearch or OpenSearch.
  • Frontends. All frontends call relative /api paths; 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.

Where the detail lives​