إنتقل إلى المحتوى الرئيسي

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​

TermMeaning
AccountLogin identity; one or more roles
Patient / ClinicianProfiles hanging off Account
AppointmentShared booking between patient and clinician
EncounterClinical visit / note
DiagnosticOrderImaging or lab request (kind)
DiagnosticResultReport or file attached to an order

How it works​

  1. Client calls /api/v1/afia/....
  2. (Later) identity filter validates the session.
  3. Domain package handles the resource; it does not call another context’s controller.
  4. Patient reads of results are projections from diagnostics, not a second store of truth.

Where things live​

PathRole
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.txtStitch project URLs
AFIA-resources/arborescence.pdfCCF 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-web feature cards. It is still a mobile role shell. See ADR 0007.
  • Auth is not implemented yet (open question).
  • Actuator /actuator/health is not the mobile health contract.