technical

Architecture

How the console, parser, writeback engine, drivers, and AI copilot fit together.

Kairos EDI is a TanStack Start app. The parser, mapping engine, writeback, drivers, and vendor overlays all run in TypeScript with no heavyweight runtime dependency.

Runtime layout

  • Client: React 19 + TanStack Router with routes under src/routes
  • Server: createServerFn endpoints for AI copilot + NPPES lookups
  • Persistence: localStorage-backed stores for mappings, connections, runs, NPPES jobs
  • AI Gateway: powers the mapping copilot via the shared LOVABLE_API_KEY

Module map

src/lib/edi/
  parser.ts        — X12 parser + validator
  writeback.ts     — envelope + segment serializer, 997/999
  x12Templates.ts  — seed catalog of transactions
  drivers.ts       — live-driver polling
  runsStore.ts     — transaction history + outbox
src/lib/vendors/   — vendor catalog + overlays
src/lib/nppes/     — NPI Registry client + batch store
src/lib/fhir/      — Practitioner bundle builder