Open-source humanitarian health platform designed for low-connectivity environments, with three applications:
- Patient mobile app — Triage, advice, referrals, case records
- Community health worker (CHW) mobile app — Protocols, referrals, case management
- NGO dashboard (web) — Configuration, analytics, protocol/knowledge updates
- Android-first mobile apps (Kotlin + Jetpack Compose)
- Offline-first architecture with SQLite and sync service
- Knowledge library and configurable clinical protocols stored locally
- Configurable language packs and localization with a personalization layer
- Agent runtime: Triage, Advice, Knowledge, Integration, Safety Guard agents
- Referral management, patient case records, protocol rule engine
- Update bundles for knowledge and protocol updates
- FHIR-compatible health data
- IntelliGraph FAQs (NGO dashboard) — semantic FAQ knowledge graph for NGO coordinators and healthcare workers only: TF–IDF-weighted hashed embeddings, similarity graph, semantic search, and optional constrained Qwen/Ollama summarization over curated evidence (
POST /knowledge/intelligraph/summarizewith staff JWT)
apps/ — patient-mobile, chw-mobile, ngo-dashboard, api
packages/ — core, sync, agents, protocols, knowledge, fhir, i18n, updates
tooling/ — shared ESLint, TypeScript configs
docs/ — ARCHITECTURE.md and design docs
See docs/ARCHITECTURE.md for the full architecture.
- Search: type any place — geocoding uses OpenStreetMap Nominatim via
GET /geocode/searchon the API (Vite proxies/geocodein dev; run the API so search works). - Scrape: builds a demo facility + vulnerability layer for the chosen anchor; MHU recommendation = weighted geometric median of vulnerability hotspots, with mean distance to static facilities as a care-gap signal.
- Animation: optional stepped UI —
VITE_SCRAPE_ANIMATION=falseorVITE_SCRAPE_MS_PER_STEP=0for instant. - Production data:
VITE_ZONES_API_URLPOST{ anchor, scrapeSeed }→{ facilities, hotspots }.
| Tool | Version | Notes |
|---|---|---|
| Node.js | 18+ (20 LTS recommended) | Same on both OSes — use nodejs.org or a version manager. |
| pnpm | 9.x | Use Corepack (below) so everyone uses the same version. |
| Git | recent | Windows: avoid paths > 260 chars if you hit odd errors — clone to a short path like C:\dev\PocketSage. |
Works on macOS and Windows (Node 16.13+):
corepack enable
corepack prepare pnpm@9.0.0 --activateThen pnpm -v should report 9.x.
- Use PowerShell or Windows Terminal for the commands below (not legacy
cmdunless you know the differences). **sqlite3** (used by the API) builds native addons. Ifpnpm installfails onsqlite3, install Visual Studio Build Tools (“Desktop development with C++”) or use Windows 11 + current Node and retry.- OneDrive / cloud-synced folders can lock files and break
node_modulesor SQLite. Prefer a local folder (e.g.C:\dev\...or~/Projects/...).
- Xcode Command Line Tools help if any native module fails:
xcode-select --install. - Apple Silicon (M1/M2/M3): use the arm64 Node installer; pnpm installs are the same as on Intel.
The dashboard (Vite, port 3000) proxies API routes to the backend (Express, default 4000). For full features (auth, geocode, cases), run both.
pnpm installCopy examples and adjust if needed:
# macOS / Linux / Git Bash on Windows
cp apps/api/.env.example apps/api/.env
cp apps/ngo-dashboard/.env.example apps/ngo-dashboard/.envWindows (PowerShell) — same idea:
Copy-Item apps\api\.env.example apps\api\.env
Copy-Item apps\ngo-dashboard\.env.example apps\ngo-dashboard\.env**apps/api/.env**— at minimumPORT=4000(default). Seeapps/api/.env.examplefor CORS and proxy notes.**apps/ngo-dashboard/.env**— usually empty for local dev; the Vite dev server proxies tohttp://127.0.0.1:4000. If your API uses another port, setVITE_API_PROXY_TARGETthere.
Terminal A — API
pnpm api:devTerminal B — NGO dashboard
pnpm dashboard:devThen open http://localhost:3000 in your browser.
| Service | URL | Script |
|---|---|---|
| Dashboard | http://localhost:3000 | pnpm dashboard:dev |
| API | http://127.0.0.1:4000 (proxied from dashboard) | pnpm api:dev |
pnpm dev # alias → dashboard:dev (UI only)
pnpm dashboard:dev # NGO dashboard (Vite)
pnpm dashboard:build # production build of dashboard
pnpm api:dev # API with hot reload
pnpm build # build all workspaces that define `build`
pnpm lint # lint all packages
pnpm test # test all packages
pnpm test:dashboard # dashboard tests onlypnpm dashboard:build
pnpm --filter ngo-dashboard preview # serves dist/ locallyPoint VITE_API_URL at your deployed API when not using the dev proxy (see apps/ngo-dashboard/.env.example).
Open apps/patient-mobile or apps/chw-mobile in Android Studio and run on a device or emulator.
- JDK 17+ and Android Studio are required (same on Mac and Windows).
| Issue | What to try |
|---|---|
| Geocode / search fails in Zones | Ensure API is running (pnpm api:dev) and PORT matches VITE_API_PROXY_TARGET (default 4000). |
**EADDRINUSE on 4000** |
Another app uses the port — change PORT in apps/api/.env and set VITE_API_PROXY_TARGET in the dashboard .env. |
**pnpm not found** |
Run corepack enable then corepack prepare pnpm@9.0.0 --activate. |
| SQLite / native module errors on install | Windows: install VS Build Tools (C++). macOS: xcode-select --install. |
| CORS or “Failed to fetch” | Use the Vite dev server (pnpm dashboard:dev) so /auth, /geocode, etc. are proxied; avoid opening only file:// or a static server without proxy unless VITE_API_URL is set. |
| Strange file locks / install errors | Move the repo out of OneDrive/iCloud/Dropbox-synced folders. |
TBD (intended open-source)
