TorbatYar/docs/frontend/healthcare-design-system.md
Mortezakoohjani 5c6a2e78cf feat(platform): seed service registry, deploy all modules, and fix homepage catalog.
Register all active platform services and base features in core DB so admin can manage them, add delivery/hospitality/sports-center backend phases, update apps catalog and production deploy tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:39:51 +03:30

65 lines
2.2 KiB
Markdown

# Healthcare Design System
Extends the global DS ([design-system.md](design-system.md)) — **do not** create parallel tokens or components outside `@/components/ds` and `@/components/healthcare/ui`.
## Tokens (`styles/globals.css`)
| Token | Role |
| --- | --- |
| `--health-accent` | Primary healthcare brand (teal) |
| `--health-accent-soft` | Soft fills, icon backgrounds |
| `--health-calm` | Secondary calm accent |
| `--health-success` / `--warning` / `--danger` | Clinical status semantics |
Light and dark modes share the same token names.
## Healthcare UI (`frontend/components/healthcare/ui/`)
| Component | Purpose |
| --- | --- |
| `MedicalStatusChip` | Appointment / prescription / visit status |
| `ClinicCard`, `DoctorCard`, `PatientCard` | Entity cards |
| `AppointmentCard`, `PrescriptionCard` | Workflow cards |
| `StatWidget` | Dashboard KPI |
| `TimelineItem` | Patient journey / status timeline |
| `QueueRow` | Reception / doctor queue |
| `SearchResultRow` | Public find-doctor/clinic results |
Import: `@/components/healthcare/ui`.
## Layouts
| Layout | Path | Use |
| --- | --- | --- |
| `PublicHealthcareLayout` | `/healthcare/site/*` | Marketing + find + book |
| `HealthcarePortalShell` | Portal routes | Role-based sidebar + mobile drawer |
| Hub | `/healthcare/hub` | Portal selector |
Portal nav: `frontend/lib/healthcare-portals.ts`.
## Page modules
Shared logic in `frontend/components/healthcare/pages/`:
- `shared.tsx` — loaders, metrics, audit tables, integration providers
- `patient.tsx`, `doctor.tsx`, `reception.tsx`, `clinic.tsx`, `hospital.tsx`, `pharmacy.tsx`, `admin.tsx`, `public.tsx`, `hub.tsx`
Route files re-export these modules (thin `page.tsx`).
## API
`frontend/lib/healthcare-api.ts` — JWT + `X-Tenant-ID`; patient portal adds `X-Patient-ID`. BFF: `/api/healthcare/*`.
## Rules
1. No mock data — all lists/forms hit `healthcareApi`.
2. Reuse `@/components/ds` for forms, tables, dialogs.
3. RTL-first Persian copy.
4. Legacy paths (`/healthcare/clinics`, …) redirect to new portal routes.
## Entry points
- SuperApp catalog → `/healthcare/hub`
- Public site → `/healthcare/site`
- Mobile hub → `/healthcare/mobile/[portal]`