The Smart Hospital OS for Africa" · by Skyhouse Technologies.
# SkyCare — The Smart Hospital OS for Africa
Multi-tenant hospital management SaaS by **Skyhouse Technologies**. Every hospital
gets the full HMS platform, a public hospital website, and a white-labelled patient
PWA — from a single Supabase-backed codebase.
## Repo layout
```
skycare-saas/
├── backend/ # Supabase: SQL migrations, RLS, edge functions
│ └── supabase/
│ ├── migrations/ # versioned SQL (tenant schema → RLS → analytics → seed)
│ └── functions/ # Supabase Edge Functions (Deno)
├── frontend/ # Next.js App Router + Tailwind + PWA
│ ├── src/
│ │ ├── app/ # pages + API routes (/app/* staff, /patient portal, /[slug] sites)
│ │ ├── components/ # shared + dashboard + patient + tenant UI
│ │ └── lib/ # auth, tenancy, calculators, exports, API utils
│ └── vitest.config.ts # unit/component test runner (+ coverage gate)
├── .github/workflows/ # CI (lint, typecheck, test, build)
└── docs/ # architecture, ADRs, API map
```
## High-level architecture
```
Public hospital website ( .skycare.app) Patient PWA (/patient)
│ │
└──────────────┬───────────────────────────────┘
Next.js App Router (frontend/)
subdomain → tenant routing (proxy + host headers)
│
Supabase Auth (JWT claims: tenant_id, role, branch_id)
│
API layer — REST routes + PostgREST with RLS as the safety net
│
PostgreSQL multi-tenant (RLS + tenant_id scoping) + Storage (avatars)
```
- **Tenant isolation** at the DB level via RLS (`auth.jwt()`-derived `tenant_id`);
the API layer (`withAuth`/`withStaff` + service client) is the authoritative guard.
- **Roles**: `super_admin`, `hospital_admin`, `doctor`, `nurse`, `pharmacist`,
`lab_tech`, `cashier`, `receptionist`, `patient_api` — with per-user module
grants (`users.module_access`).
## Modules
Patients/EHR · Appointments · Billing & Payments · Pharmacy & Inventory (+ sup …