# doculan/docuroute1 architecture

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

- Interactive diagram: https://gitdiagram.com/doculan/docuroute1
- Repository: https://github.com/doculan/docuroute1

## Overview

DocuRoute manages controlled university manuals and routes proposed changes through assessment, concurrence, signing, IMR decision, and custodian effectiveness. Staff and administrators use role-specific React portals backed by Django APIs and persistent document/workflow records. Manual intake extracts and tags sections; revision assessment combines rule, model, and fusion layers with reviewer-facing explanations. The README documents these product capabilities; source excerpts are partial, so unsampled endpoint wiring is shown only where the documented workflow or visible calls support it.

Main entry points: [`Backend/api/models.py`](https://github.com/doculan/docuroute1/blob/main/Backend/api/models.py) (QMS records), [`Backend/ml/revision_pipeline/pipeline.py`](https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/pipeline.py) (Assessment pipeline), [`frontend/src/App.jsx`](https://github.com/doculan/docuroute1/blob/main/frontend/src/App.jsx) (Portal routing), [`Backend/api/documents.py`](https://github.com/doculan/docuroute1/blob/main/Backend/api/documents.py) (Manual APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User portals"]
  node_react["Portal routing<br/>[App.jsx]"]
  node_authclient["Session client<br/>[authClient.js]"]
  node_staffportal["Staff portal<br/>[StaffDashboard.jsx]"]
  node_sectionsearch["Section search"]
  node_adminportal["Admin portal<br/>[AdminDashboard.jsx]"]
  node_sectionadmin["Manual sections<br/>[Sections.jsx]"]
  node_qmsportal["QMS portal<br/>[QmsDashboard.jsx]"]
  node_qmsdecisions["QMS decisions<br/>[QmsRequests.jsx]"]
end

subgraph group_content["Manual lifecycle"]
  node_manualapi["Manual APIs<br/>[documents.py]"]
  node_ocr["Document extraction<br/>[ocr_engine.py]"]
  node_svm["Section classifier<br/>[svm_model.py]"]
end

subgraph group_workflow["Change control"]
  node_proposalapi["Proposal APIs<br/>[proposal_views.py]"]
  node_concurrence["Concurrence process"]
  node_generation["DCR generation<br/>[dcr.py]"]
  node_qmsapi["QMS APIs<br/>[qms_views.py]"]
end

subgraph group_assessment["Revision assessment"]
  node_assessmentapi["Pre-assessment API<br/>[pre_assessment.py]"]
  node_pipeline["Assessment pipeline<br/>[pipeline.py]"]
  node_retrieval["Context retrieval<br/>[retrieval.py]"]
  node_rules["Rule assessment<br/>[layer1_rules.py]"]
  node_model["Model assessment<br/>[layer2_model.py]"]
  node_fusion["Result fusion<br/>[layer3_fusion.py]"]
  node_explain["Assessment explanation<br/>[layer4_explain.py]"]
end

subgraph group_platform["Application data"]
  node_records[("QMS records<br/>[models.py]")]
  node_authapi["Identity APIs<br/>[access.py]"]
  node_django["Django API<br/>[urls.py]"]
  node_db[("Application database<br/>[settings.py]")]
end

node_staff(("Staff"))
node_admins(("Administrators"))

node_staff -->|"uses"| node_react
node_admins -->|"uses"| node_react
node_react -->|"checks portal"| node_authapi
node_react -->|"opens"| node_staffportal
node_react -->|"opens"| node_adminportal
node_react -->|"opens"| node_qmsportal
node_authclient -->|"refreshes token"| node_authapi
node_staffportal -->|"searches sections"| node_sectionsearch
node_sectionsearch -->|"requests sections"| node_manualapi
node_adminportal -->|"manages sections"| node_sectionadmin
node_sectionadmin -->|"creates sections"| node_manualapi
node_manualapi -->|"extracts uploads"| node_ocr
node_manualapi -->|"classifies sections"| node_svm
node_manualapi -->|"reads and writes"| node_records
node_staffportal -->|"drafts changes"| node_proposalapi
node_proposalapi -->|"requests assessment"| node_assessmentapi
node_assessmentapi -->|"assesses revision"| node_pipeline
node_pipeline -->|"retrieves context"| node_retrieval
node_pipeline -->|"runs rules"| node_rules
node_pipeline -.->|"runs model"| node_model
node_pipeline -->|"fuses findings"| node_fusion
node_pipeline -->|"renders findings"| node_explain
node_assessmentapi -->|"loads revision"| node_records
node_proposalapi -->|"routes for concurrence"| node_concurrence
node_concurrence -->|"generates DCR"| node_generation
node_qmsportal -->|"reviews requests"| node_qmsdecisions
node_qmsdecisions -->|"submits decisions"| node_qmsapi
node_qmsapi -->|"updates workflow"| node_records
node_proposalapi -->|"stores proposals"| node_records
node_concurrence -->|"stores concurrence"| node_records
node_authapi -->|"reads accounts"| node_records
node_django -->|"dispatches routes"| node_authapi
node_django -->|"dispatches routes"| node_manualapi
node_django -->|"dispatches routes"| node_proposalapi
node_django -->|"dispatches routes"| node_qmsapi
node_records -->|"persists records"| node_db

click node_react "https://github.com/doculan/docuroute1/blob/main/frontend/src/App.jsx"
click node_authclient "https://github.com/doculan/docuroute1/blob/main/frontend/src/authClient.js"
click node_staffportal "https://github.com/doculan/docuroute1/blob/main/frontend/src/components/staff/StaffDashboard.jsx"
click node_sectionsearch "https://github.com/doculan/docuroute1/blob/main/frontend/src/components/staff/StaffSectionSearch.jsx"
click node_adminportal "https://github.com/doculan/docuroute1/blob/main/frontend/src/components/admin/AdminDashboard.jsx"
click node_sectionadmin "https://github.com/doculan/docuroute1/blob/main/frontend/src/components/admin/Sections.jsx"
click node_qmsportal "https://github.com/doculan/docuroute1/blob/main/frontend/src/components/qms/QmsDashboard.jsx"
click node_qmsdecisions "https://github.com/doculan/docuroute1/blob/main/frontend/src/components/qms/QmsRequests.jsx"
click node_manualapi "https://github.com/doculan/docuroute1/blob/main/Backend/api/documents.py"
click node_ocr "https://github.com/doculan/docuroute1/blob/main/Backend/ml/ocr_engine.py"
click node_svm "https://github.com/doculan/docuroute1/blob/main/Backend/ml/svm_model.py"
click node_proposalapi "https://github.com/doculan/docuroute1/blob/main/Backend/api/proposal_views.py"
click node_concurrence "https://github.com/doculan/docuroute1/blob/main/Backend/api/concurrence_views.py"
click node_generation "https://github.com/doculan/docuroute1/blob/main/Backend/api/generation/dcr.py"
click node_qmsapi "https://github.com/doculan/docuroute1/blob/main/Backend/api/qms_views.py"
click node_assessmentapi "https://github.com/doculan/docuroute1/blob/main/Backend/api/pre_assessment.py"
click node_pipeline "https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/pipeline.py"
click node_retrieval "https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/retrieval.py"
click node_rules "https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/layer1_rules.py"
click node_model "https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/layer2_model.py"
click node_fusion "https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/layer3_fusion.py"
click node_explain "https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/layer4_explain.py"
click node_records "https://github.com/doculan/docuroute1/blob/main/Backend/api/models.py"
click node_authapi "https://github.com/doculan/docuroute1/blob/main/Backend/api/access.py"
click node_django "https://github.com/doculan/docuroute1/blob/main/Backend/api/urls.py"
click node_db "https://github.com/doculan/docuroute1/blob/main/Backend/backend/settings.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_react,node_authclient,node_staffportal,node_sectionsearch,node_adminportal,node_sectionadmin,node_qmsportal,node_qmsdecisions toneBlue
class node_manualapi,node_ocr,node_svm toneAmber
class node_proposalapi,node_concurrence,node_generation,node_qmsapi toneMint
class node_assessmentapi,node_pipeline,node_retrieval,node_rules,node_model,node_fusion,node_explain toneRose
class node_records,node_authapi,node_django,node_db,node_staff,node_admins toneIndigo
```

## Components

### User portals

- [Portal routing](https://github.com/doculan/docuroute1/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session client](https://github.com/doculan/docuroute1/blob/main/frontend/src/authClient.js): `frontend/src/authClient.js`
- [Staff portal](https://github.com/doculan/docuroute1/blob/main/frontend/src/components/staff/StaffDashboard.jsx): `frontend/src/components/staff/StaffDashboard.jsx`
- [Section search](https://github.com/doculan/docuroute1/blob/main/frontend/src/components/staff/StaffSectionSearch.jsx): `frontend/src/components/staff/StaffSectionSearch.jsx`
- [Admin portal](https://github.com/doculan/docuroute1/blob/main/frontend/src/components/admin/AdminDashboard.jsx): `frontend/src/components/admin/AdminDashboard.jsx`
- [Manual sections](https://github.com/doculan/docuroute1/blob/main/frontend/src/components/admin/Sections.jsx): `frontend/src/components/admin/Sections.jsx`
- [QMS portal](https://github.com/doculan/docuroute1/blob/main/frontend/src/components/qms/QmsDashboard.jsx): `frontend/src/components/qms/QmsDashboard.jsx`
- [QMS decisions](https://github.com/doculan/docuroute1/blob/main/frontend/src/components/qms/QmsRequests.jsx): `frontend/src/components/qms/QmsRequests.jsx`

### Manual lifecycle

- [Manual APIs](https://github.com/doculan/docuroute1/blob/main/Backend/api/documents.py): `Backend/api/documents.py`
- [Document extraction](https://github.com/doculan/docuroute1/blob/main/Backend/ml/ocr_engine.py): `Backend/ml/ocr_engine.py`
- [Section classifier](https://github.com/doculan/docuroute1/blob/main/Backend/ml/svm_model.py): `Backend/ml/svm_model.py`

### Change control

- [Proposal APIs](https://github.com/doculan/docuroute1/blob/main/Backend/api/proposal_views.py): `Backend/api/proposal_views.py`
- [Concurrence process](https://github.com/doculan/docuroute1/blob/main/Backend/api/concurrence_views.py): `Backend/api/concurrence_views.py`
- [DCR generation](https://github.com/doculan/docuroute1/blob/main/Backend/api/generation/dcr.py): `Backend/api/generation/dcr.py`
- [QMS APIs](https://github.com/doculan/docuroute1/blob/main/Backend/api/qms_views.py): `Backend/api/qms_views.py`

### Revision assessment

- [Pre-assessment API](https://github.com/doculan/docuroute1/blob/main/Backend/api/pre_assessment.py): `Backend/api/pre_assessment.py`
- [Assessment pipeline](https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/pipeline.py): `Backend/ml/revision_pipeline/pipeline.py`
- [Context retrieval](https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/retrieval.py): `Backend/ml/revision_pipeline/retrieval.py`
- [Rule assessment](https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/layer1_rules.py): `Backend/ml/revision_pipeline/layer1_rules.py`
- [Model assessment](https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/layer2_model.py): `Backend/ml/revision_pipeline/layer2_model.py`
- [Result fusion](https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/layer3_fusion.py): `Backend/ml/revision_pipeline/layer3_fusion.py`
- [Assessment explanation](https://github.com/doculan/docuroute1/blob/main/Backend/ml/revision_pipeline/layer4_explain.py): `Backend/ml/revision_pipeline/layer4_explain.py`

### Application data

- [QMS records](https://github.com/doculan/docuroute1/blob/main/Backend/api/models.py): `Backend/api/models.py`
- [Identity APIs](https://github.com/doculan/docuroute1/blob/main/Backend/api/access.py): `Backend/api/access.py`
- [Django API](https://github.com/doculan/docuroute1/blob/main/Backend/api/urls.py): `Backend/api/urls.py`
- [Application database](https://github.com/doculan/docuroute1/blob/main/Backend/backend/settings.py): `Backend/backend/settings.py`

### Other components

- **Staff**
- **Administrators**

## Connections

- Staff → Portal routing: uses
- Administrators → Portal routing: uses
- Portal routing → Identity APIs: checks portal
- Portal routing → Staff portal: opens
- Portal routing → Admin portal: opens
- Portal routing → QMS portal: opens
- Session client → Identity APIs: refreshes token
- Staff portal → Section search: searches sections
- Section search → Manual APIs: requests sections
- Admin portal → Manual sections: manages sections
- Manual sections → Manual APIs: creates sections
- Manual APIs → Document extraction: extracts uploads
- Manual APIs → Section classifier: classifies sections
- Manual APIs → QMS records: reads and writes
- Staff portal → Proposal APIs: drafts changes
- Proposal APIs → Pre-assessment API: requests assessment
- Pre-assessment API → Assessment pipeline: assesses revision
- Assessment pipeline → Context retrieval: retrieves context
- Assessment pipeline → Rule assessment: runs rules
- Assessment pipeline → Model assessment: runs model
- Assessment pipeline → Result fusion: fuses findings
- Assessment pipeline → Assessment explanation: renders findings
- Pre-assessment API → QMS records: loads revision
- Proposal APIs → Concurrence process: routes for concurrence
- Concurrence process → DCR generation: generates DCR
- QMS portal → QMS decisions: reviews requests
- QMS decisions → QMS APIs: submits decisions
- QMS APIs → QMS records: updates workflow
- Proposal APIs → QMS records: stores proposals
- Concurrence process → QMS records: stores concurrence
- Identity APIs → QMS records: reads accounts
- Django API → Identity APIs: dispatches routes
- Django API → Manual APIs: dispatches routes
- Django API → Proposal APIs: dispatches routes
- Django API → QMS APIs: dispatches routes
- QMS records → Application database: persists records
