# deepukishore/dms-portal architecture

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

- Interactive diagram: https://gitdiagram.com/deepukishore/dms-portal
- Repository: https://github.com/deepukishore/dms-portal

## Overview

Smart DMS is a Flask document-control portal. Users sign in, upload controlled documents, and route them through first- and final-stage approval; approved documents become browsable in the library, with revision, tracking, reporting, and audit capabilities around that lifecycle. The graph groups HTTP features, document-domain services, identity and communications, and persistence/reference data. Relationships reflect README statements and SOURCE INDEX references; unsampled routes and service behavior are represented only at subsystem level.

Main entry points: [`services/document_service.py`](https://github.com/deepukishore/dms-portal/blob/main/services/document_service.py) (Document records), [`services/document_library_service.py`](https://github.com/deepukishore/dms-portal/blob/main/services/document_library_service.py) (Library assembly), [`app.py`](https://github.com/deepukishore/dms-portal/blob/main/app.py) (Flask application), [`routes/upload_routes.py`](https://github.com/deepukishore/dms-portal/blob/main/routes/upload_routes.py) (Document upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Portal features"]
  node_app["Flask application<br/>[app.py]"]
  node_upload["Document upload<br/>[upload_routes.py]"]
  node_approval["Approval queue<br/>[approval_routes.py]"]
  node_library["Library browsing"]
  node_dashboard["Dashboard and exports"]
  node_tracking["Approval tracking<br/>[tracking_routes.py]"]
  node_reports["Reports and audit views"]
  node_records["Specialized record browsers"]
  node_account["Accounts and profiles<br/>[auth_routes.py]"]
  node_notifications["Notifications"]
  node_archive["Archive<br/>[archive_routes.py]"]
end

subgraph group_docs["Document workflow"]
  node_document_service["Document records"]
  node_category_service["Category records"]
  node_library_service["Library assembly"]
  node_preview["Document previews"]
  node_signing["Document signing"]
  node_revision["Revision history"]
end

subgraph group_identity["Identity and messaging"]
  node_auth["Access control<br/>[auth_service.py]"]
  node_users["User store"]
  node_mail["Email delivery<br/>[mail_service.py]"]
  node_reminders["Quarterly reminders"]
  node_audit["System audit log"]
end

subgraph group_storage["Persistence and reference data"]
  node_db[("Application database<br/>[database.py]")]
  node_library_data["Library definitions"]
  node_reference["Plant and department data<br/>[reference_data.py]"]
  node_customers["Customer data<br/>[customers.py]"]
end

node_user(("Portal user"))
node_smtp["SMTP service"]

node_user -->|"uses"| node_app
node_app -->|"registers routes"| node_upload
node_app -->|"registers routes"| node_approval
node_app -->|"registers routes"| node_library
node_upload -->|"saves documents"| node_document_service
node_upload -->|"categorizes uploads"| node_category_service
node_upload -->|"sends approval email"| node_mail
node_approval -->|"loads documents"| node_document_service
node_approval -->|"sends review request"| node_mail
node_approval -->|"loads recipients"| node_users
node_library -->|"assembles library"| node_library_service
node_library -->|"loads documents"| node_document_service
node_library_service -->|"queries categories"| node_category_service
node_library_service -->|"uses definitions"| node_library_data
node_dashboard -->|"loads documents"| node_document_service
node_dashboard -->|"queries library"| node_library_service
node_dashboard -->|"requests previews"| node_preview
node_tracking -.->|"tracks approvals"| node_document_service
node_reports -->|"reports documents"| node_document_service
node_reports -->|"reports library"| node_library_service
node_records -.->|"browses records"| node_document_service
node_account -.->|"authenticates users"| node_auth
node_auth -->|"looks up users"| node_users
node_notifications -->|"sends notifications"| node_mail
node_notifications -->|"triggers reminders"| node_reminders
node_archive -.->|"manages archived records"| node_document_service
node_document_service -->|"reads and writes"| node_db
node_category_service -->|"queries categories"| node_db
node_users -->|"reads and writes"| node_db
node_audit -->|"writes audit entries"| node_db
node_library_service -->|"normalizes customer names"| node_customers
node_library_service -->|"normalizes plant data"| node_reference
node_mail -.->|"delivers email"| node_smtp
node_user -->|"views progress"| node_tracking
node_user -->|"browses and exports"| node_dashboard
node_user -->|"reviews reports"| node_reports

click node_app "https://github.com/deepukishore/dms-portal/blob/main/app.py"
click node_upload "https://github.com/deepukishore/dms-portal/blob/main/routes/upload_routes.py"
click node_approval "https://github.com/deepukishore/dms-portal/blob/main/routes/approval_routes.py"
click node_library "https://github.com/deepukishore/dms-portal/blob/main/routes/document_library_routes.py"
click node_dashboard "https://github.com/deepukishore/dms-portal/blob/main/routes/dashboard_routes.py"
click node_tracking "https://github.com/deepukishore/dms-portal/blob/main/routes/tracking_routes.py"
click node_reports "https://github.com/deepukishore/dms-portal/blob/main/routes/graphics_report_routes.py"
click node_records "https://github.com/deepukishore/dms-portal/blob/main/routes/customer_records_routes.py"
click node_account "https://github.com/deepukishore/dms-portal/blob/main/routes/auth_routes.py"
click node_notifications "https://github.com/deepukishore/dms-portal/blob/main/routes/notification_routes.py"
click node_archive "https://github.com/deepukishore/dms-portal/blob/main/routes/archive_routes.py"
click node_document_service "https://github.com/deepukishore/dms-portal/blob/main/services/document_service.py"
click node_category_service "https://github.com/deepukishore/dms-portal/blob/main/services/category_document_service.py"
click node_library_service "https://github.com/deepukishore/dms-portal/blob/main/services/document_library_service.py"
click node_preview "https://github.com/deepukishore/dms-portal/blob/main/services/document_preview_service.py"
click node_signing "https://github.com/deepukishore/dms-portal/blob/main/services/document_signing_service.py"
click node_revision "https://github.com/deepukishore/dms-portal/blob/main/services/revision_history_service.py"
click node_auth "https://github.com/deepukishore/dms-portal/blob/main/services/auth_service.py"
click node_users "https://github.com/deepukishore/dms-portal/blob/main/services/user_store_service.py"
click node_mail "https://github.com/deepukishore/dms-portal/blob/main/services/mail_service.py"
click node_reminders "https://github.com/deepukishore/dms-portal/blob/main/services/quarterly_reminder_service.py"
click node_audit "https://github.com/deepukishore/dms-portal/blob/main/services/system_log_service.py"
click node_db "https://github.com/deepukishore/dms-portal/blob/main/database.py"
click node_library_data "https://github.com/deepukishore/dms-portal/blob/main/data/document_library_data.py"
click node_reference "https://github.com/deepukishore/dms-portal/blob/main/data/reference_data.py"
click node_customers "https://github.com/deepukishore/dms-portal/blob/main/data/customers.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_upload,node_approval,node_library,node_dashboard,node_tracking,node_reports,node_records,node_account,node_notifications,node_archive,node_user toneBlue
class node_document_service,node_category_service,node_library_service,node_preview,node_signing,node_revision toneAmber
class node_auth,node_users,node_mail,node_reminders,node_audit toneMint
class node_db,node_library_data,node_reference,node_customers toneRose
class node_smtp toneIndigo
```

## Components

### Portal features

- [Flask application](https://github.com/deepukishore/dms-portal/blob/main/app.py): `app.py`
- [Document upload](https://github.com/deepukishore/dms-portal/blob/main/routes/upload_routes.py): `routes/upload_routes.py`
- [Approval queue](https://github.com/deepukishore/dms-portal/blob/main/routes/approval_routes.py): `routes/approval_routes.py`
- [Library browsing](https://github.com/deepukishore/dms-portal/blob/main/routes/document_library_routes.py): `routes/document_library_routes.py`
- [Dashboard and exports](https://github.com/deepukishore/dms-portal/blob/main/routes/dashboard_routes.py): `routes/dashboard_routes.py`
- [Approval tracking](https://github.com/deepukishore/dms-portal/blob/main/routes/tracking_routes.py): `routes/tracking_routes.py`
- [Reports and audit views](https://github.com/deepukishore/dms-portal/blob/main/routes/graphics_report_routes.py): `routes/graphics_report_routes.py`
- [Specialized record browsers](https://github.com/deepukishore/dms-portal/blob/main/routes/customer_records_routes.py): `routes/customer_records_routes.py`
- [Accounts and profiles](https://github.com/deepukishore/dms-portal/blob/main/routes/auth_routes.py): `routes/auth_routes.py`
- [Notifications](https://github.com/deepukishore/dms-portal/blob/main/routes/notification_routes.py): `routes/notification_routes.py`
- [Archive](https://github.com/deepukishore/dms-portal/blob/main/routes/archive_routes.py): `routes/archive_routes.py`

### Document workflow

- [Document records](https://github.com/deepukishore/dms-portal/blob/main/services/document_service.py): `services/document_service.py`
- [Category records](https://github.com/deepukishore/dms-portal/blob/main/services/category_document_service.py): `services/category_document_service.py`
- [Library assembly](https://github.com/deepukishore/dms-portal/blob/main/services/document_library_service.py): `services/document_library_service.py`
- [Document previews](https://github.com/deepukishore/dms-portal/blob/main/services/document_preview_service.py): `services/document_preview_service.py`
- [Document signing](https://github.com/deepukishore/dms-portal/blob/main/services/document_signing_service.py): `services/document_signing_service.py`
- [Revision history](https://github.com/deepukishore/dms-portal/blob/main/services/revision_history_service.py): `services/revision_history_service.py`

### Identity and messaging

- [Access control](https://github.com/deepukishore/dms-portal/blob/main/services/auth_service.py): `services/auth_service.py`
- [User store](https://github.com/deepukishore/dms-portal/blob/main/services/user_store_service.py): `services/user_store_service.py`
- [Email delivery](https://github.com/deepukishore/dms-portal/blob/main/services/mail_service.py): `services/mail_service.py`
- [Quarterly reminders](https://github.com/deepukishore/dms-portal/blob/main/services/quarterly_reminder_service.py): `services/quarterly_reminder_service.py`
- [System audit log](https://github.com/deepukishore/dms-portal/blob/main/services/system_log_service.py): `services/system_log_service.py`

### Persistence and reference data

- [Application database](https://github.com/deepukishore/dms-portal/blob/main/database.py): `database.py`
- [Library definitions](https://github.com/deepukishore/dms-portal/blob/main/data/document_library_data.py): `data/document_library_data.py`
- [Plant and department data](https://github.com/deepukishore/dms-portal/blob/main/data/reference_data.py): `data/reference_data.py`
- [Customer data](https://github.com/deepukishore/dms-portal/blob/main/data/customers.py): `data/customers.py`

### Other components

- **Portal user**
- **SMTP service**

## Connections

- Portal user → Flask application: uses (evidence: `README.md`)
- Flask application → Document upload: registers routes (evidence: `app.py`)
- Flask application → Approval queue: registers routes (evidence: `app.py`)
- Flask application → Library browsing: registers routes (evidence: `app.py`)
- Document upload → Document records: saves documents (evidence: `routes/upload_routes.py`)
- Document upload → Category records: categorizes uploads (evidence: `routes/upload_routes.py`)
- Document upload → Email delivery: sends approval email (evidence: `routes/upload_routes.py`)
- Approval queue → Document records: loads documents (evidence: `routes/approval_routes.py`)
- Approval queue → Email delivery: sends review request (evidence: `routes/approval_routes.py`)
- Approval queue → User store: loads recipients (evidence: `routes/approval_routes.py`)
- Library browsing → Library assembly: assembles library (evidence: `routes/document_library_routes.py`)
- Library browsing → Document records: loads documents (evidence: `routes/document_library_routes.py`)
- Library assembly → Category records: queries categories (evidence: `services/document_library_service.py`)
- Library assembly → Library definitions: uses definitions (evidence: `services/document_library_service.py`)
- Dashboard and exports → Document records: loads documents (evidence: `routes/dashboard_routes.py`)
- Dashboard and exports → Library assembly: queries library (evidence: `routes/dashboard_routes.py`)
- Dashboard and exports → Document previews: requests previews (evidence: `routes/dashboard_routes.py`)
- Approval tracking → Document records: tracks approvals
- Reports and audit views → Document records: reports documents (evidence: `routes/graphics_report_routes.py`)
- Reports and audit views → Library assembly: reports library (evidence: `routes/graphics_report_routes.py`)
- Specialized record browsers → Document records: browses records
- Accounts and profiles → Access control: authenticates users
- Access control → User store: looks up users (evidence: `services/auth_service.py`)
- Notifications → Email delivery: sends notifications (evidence: `routes/notification_routes.py`)
- Notifications → Quarterly reminders: triggers reminders (evidence: `routes/notification_routes.py`)
- Archive → Document records: manages archived records
- Document records → Application database: reads and writes (evidence: `services/document_service.py`)
- Category records → Application database: queries categories (evidence: `services/category_document_service.py`)
- User store → Application database: reads and writes (evidence: `services/user_store_service.py`)
- System audit log → Application database: writes audit entries (evidence: `services/system_log_service.py`)
- Library assembly → Customer data: normalizes customer names (evidence: `services/document_library_service.py`)
- Library assembly → Plant and department data: normalizes plant data (evidence: `services/document_library_service.py`)
- Email delivery → SMTP service: delivers email (evidence: `README.md`)
- Portal user → Approval tracking: views progress (evidence: `README.md`)
- Portal user → Dashboard and exports: browses and exports (evidence: `README.md`)
- Portal user → Reports and audit views: reviews reports (evidence: `README.md`)
