# jazayerihamid/fivesystem architecture

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

- Interactive diagram: https://gitdiagram.com/jazayerihamid/fivesystem
- Repository: https://github.com/jazayerihamid/fivesystem

## Overview

This Django application supports a 5S evaluation workflow: users access role-specific pages, buildings complete self-assessments, auditors verify them, and the system tracks scores and corrective actions. Related capabilities include checklist management and exemptions, organizational structure, reporting, LDAP-backed user lookup, SMS notifications, and Nextcloud file storage. The README is empty; relationships below are limited to routes, calls, and module references visible in the supplied excerpts and SOURCE INDEX.

Main entry points: [`checklists/models.py`](https://github.com/jazayerihamid/fivesystem/blob/master/checklists/models.py) (Checklist & Exemptions), [`evaluations/models.py`](https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/models.py) (Evaluation Records), [`evaluations/views.py`](https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/views.py) (Evaluation Views), [`fivesystem/urls.py`](https://github.com/jazayerihamid/fivesystem/blob/master/fivesystem/urls.py) (URL Routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Identity &amp; Access"]
  node_account_views["Account Views<br/>[views.py]"]
  node_authorization["Role Authorization<br/>[authorization.py]"]
  node_account_models["Account Records<br/>[models.py]"]
  node_ldap["LDAP Utilities<br/>[ldap_utils.py]"]
end

subgraph group_structure["Organization &amp; Checklists"]
  node_org_views["Organization Views<br/>[views.py]"]
  node_org_models["Organization Structure<br/>[models.py]"]
  node_checklist_views["Checklist &amp; Exemption Views<br/>[views.py]"]
  node_checklist_models["Checklist &amp; Exemptions<br/>[models.py]"]
  node_checklist_services["Checklist Versioning<br/>[services.py]"]
  node_corrections["Exemption Corrections<br/>[corrections.py]"]
end

subgraph group_evaluation["Assessment Workflow"]
  node_routing["URL Routing<br/>[urls.py]"]
  node_eval_views["Evaluation Views<br/>[views.py]"]
  node_eval_models["Evaluation Records<br/>[models.py]"]
  node_scoring["Score Calculation<br/>[scoring.py]"]
  node_reports["Reports<br/>[views.py]"]
  node_orm_safety["ORM Integrity Guard<br/>[orm_safety.py]"]
end

subgraph group_integrations["External Services"]
  node_sms["SMS Sender<br/>[sender.py]"]
  node_nextcloud["Nextcloud Storage<br/>[nextcloud.py]"]
  node_directory{{"Active Directory"}}
  node_sms_gateway{{"SMS Gateway"}}
  node_cloud{{"Nextcloud"}}
end

node_user(("User"))

node_user -->|"opens pages"| node_routing
node_routing -->|"routes requests"| node_account_views
node_routing -->|"routes requests"| node_org_views
node_routing -->|"routes requests"| node_eval_views
node_account_views -->|"checks roles"| node_authorization
node_account_views -->|"looks up users"| node_ldap
node_ldap -->|"queries directory"| node_directory
node_authorization -->|"checks assignments"| node_account_models
node_org_views -->|"uses organization"| node_org_models
node_checklist_views -->|"manages exemptions"| node_checklist_models
node_checklist_views -->|"creates versions"| node_checklist_services
node_checklist_services -->|"creates checklist"| node_checklist_models
node_corrections -->|"corrects exemptions"| node_checklist_models
node_eval_views -->|"records assessments"| node_eval_models
node_eval_views -->|"uses exemptions"| node_checklist_models
node_eval_views -->|"selects buildings"| node_org_models
node_eval_models -->|"references checklists"| node_checklist_models
node_eval_models -->|"references buildings"| node_org_models
node_eval_models -->|"stores files"| node_nextcloud
node_nextcloud -->|"transfers files"| node_cloud
node_eval_views -->|"uses scoring"| node_scoring
node_reports -->|"reads evaluation data"| node_eval_models
node_reports -->|"reads checklist data"| node_checklist_models
node_eval_models -->|"uses guarded manager"| node_orm_safety
node_checklist_models -->|"uses guarded manager"| node_orm_safety
node_account_models -->|"uses guarded manager"| node_orm_safety
node_org_models -->|"uses guarded manager"| node_orm_safety
node_sms -->|"sends messages"| node_sms_gateway

click node_routing "https://github.com/jazayerihamid/fivesystem/blob/master/fivesystem/urls.py"
click node_account_views "https://github.com/jazayerihamid/fivesystem/blob/master/accounts/views.py"
click node_authorization "https://github.com/jazayerihamid/fivesystem/blob/master/accounts/authorization.py"
click node_account_models "https://github.com/jazayerihamid/fivesystem/blob/master/accounts/models.py"
click node_ldap "https://github.com/jazayerihamid/fivesystem/blob/master/accounts/ldap_utils.py"
click node_org_views "https://github.com/jazayerihamid/fivesystem/blob/master/orgstructure/views.py"
click node_org_models "https://github.com/jazayerihamid/fivesystem/blob/master/orgstructure/models.py"
click node_checklist_views "https://github.com/jazayerihamid/fivesystem/blob/master/accounts/views.py"
click node_checklist_models "https://github.com/jazayerihamid/fivesystem/blob/master/checklists/models.py"
click node_checklist_services "https://github.com/jazayerihamid/fivesystem/blob/master/checklists/services.py"
click node_corrections "https://github.com/jazayerihamid/fivesystem/blob/master/checklists/corrections.py"
click node_eval_views "https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/views.py"
click node_eval_models "https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/models.py"
click node_scoring "https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/scoring.py"
click node_reports "https://github.com/jazayerihamid/fivesystem/blob/master/reports/views.py"
click node_sms "https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/sms/sender.py"
click node_nextcloud "https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/storage_backends/nextcloud.py"
click node_orm_safety "https://github.com/jazayerihamid/fivesystem/blob/master/fivesystem/orm_safety.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_account_views,node_authorization,node_account_models,node_ldap,node_user toneBlue
class node_org_views,node_org_models,node_checklist_views,node_checklist_models,node_checklist_services,node_corrections toneAmber
class node_routing,node_eval_views,node_eval_models,node_scoring,node_reports,node_orm_safety toneMint
class node_sms,node_nextcloud,node_directory,node_sms_gateway,node_cloud toneRose
```

## Components

### Identity & Access

- [Account Views](https://github.com/jazayerihamid/fivesystem/blob/master/accounts/views.py): `accounts/views.py`
- [Role Authorization](https://github.com/jazayerihamid/fivesystem/blob/master/accounts/authorization.py): `accounts/authorization.py`
- [Account Records](https://github.com/jazayerihamid/fivesystem/blob/master/accounts/models.py): `accounts/models.py`
- [LDAP Utilities](https://github.com/jazayerihamid/fivesystem/blob/master/accounts/ldap_utils.py): `accounts/ldap_utils.py`

### Organization & Checklists

- [Organization Views](https://github.com/jazayerihamid/fivesystem/blob/master/orgstructure/views.py): `orgstructure/views.py`
- [Organization Structure](https://github.com/jazayerihamid/fivesystem/blob/master/orgstructure/models.py): `orgstructure/models.py`
- [Checklist & Exemption Views](https://github.com/jazayerihamid/fivesystem/blob/master/accounts/views.py): `accounts/views.py`
- [Checklist & Exemptions](https://github.com/jazayerihamid/fivesystem/blob/master/checklists/models.py): `checklists/models.py`
- [Checklist Versioning](https://github.com/jazayerihamid/fivesystem/blob/master/checklists/services.py): `checklists/services.py`
- [Exemption Corrections](https://github.com/jazayerihamid/fivesystem/blob/master/checklists/corrections.py): `checklists/corrections.py`

### Assessment Workflow

- [URL Routing](https://github.com/jazayerihamid/fivesystem/blob/master/fivesystem/urls.py): `fivesystem/urls.py`
- [Evaluation Views](https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/views.py): `evaluations/views.py`
- [Evaluation Records](https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/models.py): `evaluations/models.py`
- [Score Calculation](https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/scoring.py): `evaluations/scoring.py`
- [Reports](https://github.com/jazayerihamid/fivesystem/blob/master/reports/views.py): `reports/views.py`
- [ORM Integrity Guard](https://github.com/jazayerihamid/fivesystem/blob/master/fivesystem/orm_safety.py): `fivesystem/orm_safety.py`

### External Services

- [SMS Sender](https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/sms/sender.py): `evaluations/sms/sender.py`
- [Nextcloud Storage](https://github.com/jazayerihamid/fivesystem/blob/master/evaluations/storage_backends/nextcloud.py): `evaluations/storage_backends/nextcloud.py`
- **Active Directory**
- **SMS Gateway**
- **Nextcloud**

### Other components

- **User**

## Connections

- User → URL Routing: opens pages (evidence: `fivesystem/urls.py`)
- URL Routing → Account Views: routes requests (evidence: `fivesystem/urls.py`)
- URL Routing → Organization Views: routes requests (evidence: `fivesystem/urls.py`)
- URL Routing → Evaluation Views: routes requests (evidence: `fivesystem/urls.py`)
- Account Views → Role Authorization: checks roles (evidence: `accounts/views.py`)
- Account Views → LDAP Utilities: looks up users (evidence: `accounts/views.py`)
- LDAP Utilities → Active Directory: queries directory (evidence: `accounts/ldap_utils.py`)
- Role Authorization → Account Records: checks assignments (evidence: `accounts/authorization.py`)
- Organization Views → Organization Structure: uses organization (evidence: `orgstructure/views.py`)
- Checklist & Exemption Views → Checklist & Exemptions: manages exemptions (evidence: `accounts/views.py`)
- Checklist & Exemption Views → Checklist Versioning: creates versions (evidence: `accounts/views.py`)
- Checklist Versioning → Checklist & Exemptions: creates checklist (evidence: `checklists/services.py`)
- Exemption Corrections → Checklist & Exemptions: corrects exemptions (evidence: `checklists/corrections.py`)
- Evaluation Views → Evaluation Records: records assessments (evidence: `evaluations/views.py`)
- Evaluation Views → Checklist & Exemptions: uses exemptions (evidence: `evaluations/views.py`)
- Evaluation Views → Organization Structure: selects buildings (evidence: `evaluations/views.py`)
- Evaluation Records → Checklist & Exemptions: references checklists (evidence: `evaluations/models.py`)
- Evaluation Records → Organization Structure: references buildings (evidence: `evaluations/models.py`)
- Evaluation Records → Nextcloud Storage: stores files (evidence: `evaluations/models.py`)
- Nextcloud Storage → Nextcloud: transfers files (evidence: `evaluations/storage_backends/nextcloud.py`)
- Evaluation Views → Score Calculation: uses scoring (evidence: `evaluations/views.py`)
- Reports → Evaluation Records: reads evaluation data (evidence: `reports/views.py`)
- Reports → Checklist & Exemptions: reads checklist data (evidence: `reports/views.py`)
- Evaluation Records → ORM Integrity Guard: uses guarded manager (evidence: `evaluations/models.py`)
- Checklist & Exemptions → ORM Integrity Guard: uses guarded manager (evidence: `checklists/models.py`)
- Account Records → ORM Integrity Guard: uses guarded manager (evidence: `accounts/models.py`)
- Organization Structure → ORM Integrity Guard: uses guarded manager (evidence: `orgstructure/models.py`)
- SMS Sender → SMS Gateway: sends messages (evidence: `evaluations/sms/sender.py`)
