# elsesystems/sisp architecture

> Architecture diagram of the GitHub repository elsesystems/sisp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/elsesystems/sisp
- Repository: https://github.com/elsesystems/sisp

## Overview

SISP is an offline-first space-mission health and prevention app. Crew enter check-ins and use self-tests; the app assesses readings, presents status and next steps, and supports delay-aware escalation, reporting, and mission routines. A portable C core is exposed through WebAssembly with a TypeScript fallback, while history persists locally in SQLite/OPFS or localStorage. The graph preserves documented feature branches; several component-to-component links are based on the README or SOURCE INDEX rather than inspected component bodies.

Main entry points: [`src/App.tsx`](https://github.com/elsesystems/sisp/blob/main/src/App.tsx) (App shell), [`src/components/Dashboard.tsx`](https://github.com/elsesystems/sisp/blob/main/src/components/Dashboard.tsx) (Health dashboard), [`src/lib/assessment.ts`](https://github.com/elsesystems/sisp/blob/main/src/lib/assessment.ts) (Health assessment), [`src/core/index.ts`](https://github.com/elsesystems/sisp/blob/main/src/core/index.ts) (Core selector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Crew health app"]
  node_app["App shell<br/>[App.tsx]"]
  node_checkin["Daily check-in<br/>[Checkin.tsx]"]
  node_dashboard["Health dashboard<br/>[Dashboard.tsx]"]
  node_body["3D body view<br/>[Body3D.tsx]"]
  node_trends["Health trends<br/>[Trends.tsx]"]
  node_ground["Ground escalation<br/>[Ground.tsx]"]
  node_report["Surgeon report"]
  node_emergency["Emergency guides<br/>[Emergency.tsx]"]
  node_timeline["Mission timeline"]
  node_pvt["PVT test<br/>[Pvt.tsx]"]
  node_pulse["Camera pulse<br/>[PulseCam.tsx]"]
  node_nasa["NASA data view<br/>[NasaData.tsx]"]
end

subgraph group_domain["Health and mission domain"]
  node_assessment["Health assessment<br/>[assessment.ts]"]
  node_knowledge["Clinical knowledge<br/>[knowledge.ts]"]
  node_weather["Space weather<br/>[spaceWeather.ts]"]
  node_schedule["Mission schedule<br/>[schedule.ts]"]
  node_emergencydata["Emergency procedures<br/>[emergency.ts]"]
end

subgraph group_core["Assessment core"]
  node_c_core["Portable C core<br/>[sisp.c]"]
  node_flat["Flat C ABI<br/>[sisp_flat.c]"]
  node_wasm["WASM bridge<br/>[sisp_wasm.c]"]
  node_tscore["TypeScript fallback<br/>[flat.ts]"]
  node_corefacade["Core selector<br/>[index.ts]"]
end

subgraph group_persistence["Local persistence"]
  node_store["Application state<br/>[store.ts]"]
  node_storage["Storage facade<br/>[index.ts]"]
  node_worker["SQLite worker<br/>[db.worker.ts]"]
  node_ops[("SQLite operations<br/>[ops.ts]")]
end

node_crew(("Crew member"))

node_crew -->|"enters readings"| node_checkin
node_app -->|"routes to"| node_checkin
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_ground
node_app -->|"routes to"| node_emergency
node_app -->|"renders"| node_timeline
node_checkin -.->|"assesses readings"| node_assessment
node_dashboard -->|"shows status"| node_assessment
node_dashboard -->|"renders"| node_body
node_dashboard -.->|"links trends"| node_trends
node_assessment -->|"uses guidance"| node_knowledge
node_assessment -->|"calls core"| node_corefacade
node_corefacade -->|"starts fallback"| node_tscore
node_corefacade -->|"loads WASM"| node_wasm
node_wasm -->|"calls ABI"| node_flat
node_flat -->|"calls core"| node_c_core
node_timeline -->|"uses schedule"| node_schedule
node_timeline -->|"loads events"| node_weather
node_nasa -->|"loads events"| node_weather
node_weather -->|"calculates dose"| node_corefacade
node_emergency -->|"shows procedures"| node_emergencydata
node_app -.->|"offers report"| node_report
node_app -.->|"offers test"| node_pvt
node_app -.->|"offers pulse"| node_pulse
node_store -->|"persists history"| node_storage
node_storage -->|"sends RPC"| node_worker
node_worker -->|"runs operations"| node_ops

click node_app "https://github.com/elsesystems/sisp/blob/main/src/App.tsx"
click node_checkin "https://github.com/elsesystems/sisp/blob/main/src/components/Checkin.tsx"
click node_dashboard "https://github.com/elsesystems/sisp/blob/main/src/components/Dashboard.tsx"
click node_body "https://github.com/elsesystems/sisp/blob/main/src/components/Body3D.tsx"
click node_trends "https://github.com/elsesystems/sisp/blob/main/src/components/Trends.tsx"
click node_ground "https://github.com/elsesystems/sisp/blob/main/src/components/Ground.tsx"
click node_report "https://github.com/elsesystems/sisp/blob/main/src/components/FlightSurgeonReport.tsx"
click node_emergency "https://github.com/elsesystems/sisp/blob/main/src/components/Emergency.tsx"
click node_timeline "https://github.com/elsesystems/sisp/blob/main/src/components/MissionTimeline.tsx"
click node_pvt "https://github.com/elsesystems/sisp/blob/main/src/components/Pvt.tsx"
click node_pulse "https://github.com/elsesystems/sisp/blob/main/src/components/PulseCam.tsx"
click node_nasa "https://github.com/elsesystems/sisp/blob/main/src/components/NasaData.tsx"
click node_assessment "https://github.com/elsesystems/sisp/blob/main/src/lib/assessment.ts"
click node_knowledge "https://github.com/elsesystems/sisp/blob/main/src/lib/knowledge.ts"
click node_weather "https://github.com/elsesystems/sisp/blob/main/src/lib/spaceWeather.ts"
click node_schedule "https://github.com/elsesystems/sisp/blob/main/src/lib/schedule.ts"
click node_emergencydata "https://github.com/elsesystems/sisp/blob/main/src/lib/emergency.ts"
click node_store "https://github.com/elsesystems/sisp/blob/main/src/lib/store.ts"
click node_storage "https://github.com/elsesystems/sisp/blob/main/src/storage/index.ts"
click node_worker "https://github.com/elsesystems/sisp/blob/main/src/storage/db.worker.ts"
click node_ops "https://github.com/elsesystems/sisp/blob/main/src/storage/ops.ts"
click node_c_core "https://github.com/elsesystems/sisp/blob/main/core/src/sisp.c"
click node_flat "https://github.com/elsesystems/sisp/blob/main/core/src/sisp_flat.c"
click node_wasm "https://github.com/elsesystems/sisp/blob/main/core/wasm/sisp_wasm.c"
click node_tscore "https://github.com/elsesystems/sisp/blob/main/src/core/flat.ts"
click node_corefacade "https://github.com/elsesystems/sisp/blob/main/src/core/index.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_checkin,node_dashboard,node_body,node_trends,node_ground,node_report,node_emergency,node_timeline,node_pvt,node_pulse,node_nasa toneBlue
class node_assessment,node_knowledge,node_weather,node_schedule,node_emergencydata toneAmber
class node_c_core,node_flat,node_wasm,node_tscore,node_corefacade toneMint
class node_store,node_storage,node_worker,node_ops toneRose
class node_crew toneIndigo
```

## Components

### Crew health app

- [App shell](https://github.com/elsesystems/sisp/blob/main/src/App.tsx): `src/App.tsx`
- [Daily check-in](https://github.com/elsesystems/sisp/blob/main/src/components/Checkin.tsx): `src/components/Checkin.tsx`
- [Health dashboard](https://github.com/elsesystems/sisp/blob/main/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`
- [3D body view](https://github.com/elsesystems/sisp/blob/main/src/components/Body3D.tsx): `src/components/Body3D.tsx`
- [Health trends](https://github.com/elsesystems/sisp/blob/main/src/components/Trends.tsx): `src/components/Trends.tsx`
- [Ground escalation](https://github.com/elsesystems/sisp/blob/main/src/components/Ground.tsx): `src/components/Ground.tsx`
- [Surgeon report](https://github.com/elsesystems/sisp/blob/main/src/components/FlightSurgeonReport.tsx): `src/components/FlightSurgeonReport.tsx`
- [Emergency guides](https://github.com/elsesystems/sisp/blob/main/src/components/Emergency.tsx): `src/components/Emergency.tsx`
- [Mission timeline](https://github.com/elsesystems/sisp/blob/main/src/components/MissionTimeline.tsx): `src/components/MissionTimeline.tsx`
- [PVT test](https://github.com/elsesystems/sisp/blob/main/src/components/Pvt.tsx): `src/components/Pvt.tsx`
- [Camera pulse](https://github.com/elsesystems/sisp/blob/main/src/components/PulseCam.tsx): `src/components/PulseCam.tsx`
- [NASA data view](https://github.com/elsesystems/sisp/blob/main/src/components/NasaData.tsx): `src/components/NasaData.tsx`

### Health and mission domain

- [Health assessment](https://github.com/elsesystems/sisp/blob/main/src/lib/assessment.ts): `src/lib/assessment.ts`
- [Clinical knowledge](https://github.com/elsesystems/sisp/blob/main/src/lib/knowledge.ts): `src/lib/knowledge.ts`
- [Space weather](https://github.com/elsesystems/sisp/blob/main/src/lib/spaceWeather.ts): `src/lib/spaceWeather.ts`
- [Mission schedule](https://github.com/elsesystems/sisp/blob/main/src/lib/schedule.ts): `src/lib/schedule.ts`
- [Emergency procedures](https://github.com/elsesystems/sisp/blob/main/src/lib/emergency.ts): `src/lib/emergency.ts`

### Assessment core

- [Portable C core](https://github.com/elsesystems/sisp/blob/main/core/src/sisp.c): `core/src/sisp.c`
- [Flat C ABI](https://github.com/elsesystems/sisp/blob/main/core/src/sisp_flat.c): `core/src/sisp_flat.c`
- [WASM bridge](https://github.com/elsesystems/sisp/blob/main/core/wasm/sisp_wasm.c): `core/wasm/sisp_wasm.c`
- [TypeScript fallback](https://github.com/elsesystems/sisp/blob/main/src/core/flat.ts): `src/core/flat.ts`
- [Core selector](https://github.com/elsesystems/sisp/blob/main/src/core/index.ts): `src/core/index.ts`

### Local persistence

- [Application state](https://github.com/elsesystems/sisp/blob/main/src/lib/store.ts): `src/lib/store.ts`
- [Storage facade](https://github.com/elsesystems/sisp/blob/main/src/storage/index.ts): `src/storage/index.ts`
- [SQLite worker](https://github.com/elsesystems/sisp/blob/main/src/storage/db.worker.ts): `src/storage/db.worker.ts`
- [SQLite operations](https://github.com/elsesystems/sisp/blob/main/src/storage/ops.ts): `src/storage/ops.ts`

### Other components

- **Crew member**

## Connections

- Crew member → Daily check-in: enters readings (evidence: `README.md`)
- App shell → Daily check-in: routes to (evidence: `src/App.tsx`)
- App shell → Health dashboard: routes to (evidence: `src/App.tsx`)
- App shell → Ground escalation: routes to (evidence: `src/App.tsx`)
- App shell → Emergency guides: routes to (evidence: `src/App.tsx`)
- App shell → Mission timeline: renders (evidence: `src/App.tsx`)
- Daily check-in → Health assessment: assesses readings
- Health dashboard → Health assessment: shows status (evidence: `src/components/Dashboard.tsx`)
- Health dashboard → 3D body view: renders (evidence: `src/components/Dashboard.tsx`)
- Health dashboard → Health trends: links trends
- Health assessment → Clinical knowledge: uses guidance (evidence: `src/lib/assessment.ts`)
- Health assessment → Core selector: calls core (evidence: `src/lib/assessment.ts`)
- Core selector → TypeScript fallback: starts fallback (evidence: `src/core/index.ts`)
- Core selector → WASM bridge: loads WASM (evidence: `src/core/index.ts`)
- WASM bridge → Flat C ABI: calls ABI (evidence: `core/wasm/sisp_wasm.c`)
- Flat C ABI → Portable C core: calls core (evidence: `core/src/sisp_flat.c`)
- Mission timeline → Mission schedule: uses schedule (evidence: `src/components/MissionTimeline.tsx`)
- Mission timeline → Space weather: loads events (evidence: `src/components/MissionTimeline.tsx`)
- NASA data view → Space weather: loads events (evidence: `src/components/NasaData.tsx`)
- Space weather → Core selector: calculates dose (evidence: `src/lib/spaceWeather.ts`)
- Emergency guides → Emergency procedures: shows procedures (evidence: `src/components/Emergency.tsx`)
- App shell → Surgeon report: offers report
- App shell → PVT test: offers test
- App shell → Camera pulse: offers pulse
- Application state → Storage facade: persists history (evidence: `src/lib/store.ts`)
- Storage facade → SQLite worker: sends RPC (evidence: `src/storage/index.ts`)
- SQLite worker → SQLite operations: runs operations (evidence: `src/storage/db.worker.ts`)
