Developer Architecture¶
This page provides a developer-focused view of MedUX's internal architecture. For the high-level overview, see Architecture.
Project Layout¶
medux/
├── src/
│ ├── manage.py
│ └── medux/
│ ├── common/ # Tenant, User, Auth, Admin framework
│ │ ├── api/
│ │ │ └── interfaces.py
│ │ ├── models/
│ │ ├── views/
│ │ ├── templates/
│ │ ├── menus.py
│ │ ├── scoped_settings.py
│ │ └── urls/
│ ├── core/ # Patient, Encounter, Dashboard
│ │ ├── api/
│ │ │ └── interfaces.py
│ │ ├── models/
│ │ ├── views/
│ │ ├── templates/
│ │ └── middleware.py
│ ├── employees/ # Employee, WorkingContract
│ │ └── middleware.py
│ ├── notifications/ # Alerts, WebSocket
│ ├── plugins/
│ │ └── wiki/ # Built-in wiki plugin
│ └── tests/
│ └── settings.py # Test-specific Django settings
├── docs/
├── pyproject.toml
└── Makefile
App Responsibilities¶
medux.common¶
The foundation that every other app depends on:
Tenantmodel — the multi-tenancy anchorCommonUser— the custom user model (AUTH_USER_MODEL = "core.User")- Administration framework —
IAdministrationURL,IAdministrationSection, URL collection, sidebar rendering - Interfaces — all common extension points
- Menus — sidebar, administration rail, user menu entries
- Scoped settings registration — base settings definitions
medux.core¶
The medical domain layer:
Patient— patient demographicsEncounter— clinical encounters- Geo models — addresses, geographic data
Medication— medication recordsObservation— clinical observations (FHIR-inspired)- Dashboard —
IDashboardSectionfor plugin widgets DeviceMiddleware— tracks which device the user is onICommand— command palette registration
medux.employees¶
Employee— links to user modelWorkingContract— employment contractsEmployeeMiddleware— attaches employee torequest
medux.notifications¶
- Alerts — notification model and management
- WebSocket consumers — Django Channels consumers for push
Entry Points¶
Plugins register via Python entry points in pyproject.toml:
[project.entry-points."medux.plugins"]
core = "medux.core:apps.CoreConfig"
The plugin manager discovers these at startup and adds them to
INSTALLED_APPS. URL patterns are collected similarly via
PluginManager.urlpatterns().
Settings¶
- Django settings —
src/medux/settings.py(production) andsrc/medux/tests/settings.py(tests) - Environment —
.envinsrc/loaded viadjango-environ - Scoped settings — registered in
scoped_settings.pymodules, accessed viarequest.scoped_settings
Management Commands¶
| Command | Description |
|---|---|
initialize |
Set up basic data (admin user, defaults) |
syncplugins |
Sync plugin metadata to the database |
collectstatic |
Collect static files |
makemessages |
Generate translation files |