Appearance
Example Features
The examples/ directory contains canonical feature implementations that serve as executable reference and test fixtures.
Feature matrix
| Feature | Path prefix | Auth required | Server functions |
|---|---|---|---|
feature-account | /account | Yes | getUserProfile, updatePreferences, getNotificationSettings |
feature-dashboard | /dashboard | No | getOverviewStats, listReports, getReport, addReportNote |
feature-lab-results | /labs | No | listLabPanels, getLabPanelResults |
feature-medications | /medications | No | listMedications, prescribeMedication, discontinueMedication |
feature-orders | /orders | No | listOrders, validateOrder, createOrder, approveOrder, cancelOrder |
feature-patient-list | /patients | No | searchPatients, getPatient, getPatientCensus |
feature-reference | /reference | Yes | getContextInfo, listPatients, saveNote, getProtectedData |
Cross-feature cohesion
Patient-dependent features (labs, medications, orders, account) consume patient context from:
- Host store key
selectedPatient patient:selectedandpatient:deselectedeventspatientIdquery parameter fallback (for direct deep-links)
The patient-list feature sets selectedPatient and publishes patient events. Global theme and locale are shared via the host store.
Recommended demo path:
- Open
/patients - Select a patient (writes
selectedPatientand emitspatient:selected) - Navigate to
/labs,/medications, or/orders - Confirm context continuity via feature headers and RPC responses
Reference feature
examples/feature-reference/ is a comprehensive example demonstrating:
- All host API surfaces (context, store, events, server functions, API proxy)
- Team-owned auth and business logic patterns
authRequired: trueconfiguration
See the Building Features guide for project structure and bootstrapping patterns.
Running examples
bash
# Build and publish all features locally
pnpm run build
pnpm run publish:local
# Start the host
pnpm run dev:host
# Visit any feature
# http://localhost:3000/dashboard
# http://localhost:3000/patients
# http://localhost:3000/labsTo develop a single feature with hot-reload:
bash
pnpm run dev:feature examples/feature-dashboard