Architecture
Afia is a health product (health.afia.app): patient access, clinician work, imaging and lab results, staff admin.
Overview
One Spring Boot JVM, one Flutter binary with five role shells, one static marketing site. Five Stitch modules map to four backend packages (patient, clinician, diagnostics, admin) plus identity. The CCF PDF lists ten later modules. Those rows are inventory. They do not add packages. See ADR 0002, ADR 0007, ADR 0010, and rationale.
Key concepts
| Term | Meaning |
|---|---|
| Account | Login identity; one or more roles |
| Patient / Clinician | Profiles hanging off Account |
| Appointment | Shared booking between patient and clinician |
| Encounter | Clinical visit / note |
| DiagnosticOrder | Imaging or lab request (kind) |
| DiagnosticResult | Report or file attached to an order |
How it works
- Client calls
/api/v1/afia/.... - (Later) identity filter validates the session.
- Domain package handles the resource; it does not call another context’s controller.
- Patient reads of results are projections from
diagnostics, not a second store of truth.
Where things live
| Path | Role |
|---|---|
afia-api/src/main/java/health/afia/app/ | API (today: health, version, common, config) |
afia-app/lib/{core,data,domain,presentation} | Flutter layers |
afia-web/ | Landing + legal |
ai-agent/adr/ | Decisions |
ai-agent/docs/ | Maps |
ai-agent/tasks/ | One brief per later agent |
ai-agent/manifest/ | TSV source checked by scripts/check-agent-pack.py |
AFIA-resources/design.txt | Stitch project URLs |
AFIA-resources/arborescence.pdf | CCF screen tree. Catalog only. See modules.md. |
Gotchas
- Record a screen only when a zip contains
screen.png. Do not invent names. See ADR 0010. - Admin is not on
afia-webfeature cards. It is still a mobile role shell. See ADR 0007. - Auth is not implemented yet (open question).
- Actuator
/actuator/healthis not the mobile health contract.