< back to consultanist

> cat tech-stack.yaml

THE STACK.

The technology powering all Consultanist products. Open standards. Self-hosted. Clinical-grade safety. Zero vendor lock-in.

frontend:.yaml
framework:Next.js 15 (App Router + React 19 + Turbopack)
compiler:React Compiler (automatic memoization)
styling:Tailwind CSS v4 (design token architecture)
language:TypeScript — strict mode, zero errors
state:TanStack Query (server) + Zustand (client)
pwa:Service Worker + offline shell + push notifications
i18n:next-intl — en, ur, ar, fr, es (RTL-native)
themes:Carbon Rose · Platinum · Glass Deck · Bento
backend:.yaml
api:tRPC v11 (internal) + REST/OpenAPI (external)
orm:Drizzle ORM — type-safe, migration-first
database:PostgreSQL + pgvector (semantic search)
multitenancy:DB-per-tenant (EMRGENIUS full isolation)
pooling:PgBouncer for connection pooling across tenants
jobs:pgboss — PostgreSQL-backed queues, no Redis at launch
realtime:SSE (dashboards) + Socket.io (chat only)
auth:Better Auth — self-hosted, MFA, OAuth, passkeys
ai_core:.yaml
architecture:Custom AI layer in @emr/ai-core — no Vercel AI SDK
agents:7 AI agents across clinical workflow
providers:GPT-4o · Gemini · Claude · local OSS (toggle)
embeddings:pgvector — patient record semantic matching
phi_safety:PHI pseudonymization before any LLM call
safety:Deterministic rules always override AI output
cv:DINOv2 — visual similarity for dermatology
search:Meilisearch — self-hosted, tenant-scoped
clinical_safety:.yaml
interactions:236,000+ drug interaction pairs checked
rules:294 clinical rules + 65 red flags (audit pipeline)
layers:6-layer safety system on every prescription
audit:Immutable audit trail on all clinical events
fhir:FHIR R4 — full export, no lock-in
consent:Granular per-action consent framework
standards:HIPAA · PIPEDA · GDPR · regional regulatory aligned
infrastructure:.yaml
deployment:Docker Compose — self-hosted, no vendor lock-in
proxy:Caddy (automatic HTTPS, custom domains)
cdn:Cloudflare (DDoS, WAF, DNS, edge cache)
secrets:Doppler — centralised secrets management
observability:Grafana + Prometheus + Loki (self-hosted)
ci_cd:GitHub Actions — test, lint, build, deploy
monorepo:Turborepo + pnpm workspaces
cms:Payload CMS 3.0 — clinical content + tenant sites
scale_numbers:.yaml
packages:42+ shared @emr/* packages
db_tables:159 database tables
pages:275+ pages across 4 apps
ts_errors:0 TypeScript errors (strict mode)
specialties:26 clinical specialties supported
languages:5 languages, 2 RTL scripts
apps:4 production apps (patient · staff · EMR · regional)
tech-stack.yaml
# Consultanist Unified Tech Stack
# Powers: VitalNoor · LongevitAge · EMRGENIUS · Regional

frontend:
  framework:   Next.js 15 (App Router + React 19)
  styling:     Tailwind CSS v4 (design token architecture)
  language:    TypeScript (strict, 0 errors)
  state:       TanStack Query + Zustand
  i18n:        next-intl (en, ur, ar, fr, es — RTL native)
  themes:      Carbon Rose · Platinum · Glass Deck · Bento

backend:
  api:         tRPC v11 + REST/OpenAPI
  orm:         Drizzle ORM
  database:    PostgreSQL + pgvector (multi-tenant, DB-per-tenant)
  auth:        Better Auth (self-hosted, MFA, OAuth, passkeys)
  jobs:        pgboss (PostgreSQL-backed queues, no Redis)
  realtime:    SSE (dashboards) + Socket.io (chat only)

ai:
  layer:       Custom @emr/ai-core (no Vercel AI SDK)
  agents:      7 clinical AI agents
  providers:   GPT-4o · Gemini · Claude · local OSS (hot-swap)
  safety:      PHI pseudonymized before every external call
  embeddings:  pgvector semantic patient matching
  cv:          DINOv2 visual similarity (dermatology)

clinical_safety:
  interactions: 236,000+ drug interaction pairs
  rules:        294 clinical rules + 65 red flags
  layers:       6-layer safety on every prescription
  principle:    AI recommends. Rules decide. Always.

infrastructure:
  deployment:  Docker Compose (self-hosted)
  proxy:       Caddy (automatic HTTPS + custom domains)
  cdn:         Cloudflare (WAF, DDoS, edge)
  secrets:     Doppler
  monitoring:  Grafana + Prometheus + Loki
  ci_cd:       GitHub Actions
  monorepo:    Turborepo + pnpm workspaces

scale:
  packages:   42+ shared @emr/* packages
  db_tables:  159
  pages:      275+ across 4 apps
  ts_errors:  0

// architecture principles

// safety-first

AI makes recommendations. Deterministic clinical rules make decisions. No LLM call ever overrides a safety check.

// no lock-in

Docker-first deployment. Self-hosted everything. FHIR export. Patients and operators can leave without data loss.

// PHI isolation

PHI is pseudonymized before reaching any external AI provider. DB-per-tenant for full patient data isolation in EMRGENIUS.

// zero vendor

No Vercel AI SDK. No Firebase. No managed auth. No proprietary queues. Every component is replaceable.

// build with us

Want this stack for your product?

We design and deliver production-grade clinical platforms. Architecture to launch.