# firta/nursepro-backend architecture

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

- Interactive diagram: https://gitdiagram.com/firta/nursepro-backend
- Repository: https://github.com/firta/nursepro-backend

## Overview

NursePro-BackEnd is a Django/REST Framework backend for nurse and management workflows. A client request enters the app’s URL routes, reaches API views, and is handled using serializers and domain models for accounts, nurse levels, counseling, and related records. The sampled code also shows automated nurse-level upgrades dispatched as a Celery task. The README provides no further capability detail, and several modules are only indexed or unsampled, so the graph omits uncertain integrations and links.

Main entry points: [`core/views.py`](https://github.com/firta/nursepro-backend/blob/master/core/views.py) (API views), [`core/models.py`](https://github.com/firta/nursepro-backend/blob/master/core/models.py) (Accounts and roles), [`core/serializers.py`](https://github.com/firta/nursepro-backend/blob/master/core/serializers.py) (Request serializers), [`core/signals.py`](https://github.com/firta/nursepro-backend/blob/master/core/signals.py) (Model signals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API layer"]
  node_routes["API routes<br/>[urls.py]"]
  node_views["API views<br/>[views.py]"]
  node_serializers["Request serializers<br/>[serializers.py]"]
  node_mixins["View mixins<br/>[mixins.py]"]
end

subgraph group_domain["Nurse domain"]
  node_accounts["Accounts and roles<br/>[models.py]"]
  node_nurses["Nurse levels<br/>[models.py]"]
  node_counseling["Counseling records<br/>[models.py]"]
  node_audit["Audit records<br/>[models.py]"]
  node_signals["Model signals<br/>[signals.py]"]
end

subgraph group_background["Background work"]
  node_seed["Database seeding<br/>[seed_database.py]"]
  node_upgradecommand["Upgrade command"]
  node_tasks["Level upgrade task<br/>[tasks.py]"]
  node_celery["Celery configuration<br/>[celery.py]"]
end

subgraph group_platform["Backend platform"]
  node_database[("Application database")]
  node_retry["Database retries<br/>[db_retries.py]"]
  node_appconfig["Core app setup<br/>[apps.py]"]
end

node_client(("API client"))

node_client -.->|"sends request"| node_routes
node_routes -->|"routes to"| node_views
node_views -->|"uses"| node_serializers
node_views -->|"queries"| node_accounts
node_views -->|"queries"| node_nurses
node_views -->|"queries"| node_counseling
node_views -->|"uses"| node_mixins
node_serializers -->|"serializes"| node_accounts
node_serializers -->|"creates"| node_nurses
node_accounts -.->|"persists"| node_database
node_nurses -.->|"persists"| node_database
node_counseling -.->|"persists"| node_database
node_audit -.->|"persists"| node_database
node_appconfig -->|"imports"| node_signals
node_signals -->|"references"| node_accounts
node_signals -->|"references"| node_nurses
node_seed -->|"creates records"| node_accounts
node_seed -->|"creates records"| node_counseling
node_upgradecommand -->|"invokes"| node_tasks
node_tasks -->|"checks upgrades"| node_nurses
node_tasks -.->|"registers task"| node_celery
node_mixins -->|"uses decorator"| node_retry

click node_routes "https://github.com/firta/nursepro-backend/blob/master/core/urls.py"
click node_views "https://github.com/firta/nursepro-backend/blob/master/core/views.py"
click node_serializers "https://github.com/firta/nursepro-backend/blob/master/core/serializers.py"
click node_accounts "https://github.com/firta/nursepro-backend/blob/master/core/models.py"
click node_nurses "https://github.com/firta/nursepro-backend/blob/master/core/models.py"
click node_counseling "https://github.com/firta/nursepro-backend/blob/master/core/models.py"
click node_audit "https://github.com/firta/nursepro-backend/blob/master/core/models.py"
click node_retry "https://github.com/firta/nursepro-backend/blob/master/BackEnd/db_retries.py"
click node_mixins "https://github.com/firta/nursepro-backend/blob/master/core/mixins.py"
click node_signals "https://github.com/firta/nursepro-backend/blob/master/core/signals.py"
click node_appconfig "https://github.com/firta/nursepro-backend/blob/master/core/apps.py"
click node_seed "https://github.com/firta/nursepro-backend/blob/master/core/management/commands/seed_database.py"
click node_upgradecommand "https://github.com/firta/nursepro-backend/blob/master/core/management/commands/run_nurse_upgrade.py"
click node_tasks "https://github.com/firta/nursepro-backend/blob/master/core/tasks.py"
click node_celery "https://github.com/firta/nursepro-backend/blob/master/BackEnd/celery.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_routes,node_views,node_serializers,node_mixins,node_client toneBlue
class node_accounts,node_nurses,node_counseling,node_audit,node_signals toneAmber
class node_seed,node_upgradecommand,node_tasks,node_celery toneMint
class node_database,node_retry,node_appconfig toneRose
```

## Components

### API layer

- [API routes](https://github.com/firta/nursepro-backend/blob/master/core/urls.py): `core/urls.py`
- [API views](https://github.com/firta/nursepro-backend/blob/master/core/views.py): `core/views.py`
- [Request serializers](https://github.com/firta/nursepro-backend/blob/master/core/serializers.py): `core/serializers.py`
- [View mixins](https://github.com/firta/nursepro-backend/blob/master/core/mixins.py): `core/mixins.py`

### Nurse domain

- [Accounts and roles](https://github.com/firta/nursepro-backend/blob/master/core/models.py): `core/models.py`
- [Nurse levels](https://github.com/firta/nursepro-backend/blob/master/core/models.py): `core/models.py`
- [Counseling records](https://github.com/firta/nursepro-backend/blob/master/core/models.py): `core/models.py`
- [Audit records](https://github.com/firta/nursepro-backend/blob/master/core/models.py): `core/models.py`
- [Model signals](https://github.com/firta/nursepro-backend/blob/master/core/signals.py): `core/signals.py`

### Background work

- [Database seeding](https://github.com/firta/nursepro-backend/blob/master/core/management/commands/seed_database.py): `core/management/commands/seed_database.py`
- [Upgrade command](https://github.com/firta/nursepro-backend/blob/master/core/management/commands/run_nurse_upgrade.py): `core/management/commands/run_nurse_upgrade.py`
- [Level upgrade task](https://github.com/firta/nursepro-backend/blob/master/core/tasks.py): `core/tasks.py`
- [Celery configuration](https://github.com/firta/nursepro-backend/blob/master/BackEnd/celery.py): `BackEnd/celery.py`

### Backend platform

- **Application database**
- [Database retries](https://github.com/firta/nursepro-backend/blob/master/BackEnd/db_retries.py): `BackEnd/db_retries.py`
- [Core app setup](https://github.com/firta/nursepro-backend/blob/master/core/apps.py): `core/apps.py`

### Other components

- **API client**

## Connections

- API client → API routes: sends request
- API routes → API views: routes to (evidence: `core/urls.py`)
- API views → Request serializers: uses (evidence: `core/views.py`)
- API views → Accounts and roles: queries (evidence: `core/views.py`)
- API views → Nurse levels: queries (evidence: `core/views.py`)
- API views → Counseling records: queries (evidence: `core/views.py`)
- API views → View mixins: uses (evidence: `core/views.py`)
- Request serializers → Accounts and roles: serializes (evidence: `core/serializers.py`)
- Request serializers → Nurse levels: creates (evidence: `core/serializers.py`)
- Accounts and roles → Application database: persists (evidence: `core/models.py`)
- Nurse levels → Application database: persists (evidence: `core/models.py`)
- Counseling records → Application database: persists (evidence: `core/models.py`)
- Audit records → Application database: persists (evidence: `core/models.py`)
- Core app setup → Model signals: imports (evidence: `core/apps.py`)
- Model signals → Accounts and roles: references (evidence: `core/signals.py`)
- Model signals → Nurse levels: references (evidence: `core/signals.py`)
- Database seeding → Accounts and roles: creates records (evidence: `core/management/commands/seed_database.py`)
- Database seeding → Counseling records: creates records (evidence: `core/management/commands/seed_database.py`)
- Upgrade command → Level upgrade task: invokes (evidence: `core/management/commands/run_nurse_upgrade.py`)
- Level upgrade task → Nurse levels: checks upgrades (evidence: `core/tasks.py`)
- Level upgrade task → Celery configuration: registers task (evidence: `core/tasks.py`)
- View mixins → Database retries: uses decorator (evidence: `core/mixins.py`)
