# zap1104/udm-doctrack architecture

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

- Interactive diagram: https://gitdiagram.com/zap1104/udm-doctrack
- Repository: https://github.com/zap1104/udm-doctrack

## Overview

UDM DocTrack combines document tracking (custody, routing and receipts) with a document repository (extraction, reviewed metadata, retention and search). The main workflow routes records between offices, records explicit receipt and history, then archives completed records; uploads can also enter extraction and metadata review before repository use. The README documents capabilities beyond the sampled excerpts, so those links are cited there; source-level edges use the supplied index or excerpts, and unsampled internals are not inferred.

Main entry points: [`apps/documents/services.py`](https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/services.py) (Archive and file services), [`apps/tracking/services.py`](https://github.com/zap1104/udm-doctrack/blob/main/apps/tracking/services.py) (Routing and custody rules), [`apps/tracking/views.py`](https://github.com/zap1104/udm-doctrack/blob/main/apps/tracking/views.py) (Tracking interface), [`apps/documents/tasks.py`](https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/tasks.py) (Background extraction task)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts and access"]
  node_accounts_ui["Accounts and sign-in<br/>[views.py]"]
  node_account_data[("Users and offices<br/>[models.py]")]
end

subgraph group_tracking["Document tracking"]
  node_tracking_ui["Tracking interface<br/>[views.py]"]
  node_tracking_rules["Routing and custody rules<br/>[services.py]"]
  node_tracking_data[("Tracking records and history<br/>[models.py]")]
end

subgraph group_repository["Document repository"]
  node_archive_ui["Repository interface<br/>[views.py]"]
  node_archive_rules["Archive and file services<br/>[services.py]"]
  node_document_data[("Documents and metadata<br/>[models.py]")]
  node_text_extraction["Text extraction<br/>[extraction.py]"]
  node_metadata_suggestions["Metadata suggestions<br/>[suggestions.py]"]
  node_background_extraction["Background extraction task<br/>[tasks.py]"]
end

subgraph group_search["Search and reporting"]
  node_search_ui["Search interface<br/>[views.py]"]
  node_search_ranking["Relevance and matching<br/>[services.py]"]
  node_analytics["Dashboard and reports<br/>[analytics.py]"]
end

subgraph group_shared["Shared services"]
  node_master_data[("Types and metadata rules<br/>[models.py]")]
  node_audit[("Audit and notifications<br/>[models.py]")]
  node_shared_tasks["Scheduled notifications<br/>[tasks.py]"]
end

node_staff(("Office staff"))
node_records_staff(("Records staff"))
node_postgres[("PostgreSQL")]
node_file_storage[("Configured file storage")]
node_ocr_provider["External OCR provider"]

node_staff -->|"signs in"| node_accounts_ui
node_accounts_ui -->|"uses accounts"| node_account_data
node_staff -->|"creates and routes"| node_tracking_ui
node_tracking_ui -->|"delegates rules"| node_tracking_rules
node_tracking_rules -->|"writes custody history"| node_tracking_data
node_tracking_ui -->|"uses office accounts"| node_account_data
node_staff -->|"confirms receipt"| node_tracking_ui
node_tracking_rules -->|"archives completed records"| node_archive_rules
node_records_staff -->|"uploads and reviews"| node_archive_ui
node_archive_ui -.->|"submits archive actions"| node_archive_rules
node_archive_rules -->|"extracts file text"| node_text_extraction
node_archive_rules -->|"saves documents"| node_document_data
node_archive_rules -->|"uses async extraction"| node_background_extraction
node_background_extraction -->|"extracts file text"| node_text_extraction
node_background_extraction -->|"generates suggestions"| node_metadata_suggestions
node_archive_rules -->|"suggests metadata"| node_metadata_suggestions
node_records_staff -->|"searches records"| node_search_ui
node_search_ui -->|"requests ranked results"| node_search_ranking
node_search_ranking -->|"queries visible documents"| node_document_data
node_search_ui -->|"uses tracking filters"| node_tracking_rules
node_records_staff -->|"reviews reports"| node_analytics
node_tracking_rules -.->|"records audit events"| node_audit
node_shared_tasks -->|"creates notifications"| node_audit
node_tracking_rules -.->|"uses routing rules"| node_master_data
node_document_data -->|"persists records"| node_postgres
node_tracking_data -->|"persists tracking"| node_postgres
node_archive_rules -->|"stores uploaded files"| node_file_storage
node_text_extraction -.->|"optional OCR"| node_ocr_provider

click node_accounts_ui "https://github.com/zap1104/udm-doctrack/blob/main/apps/accounts/views.py"
click node_account_data "https://github.com/zap1104/udm-doctrack/blob/main/apps/accounts/models.py"
click node_tracking_ui "https://github.com/zap1104/udm-doctrack/blob/main/apps/tracking/views.py"
click node_tracking_rules "https://github.com/zap1104/udm-doctrack/blob/main/apps/tracking/services.py"
click node_tracking_data "https://github.com/zap1104/udm-doctrack/blob/main/apps/tracking/models.py"
click node_archive_ui "https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/views.py"
click node_archive_rules "https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/services.py"
click node_document_data "https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/models.py"
click node_text_extraction "https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/extraction.py"
click node_metadata_suggestions "https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/suggestions.py"
click node_background_extraction "https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/tasks.py"
click node_search_ui "https://github.com/zap1104/udm-doctrack/blob/main/apps/search/views.py"
click node_search_ranking "https://github.com/zap1104/udm-doctrack/blob/main/apps/search/services.py"
click node_analytics "https://github.com/zap1104/udm-doctrack/blob/main/apps/core/analytics.py"
click node_master_data "https://github.com/zap1104/udm-doctrack/blob/main/apps/core/models.py"
click node_audit "https://github.com/zap1104/udm-doctrack/blob/main/apps/core/models.py"
click node_shared_tasks "https://github.com/zap1104/udm-doctrack/blob/main/apps/core/tasks.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_accounts_ui,node_account_data toneBlue
class node_tracking_ui,node_tracking_rules,node_tracking_data,node_postgres,node_file_storage toneAmber
class node_archive_ui,node_archive_rules,node_document_data,node_text_extraction,node_metadata_suggestions,node_background_extraction toneMint
class node_search_ui,node_search_ranking,node_analytics toneRose
class node_master_data,node_audit,node_shared_tasks,node_staff,node_records_staff,node_ocr_provider toneIndigo
```

## Components

### Accounts and access

- [Accounts and sign-in](https://github.com/zap1104/udm-doctrack/blob/main/apps/accounts/views.py): `apps/accounts/views.py`
- [Users and offices](https://github.com/zap1104/udm-doctrack/blob/main/apps/accounts/models.py): `apps/accounts/models.py`

### Document tracking

- [Tracking interface](https://github.com/zap1104/udm-doctrack/blob/main/apps/tracking/views.py): `apps/tracking/views.py`
- [Routing and custody rules](https://github.com/zap1104/udm-doctrack/blob/main/apps/tracking/services.py): `apps/tracking/services.py`
- [Tracking records and history](https://github.com/zap1104/udm-doctrack/blob/main/apps/tracking/models.py): `apps/tracking/models.py`

### Document repository

- [Repository interface](https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/views.py): `apps/documents/views.py`
- [Archive and file services](https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/services.py): `apps/documents/services.py`
- [Documents and metadata](https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/models.py): `apps/documents/models.py`
- [Text extraction](https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/extraction.py): `apps/documents/extraction.py`
- [Metadata suggestions](https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/suggestions.py): `apps/documents/suggestions.py`
- [Background extraction task](https://github.com/zap1104/udm-doctrack/blob/main/apps/documents/tasks.py): `apps/documents/tasks.py`

### Search and reporting

- [Search interface](https://github.com/zap1104/udm-doctrack/blob/main/apps/search/views.py): `apps/search/views.py`
- [Relevance and matching](https://github.com/zap1104/udm-doctrack/blob/main/apps/search/services.py): `apps/search/services.py`
- [Dashboard and reports](https://github.com/zap1104/udm-doctrack/blob/main/apps/core/analytics.py): `apps/core/analytics.py`

### Shared services

- [Types and metadata rules](https://github.com/zap1104/udm-doctrack/blob/main/apps/core/models.py): `apps/core/models.py`
- [Audit and notifications](https://github.com/zap1104/udm-doctrack/blob/main/apps/core/models.py): `apps/core/models.py`
- [Scheduled notifications](https://github.com/zap1104/udm-doctrack/blob/main/apps/core/tasks.py): `apps/core/tasks.py`

### Other components

- **Office staff**
- **Records staff**
- **PostgreSQL**
- **Configured file storage**
- **External OCR provider**

## Connections

- Office staff → Accounts and sign-in: signs in (evidence: `README.md`)
- Accounts and sign-in → Users and offices: uses accounts (evidence: `apps/accounts/views.py`)
- Office staff → Tracking interface: creates and routes (evidence: `README.md`)
- Tracking interface → Routing and custody rules: delegates rules (evidence: `apps/tracking/views.py`)
- Routing and custody rules → Tracking records and history: writes custody history (evidence: `apps/tracking/services.py`)
- Tracking interface → Users and offices: uses office accounts (evidence: `apps/tracking/views.py`)
- Office staff → Tracking interface: confirms receipt (evidence: `README.md`)
- Routing and custody rules → Archive and file services: archives completed records (evidence: `README.md`)
- Records staff → Repository interface: uploads and reviews (evidence: `README.md`)
- Repository interface → Archive and file services: submits archive actions
- Archive and file services → Text extraction: extracts file text (evidence: `apps/documents/services.py`)
- Archive and file services → Documents and metadata: saves documents (evidence: `apps/documents/services.py`)
- Archive and file services → Background extraction task: uses async extraction (evidence: `apps/documents/services.py`)
- Background extraction task → Text extraction: extracts file text (evidence: `apps/documents/tasks.py`)
- Background extraction task → Metadata suggestions: generates suggestions (evidence: `apps/documents/tasks.py`)
- Archive and file services → Metadata suggestions: suggests metadata (evidence: `apps/documents/services.py`)
- Records staff → Search interface: searches records (evidence: `README.md`)
- Search interface → Relevance and matching: requests ranked results (evidence: `apps/search/views.py`)
- Relevance and matching → Documents and metadata: queries visible documents (evidence: `apps/search/services.py`)
- Search interface → Routing and custody rules: uses tracking filters (evidence: `apps/search/views.py`)
- Records staff → Dashboard and reports: reviews reports (evidence: `README.md`)
- Routing and custody rules → Audit and notifications: records audit events (evidence: `apps/tracking/services.py`)
- Scheduled notifications → Audit and notifications: creates notifications (evidence: `apps/core/tasks.py`)
- Routing and custody rules → Types and metadata rules: uses routing rules (evidence: `apps/tracking/services.py`)
- Documents and metadata → PostgreSQL: persists records (evidence: `README.md`)
- Tracking records and history → PostgreSQL: persists tracking (evidence: `README.md`)
- Archive and file services → Configured file storage: stores uploaded files (evidence: `README.md`)
- Text extraction → External OCR provider: optional OCR (evidence: `README.md`)
