EHR desktop app — entry index
This file is a navigation index for the @ghasi/ehr-desktop package. Normative requirements, FR/NFR, and detailed design live under:
platform/desktop-electron/— specification, roadmap, technical requirements, UI parity, backend map. Program-level master:EHEALTH_DESKTOP_PLATFORM_REQUIREMENTS.md. Jira backlog + ADF:platform/desktop-electron/backlog/.
Stack (summary)
| Layer | Role |
|---|---|
Electron main (apps/ehr-desktop/electron/main/) | App lifecycle, secure IPC handlers, SQLite (better-sqlite3), outbound sync, optional auto-update when packaged. |
Preload (apps/ehr-desktop/electron/preload/) | contextBridge exposing the typed window.ehrDesktop API — no Node to renderer. |
Renderer (apps/ehr-desktop/renderer/) | Vite + React + MUI; feature UI, TanStack Query for server-shaped data, HTTP to platform via Kong (see renderer/src/api/). |
Platform integration
- HTTP(S) via Kong for REST/JSON and sync — same conceptual model as other clients.
- NATS / JetStream is not used in the desktop app; streaming is for backend NestJS services only. Do not add
natsor@ghasi/nats-clientto this package.
Build & tooling
- Electron Forge with
@electron-forge/plugin-vitedrives dev (electron-forge start) and packaging (electron-forge package/make). - Turborepo orchestrates
build/lint/testacross the monorepo. Turbopack (Next.js) is unrelated to this app; the desktop renderer is bundled with Vite.
Offline-first
SQLite + outbox + sync scheduler in main; renderer uses a thin sync engine façade over IPC. Details: platform/desktop-electron/SPEC.md and platform/offline-first/ platform docs.
AI
Assistive features must follow AI_PLATFORM.md: controlled paths (e.g. Kong → ai-orchestrator), no ad-hoc vendor keys in the renderer. IPC stubs in main allow policy and offline checks before HTTP is wired.