Skip to main content

Technology Stack

LayerTechWhy
APINestJS 10 · TypeScript 5 strict · Node 20First-class DI; decorator-driven auth/consent; TS strict catches shape drift at compile time
FrontendNext.js 15 · React 19 · Tailwind CSS v4 · Zustand · TanStack Query 5 · Socket.IO clientApp Router for CSP nonce delivery; Zustand for stable selectors (no re-render storms); TanStack for cache freshness
MLFastAPI · Python 3.12 · Pydantic v2Pydantic for LLM prompt-response schema validation; slowapi rate limiting
Research servicesFastAPI · motor (async MongoDB) · patientrx-contracts (Pydantic shared schemas)Shared contracts = shared shapes across 4 services; motor = non-blocking I/O
DBMongoDB Atlas (prod) · MongoDB 7 Docker (local, :6205, replica set)Native driver; $graphLookup for entity walks; Atlas Search for BM25; change-streams for event-driven pipelines
Encryptioncrypto.createCipheriv AES-256-GCM · Azure Key Vault KEKFIPS-compliant; envelope per-record DEK; Managed Identity auth in prod
AuthMSAL (Microsoft Entra ID) + GIS (Google Workspace) + JWKS verify per issDual IdP; (idpProvider, idpSubject) natural key; per-tenant rate limit + allowlist
MFA@simplewebauthn/* passkey + otpauth TOTP + bcryptjs ≥ 12 recovery codesPasskey-first per OMB M-22-09; TOTP fallback
LLMOpenAI GPT-4o + Gemini 2.0 Flash via google-genai SDKDual-provider with audited fallback (FR-021a)
TestingVitest (unit) · Playwright (E2E + CSP regression) · pytest (ML + research)Vitest speed; Playwright real-browser CSP; pytest for Python services
CIGitHub Actions (self-hosted Mac mini + ubuntu-latest)Self-hosted avoids billing cap; ubuntu-latest for x86_64 deploys
DashboardsAzure Monitor + KQL + WorkbooksLog-query expressive, workbook dashboards per team
Static hostingAzure Static Web Apps Free SKUFree; global CDN; auto SSL via Let's Encrypt; zero PHI

Python deps (per service)

Canonical locations:

  • packages/patientrx-contracts/pyproject.toml (monorepo root package)
  • apps/research/*/requirements.txt (service-local — install with -e ../../../packages/patientrx-contracts)
  • research-engine/packages/patientrx-guardrails/pyproject.toml (consent + audit client)
  • research-engine/packages/patientrx-memory-sdk/pyproject.toml (memory-store SDK)

JS/TS deps

  • Root package.json (monorepo tooling)
  • apps/api/package.json, apps/web/package.json (per-app)
  • Turbo + workspace protocol for mono-install

Container images

  • Dev: docker compose with profiles (mongo, group3, dev-console)
  • Prod (planned): Azure Container Apps (staging), Azure App Service + AKS (prod) — deferred to production-launch milestone

Dev toolchain

  • asdf (.tool-versions) pins Node 20 + Python 3.12.10
  • Turbo for parallel task execution
  • Vitest, Playwright, pytest as the test runners
  • Claude Code harness for skills + hooks

Supply-chain posture

  • Every new dep goes through /package-security-scan skill → decision record in docs/compliance/package-security-scans/
  • Existing-dep bumps go through /dependency-upgrade skill → changelog diff + transitive-dep audit
  • CI gates: pip-audit, npm audit --production, Trivy, Semgrep, gitleaks (PR-changeset + scheduled full-history)
  • BAA registry (apps/api/src/config/baa-registry.yml) — every PHI-capable vendor registered + fail-closed on unsigned in prod