Turborepo-powered monorepo for the SIH Salus Hospital Information System — an offline-first, FHIR-compliant, HIPAA-compliant frontend serving ~30,000 inhabitants across 112 native Amazonian communities along 500+ km of the Napo River (Peru).
Built on OpenMRS 3.x with the single-spa microfrontend architecture.
- Node.js >= 20
- Yarn 4.13.0 (via Corepack:
corepack enable && corepack prepare yarn@4.13.0 --activate) - Docker (for containerized deployment)
# Clone
git clone https://github.com/sihsalus/frontend-web.git
cd frontend-web
# Install dependencies
yarn install
# Build all packages
yarn build
# Start dev server (requires OpenMRS backend at localhost:8080)
yarn start
# or with explicit backend URL:
yarn openmrs develop --backend http://localhost:8080/openmrs --port 9090packages/
tooling/
openmrs/ # CLI (openmrs develop, build, assemble)
webpack-config/ # Shared webpack configuration
rspack-config/ # Rspack configuration (experimental)
apps/ # 41 frontend modules (esm-*-app)
libs/
rbac/ # @sihsalus/rbac — HIPAA role-based access control
fhir-client/ # @sihsalus/fhir-client — Typed FHIR R4 client
audit-logger/ # @sihsalus/audit-logger — Client-side audit logging
keycloak-auth/ # @sihsalus/keycloak-auth — Keycloak OIDC adapter
constants/ # @sihsalus/constants — Centralized UUIDs and constants
esm-patient-common-lib/ # @openmrs/esm-patient-common-lib — Shared patient utilities
tools/ # Test utilities (setup-tests, test-utils)
scripts/
assemble-importmap.js # Import map assembly for SPA build
fix-workspace-deps.js # Workspace dependency fixer
e2e/ # Playwright E2E tests
docs/ # Architecture docs and ADRs
Note: The OpenMRS framework (
@openmrs/esm-framework) and app shell (@openmrs/esm-app-shell) are consumed as npm dependencies, not vendored in this repo.
yarn setup # Install + build all
yarn start # Dev server (openmrs develop)
yarn openmrs develop --sources <path> # Dev server with specific module(s)yarn build # Build all packages
yarn build:apps # Build only app packages
yarn assemble # Assemble import map
yarn turbo run build --filter=<package> # Build single packageyarn test # Run all unit tests
yarn turbo run test --filter='@sihsalus/*' # Test SIH Salus packages only
yarn test:e2e # Run Playwright E2E testsyarn lint # ESLint all packages
yarn typecheck # TypeScript check all packages
yarn verify # lint + typecheck + testThis monorepo has 50+ packages. Avoid high concurrency on resource-constrained machines:
yarn turbo run build --concurrency=4
yarn turbo run test --filter=@openmrs/esm-login-app # Single packagedocker build -t sihsalus/frontend-web .Nginx / reverse proxy configuration is managed in the infra repo (sihsalus-distro-referenceapplication).
- Turborepo orchestrates builds across ~50 packages with caching
- Yarn 4 (Berry) manages dependencies with
node-moduleslinker - single-spa orchestrates microfrontend modules at runtime via import maps
- Webpack Module Federation enables shared dependencies across modules
- Carbon Design System (v11) is the primary UI framework
- FHIR R4 preferred for data access (
/ws/fhir2/R4/) - Service worker enables offline-first operation
SIH Salus Module (@sihsalus/*) |
Replaces Upstream (@openmrs/*) |
|---|---|
esm-patient-registration-app |
@openmrs/esm-patient-registration-app |
esm-patient-search-app |
@openmrs/esm-patient-search-app |
esm-billing-app |
@openmrs/esm-billing-app |
esm-vacunacion-app |
@openmrs/esm-patient-immunizations-app |
Custom modules with no upstream equivalent: esm-coststructure-app, esm-dyaku-app, esm-fua-app, esm-indicadores-app, esm-maternal-and-child-health, esm-consulta-externa-app.
| Variable | Default | Description |
|---|---|---|
SPA_PATH |
/openmrs/spa |
Base path for SPA assets |
API_URL |
/openmrs |
OpenMRS backend API base |
BACKEND_URL |
http://backend:8080 |
Backend URL for Nginx proxy |
SPA_DEFAULT_LOCALE |
es |
Default locale |
SIHSALUS_AUTH_MODE |
openmrs |
Auth mode: openmrs or keycloak |
- RBAC (
@sihsalus/rbac): Role-based access control at component and route level - Audit logging (
@sihsalus/audit-logger): PHI access event logging with offline fallback - Session timeout: 15-minute idle timeout with warning
- Break the glass: Emergency access with mandatory clinical justification
- TLS 1.2+: Enforced at the infrastructure layer
Supported locales: en, es, plus Amazonian languages (Kichwa, Secoya). Each module keeps translations in src/translations/{locale}.json.