# metrixast/tcp-bpm architecture

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

- Interactive diagram: https://gitdiagram.com/metrixast/tcp-bpm
- Repository: https://github.com/metrixast/tcp-bpm

## Overview

TCP-BPM is a Django business-process portal organized around accounts and domain apps for documents, finance, HR, procurement, tenants, reporting, and related operations. A principal documented runtime flow is document handling: users browse and filter available documents, inspect a document’s actions, create or edit it, and submit an action that updates its status. The repository also contains a 1C integration and asynchronous push notifications. The README provides no capability detail, and most app implementations were not sampled; those areas are represented at app level, with uncertain connections omitted.

Main entry points: [`backend/apps/documents/services.py`](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/documents/services.py) (Document services), [`backend/apps/account/tasks.py`](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/tasks.py) (Push task), [`backend/apps/onec/legacy_client.py`](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/onec/legacy_client.py) (Legacy 1C sync), [`backend/apps/account/views.py`](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/views.py) (Account views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts and access"]
  node_account_views["Account views<br/>[views.py]"]
  node_account_models[("Account records<br/>[models.py]")]
  node_permissions["Role permissions"]
end

subgraph group_workflow["Document workflow"]
  node_documents_service["Document services<br/>[services.py]"]
  node_document_models[("Document records<br/>[models.py]")]
  node_document_forms["Document forms<br/>[forms.py]"]
  node_document_rules["Document types and statuses<br/>[enums.py]"]
end

subgraph group_business["Business operations"]
  node_purchases["Purchases<br/>[views.py]"]
  node_requisitions["Requisitions<br/>[views.py]"]
  node_finance["Finance<br/>[views.py]"]
  node_hr["Human resources<br/>[views.py]"]
  node_tenants["Tenants<br/>[views.py]"]
  node_ecopark["Ecopark<br/>[views.py]"]
  node_addits["Additional records<br/>[views.py]"]
  node_tasks["Task management<br/>[views.py]"]
end

subgraph group_integration["Integrations and alerts"]
  node_notification_task["Push task<br/>[tasks.py]"]
  node_onec_client["1C API client<br/>[client.py]"]
  node_onec_legacy["Legacy 1C sync<br/>[legacy_client.py]"]
  node_onec_models[("1C data records<br/>[models.py]")]
end

subgraph group_insight["Dashboards and reports"]
  node_dashboard["Dashboard<br/>[views.py]"]
  node_reports["Reports<br/>[views.py]"]
end

node_user(("Portal user"))
node_fcm["Firebase Cloud Messaging"]
node_onec_api["1C service"]

node_user -->|"uses account"| node_account_views
node_account_views -->|"reads and writes"| node_account_models
node_user -->|"browses and submits"| node_documents_service
node_documents_service -->|"queries and saves"| node_document_models
node_documents_service -->|"validates input"| node_document_forms
node_documents_service -->|"checks type and status"| node_document_rules
node_documents_service -->|"checks access"| node_permissions
node_notification_task -->|"reads and creates"| node_account_models
node_notification_task -->|"sends push"| node_fcm
node_onec_client -.->|"requests data"| node_onec_api
node_onec_legacy -.->|"fetches records"| node_onec_api
node_onec_legacy -->|"updates remnants"| node_onec_models

click node_account_views "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/views.py"
click node_account_models "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/models.py"
click node_notification_task "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/tasks.py"
click node_documents_service "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/documents/services.py"
click node_document_models "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/documents/models.py"
click node_document_forms "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/documents/forms.py"
click node_document_rules "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/documents/enums.py"
click node_permissions "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/role_permissions.py"
click node_purchases "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/purchases/views.py"
click node_requisitions "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/requistions/views.py"
click node_finance "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/finances/views.py"
click node_hr "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/hr/views.py"
click node_tenants "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/tenants/views.py"
click node_ecopark "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/ecopark/views.py"
click node_addits "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/addits/views.py"
click node_tasks "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/tasks/views.py"
click node_dashboard "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/dashboard/views.py"
click node_reports "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/reports/views.py"
click node_onec_client "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/onec/client_1c/client.py"
click node_onec_legacy "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/onec/legacy_client.py"
click node_onec_models "https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/onec/models.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_account_models,node_permissions,node_user toneBlue
class node_documents_service,node_document_models,node_document_forms,node_document_rules toneAmber
class node_purchases,node_requisitions,node_finance,node_hr,node_tenants,node_ecopark,node_addits,node_tasks toneMint
class node_notification_task,node_onec_client,node_onec_legacy,node_onec_models toneRose
class node_dashboard,node_reports,node_fcm,node_onec_api toneIndigo
```

## Components

### Accounts and access

- [Account views](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/views.py): `backend/apps/account/views.py`
- [Account records](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/models.py): `backend/apps/account/models.py`
- [Role permissions](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/role_permissions.py): `backend/apps/account/role_permissions.py`

### Document workflow

- [Document services](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/documents/services.py): `backend/apps/documents/services.py`
- [Document records](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/documents/models.py): `backend/apps/documents/models.py`
- [Document forms](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/documents/forms.py): `backend/apps/documents/forms.py`
- [Document types and statuses](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/documents/enums.py): `backend/apps/documents/enums.py`

### Business operations

- [Purchases](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/purchases/views.py): `backend/apps/purchases/views.py`
- [Requisitions](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/requistions/views.py): `backend/apps/requistions/views.py`
- [Finance](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/finances/views.py): `backend/apps/finances/views.py`
- [Human resources](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/hr/views.py): `backend/apps/hr/views.py`
- [Tenants](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/tenants/views.py): `backend/apps/tenants/views.py`
- [Ecopark](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/ecopark/views.py): `backend/apps/ecopark/views.py`
- [Additional records](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/addits/views.py): `backend/apps/addits/views.py`
- [Task management](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/tasks/views.py): `backend/apps/tasks/views.py`

### Integrations and alerts

- [Push task](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/account/tasks.py): `backend/apps/account/tasks.py`
- [1C API client](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/onec/client_1c/client.py): `backend/apps/onec/client_1c/client.py`
- [Legacy 1C sync](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/onec/legacy_client.py): `backend/apps/onec/legacy_client.py`
- [1C data records](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/onec/models.py): `backend/apps/onec/models.py`

### Dashboards and reports

- [Dashboard](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/dashboard/views.py): `backend/apps/dashboard/views.py`
- [Reports](https://github.com/metrixast/tcp-bpm/blob/main/backend/apps/reports/views.py): `backend/apps/reports/views.py`

### Other components

- **Portal user**
- **Firebase Cloud Messaging**
- **1C service**

## Connections

- Portal user → Account views: uses account
- Account views → Account records: reads and writes
- Portal user → Document services: browses and submits
- Document services → Document records: queries and saves
- Document services → Document forms: validates input
- Document services → Document types and statuses: checks type and status
- Document services → Role permissions: checks access
- Push task → Account records: reads and creates
- Push task → Firebase Cloud Messaging: sends push
- 1C API client → 1C service: requests data
- Legacy 1C sync → 1C service: fetches records
- Legacy 1C sync → 1C data records: updates remnants
