# mishkatit/patient-management architecture

> Architecture diagram of the GitHub repository mishkatit/patient-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mishkatit/patient-management
- Repository: https://github.com/mishkatit/patient-management

## Overview

Patient Management is a React interface backed by a Django REST API and PostgreSQL. Users search and page through patients, create or edit records, delete patients, and record visits; the interface calls patient API functions, which issue HTTP requests to Django endpoints. The API routes requests to views, which use serializers and patient/visit models. The README also documents authentication and PostgreSQL, though implementation details for database configuration and pagination are not shown in the excerpts. HTTP wiring to the backend is therefore marked unverified.

Main entry points: [`backend/patients/models.py`](https://github.com/mishkatit/patient-management/blob/main/backend/patients/models.py) (Patient and visits), [`frontend/src/App.jsx`](https://github.com/mishkatit/patient-management/blob/main/frontend/src/App.jsx) (Patient workspace), [`backend/patients/views.py`](https://github.com/mishkatit/patient-management/blob/main/backend/patients/views.py) (Patient endpoints), [`frontend/src/api/patients.js`](https://github.com/mishkatit/patient-management/blob/main/frontend/src/api/patients.js) (Patient API calls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Patient interface"]
  node_app["Patient workspace<br/>[App.jsx]"]
  node_visitmodal["Visit form"]
  node_patientapi["Patient API calls<br/>[patients.js]"]
  node_httpclient["HTTP client<br/>[client.js]"]
end

subgraph group_api["Django API"]
  node_routes["API routes<br/>[urls.py]"]
  node_patientviews["Patient endpoints<br/>[views.py]"]
  node_pagination["Pagination<br/>[pagination.py]"]
  node_auth["Authentication endpoints<br/>[urls.py]"]
end

subgraph group_domain["Patient domain"]
  node_patientserializer["Patient serializer<br/>[serializers.py]"]
  node_patientmodel["Patient and visits<br/>[models.py]"]
  node_patientmanager["Patient manager<br/>[managers.py]"]
end

subgraph group_platform["Persistence"]
  node_database[("PostgreSQL")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"requests"| node_patientapi
node_app -->|"renders"| node_visitmodal
node_patientapi -->|"calls"| node_httpclient
node_httpclient -.->|"sends HTTP"| node_routes
node_routes -->|"routes to"| node_patientviews
node_patientviews -->|"uses"| node_patientserializer
node_patientviews -->|"queries"| node_patientmodel
node_patientserializer -->|"serializes"| node_patientmodel
node_patientmodel -->|"configures"| node_patientmanager
node_patientmodel -.->|"persists"| node_database

click node_app "https://github.com/mishkatit/patient-management/blob/main/frontend/src/App.jsx"
click node_visitmodal "https://github.com/mishkatit/patient-management/blob/main/frontend/src/components/PatientVisitModal.jsx"
click node_patientapi "https://github.com/mishkatit/patient-management/blob/main/frontend/src/api/patients.js"
click node_httpclient "https://github.com/mishkatit/patient-management/blob/main/frontend/src/api/client.js"
click node_routes "https://github.com/mishkatit/patient-management/blob/main/backend/patients/urls.py"
click node_patientviews "https://github.com/mishkatit/patient-management/blob/main/backend/patients/views.py"
click node_pagination "https://github.com/mishkatit/patient-management/blob/main/backend/patients/pagination.py"
click node_auth "https://github.com/mishkatit/patient-management/blob/main/backend/patients/urls.py"
click node_patientserializer "https://github.com/mishkatit/patient-management/blob/main/backend/patients/serializers.py"
click node_patientmodel "https://github.com/mishkatit/patient-management/blob/main/backend/patients/models.py"
click node_patientmanager "https://github.com/mishkatit/patient-management/blob/main/backend/patients/managers.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_visitmodal,node_patientapi,node_httpclient,node_user toneBlue
class node_routes,node_patientviews,node_pagination,node_auth toneAmber
class node_patientserializer,node_patientmodel,node_patientmanager toneMint
class node_database toneRose
```

## Components

### Patient interface

- [Patient workspace](https://github.com/mishkatit/patient-management/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Visit form](https://github.com/mishkatit/patient-management/blob/main/frontend/src/components/PatientVisitModal.jsx): `frontend/src/components/PatientVisitModal.jsx`
- [Patient API calls](https://github.com/mishkatit/patient-management/blob/main/frontend/src/api/patients.js): `frontend/src/api/patients.js`
- [HTTP client](https://github.com/mishkatit/patient-management/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Django API

- [API routes](https://github.com/mishkatit/patient-management/blob/main/backend/patients/urls.py): `backend/patients/urls.py`
- [Patient endpoints](https://github.com/mishkatit/patient-management/blob/main/backend/patients/views.py): `backend/patients/views.py`
- [Pagination](https://github.com/mishkatit/patient-management/blob/main/backend/patients/pagination.py): `backend/patients/pagination.py`
- [Authentication endpoints](https://github.com/mishkatit/patient-management/blob/main/backend/patients/urls.py): `backend/patients/urls.py`

### Patient domain

- [Patient serializer](https://github.com/mishkatit/patient-management/blob/main/backend/patients/serializers.py): `backend/patients/serializers.py`
- [Patient and visits](https://github.com/mishkatit/patient-management/blob/main/backend/patients/models.py): `backend/patients/models.py`
- [Patient manager](https://github.com/mishkatit/patient-management/blob/main/backend/patients/managers.py): `backend/patients/managers.py`

### Persistence

- **PostgreSQL**

### Other components

- **User**

## Connections

- User → Patient workspace: uses (evidence: `frontend/src/App.jsx`)
- Patient workspace → Patient API calls: requests (evidence: `frontend/src/App.jsx`)
- Patient workspace → Visit form: renders (evidence: `frontend/src/App.jsx`)
- Patient API calls → HTTP client: calls (evidence: `frontend/src/api/patients.js`)
- HTTP client → API routes: sends HTTP
- API routes → Patient endpoints: routes to (evidence: `backend/patients/urls.py`)
- Patient endpoints → Patient serializer: uses (evidence: `backend/patients/views.py`)
- Patient endpoints → Patient and visits: queries (evidence: `backend/patients/views.py`)
- Patient serializer → Patient and visits: serializes (evidence: `backend/patients/serializers.py`)
- Patient and visits → Patient manager: configures (evidence: `backend/patients/models.py`)
- Patient and visits → PostgreSQL: persists
