# w1ztechsolutions/trackwise architecture

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

- Interactive diagram: https://gitdiagram.com/w1ztechsolutions/trackwise
- Repository: https://github.com/w1ztechsolutions/trackwise

## Overview

TrackWise is a multi-tenant SME business-management platform centered on double-entry accounting. A user enters through the Flask application, works in a business area such as sales or purchasing, and financial activity is recorded in the ledger; users can then review operational and financial reports. The README also documents inventory/FIFO, production, bank reconciliation, approvals, imports, subscriptions, and role-based access. Source excerpts are partial, so some documented subsystem links are shown as unverified rather than asserted as direct calls.

Main entry points: [`app/models/accounting.py`](https://github.com/w1ztechsolutions/trackwise/blob/main/app/models/accounting.py) (Business data models), [`app/services/accounting_service.py`](https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/accounting_service.py) (Accounting service), [`app/accounting/routes.py`](https://github.com/w1ztechsolutions/trackwise/blob/main/app/accounting/routes.py) (Accounting and journals), [`app/reports/routes.py`](https://github.com/w1ztechsolutions/trackwise/blob/main/app/reports/routes.py) (Financial reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application access"]
  node_flask["Flask application<br/>[__init__.py]"]
  node_dashboard["Dashboard<br/>[routes.py]"]
end

subgraph group_operations["Business operations"]
  node_sales["Sales and invoices<br/>[routes.py]"]
  node_purchases["Purchases and bills<br/>[routes.py]"]
  node_inventory["Inventory management<br/>[routes.py]"]
  node_fifo["FIFO costing<br/>[fifo_service.py]"]
  node_production["Production tracking<br/>[routes.py]"]
end

subgraph group_finance["Accounting and controls"]
  node_approvals["Approval workflows<br/>[routes.py]"]
  node_accounting["Accounting and journals<br/>[routes.py]"]
  node_ledger["Accounting service"]
  node_reconciliation["Bank reconciliation"]
  node_audit["Audit and period controls<br/>[audit_service.py]"]
end

subgraph group_insights["Reporting and imports"]
  node_reports["Financial reports<br/>[routes.py]"]
  node_report_generators["Report generators"]
  node_budget["Budget management<br/>[budget_service.py]"]
  node_imports["Financial imports<br/>[import_service.py]"]
  node_xlsx["Spreadsheet import and export<br/>[xlsx_import.py]"]
end

subgraph group_platform["Identity and persistence"]
  node_auth["Authentication and RBAC<br/>[routes.py]"]
  node_settings["Business settings<br/>[routes.py]"]
  node_superadmin["Platform administration<br/>[routes.py]"]
  node_models[("Business data models<br/>[accounting.py]")]
end

node_user(("Business user"))

node_user -->|"uses"| node_flask
node_flask -.->|"serves"| node_auth
node_flask -.->|"serves"| node_dashboard
node_dashboard -->|"uses"| node_budget
node_dashboard -->|"uses"| node_report_generators
node_sales -->|"uses"| node_fifo
node_sales -->|"posts entries"| node_ledger
node_sales -->|"stages imports"| node_imports
node_purchases -->|"uses"| node_fifo
node_purchases -->|"posts entries"| node_ledger
node_purchases -->|"stages imports"| node_imports
node_inventory -->|"uses"| node_fifo
node_inventory -->|"reads and writes"| node_models
node_production -->|"reads and writes"| node_models
node_approvals -->|"executes approved entries"| node_ledger
node_accounting -->|"posts entries"| node_ledger
node_accounting -->|"uses"| node_reconciliation
node_accounting -->|"uses"| node_imports
node_accounting -->|"records actions"| node_audit
node_ledger -->|"persists journals"| node_models
node_audit -->|"writes audit logs"| node_models
node_reports -->|"requests reports"| node_report_generators
node_reports -->|"uses"| node_budget
node_reports -->|"uses"| node_audit
node_reports -->|"exports workbooks"| node_xlsx
node_imports -->|"parses workbooks"| node_xlsx
node_auth -->|"loads identity"| node_models
node_settings -->|"reads and writes"| node_models
node_superadmin -->|"manages platform data"| node_models

click node_flask "https://github.com/w1ztechsolutions/trackwise/blob/main/app/__init__.py"
click node_auth "https://github.com/w1ztechsolutions/trackwise/blob/main/app/auth/routes.py"
click node_dashboard "https://github.com/w1ztechsolutions/trackwise/blob/main/app/dashboard/routes.py"
click node_sales "https://github.com/w1ztechsolutions/trackwise/blob/main/app/sales/routes.py"
click node_purchases "https://github.com/w1ztechsolutions/trackwise/blob/main/app/purchases/routes.py"
click node_inventory "https://github.com/w1ztechsolutions/trackwise/blob/main/app/inventory/routes.py"
click node_fifo "https://github.com/w1ztechsolutions/trackwise/blob/main/services/fifo_service.py"
click node_production "https://github.com/w1ztechsolutions/trackwise/blob/main/app/production/routes.py"
click node_approvals "https://github.com/w1ztechsolutions/trackwise/blob/main/app/approvals/routes.py"
click node_accounting "https://github.com/w1ztechsolutions/trackwise/blob/main/app/accounting/routes.py"
click node_ledger "https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/accounting_service.py"
click node_reconciliation "https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/reconciliation_period_service.py"
click node_audit "https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/audit_service.py"
click node_reports "https://github.com/w1ztechsolutions/trackwise/blob/main/app/reports/routes.py"
click node_report_generators "https://github.com/w1ztechsolutions/trackwise/tree/main/app/services/reports"
click node_budget "https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/budget_service.py"
click node_imports "https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/import_service.py"
click node_xlsx "https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/xlsx_import.py"
click node_settings "https://github.com/w1ztechsolutions/trackwise/blob/main/app/settings/routes.py"
click node_superadmin "https://github.com/w1ztechsolutions/trackwise/blob/main/app/superadmin/routes.py"
click node_models "https://github.com/w1ztechsolutions/trackwise/blob/main/app/models/accounting.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_flask,node_dashboard,node_user toneBlue
class node_sales,node_purchases,node_inventory,node_fifo,node_production toneAmber
class node_approvals,node_accounting,node_ledger,node_reconciliation,node_audit toneMint
class node_reports,node_report_generators,node_budget,node_imports,node_xlsx toneRose
class node_auth,node_settings,node_superadmin,node_models toneIndigo
```

## Components

### Application access

- [Flask application](https://github.com/w1ztechsolutions/trackwise/blob/main/app/__init__.py): `app/__init__.py`
- [Dashboard](https://github.com/w1ztechsolutions/trackwise/blob/main/app/dashboard/routes.py): `app/dashboard/routes.py`

### Business operations

- [Sales and invoices](https://github.com/w1ztechsolutions/trackwise/blob/main/app/sales/routes.py): `app/sales/routes.py`
- [Purchases and bills](https://github.com/w1ztechsolutions/trackwise/blob/main/app/purchases/routes.py): `app/purchases/routes.py`
- [Inventory management](https://github.com/w1ztechsolutions/trackwise/blob/main/app/inventory/routes.py): `app/inventory/routes.py`
- [FIFO costing](https://github.com/w1ztechsolutions/trackwise/blob/main/services/fifo_service.py): `services/fifo_service.py`
- [Production tracking](https://github.com/w1ztechsolutions/trackwise/blob/main/app/production/routes.py): `app/production/routes.py`

### Accounting and controls

- [Approval workflows](https://github.com/w1ztechsolutions/trackwise/blob/main/app/approvals/routes.py): `app/approvals/routes.py`
- [Accounting and journals](https://github.com/w1ztechsolutions/trackwise/blob/main/app/accounting/routes.py): `app/accounting/routes.py`
- [Accounting service](https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/accounting_service.py): `app/services/accounting_service.py`
- [Bank reconciliation](https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/reconciliation_period_service.py): `app/services/reconciliation_period_service.py`
- [Audit and period controls](https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/audit_service.py): `app/services/audit_service.py`

### Reporting and imports

- [Financial reports](https://github.com/w1ztechsolutions/trackwise/blob/main/app/reports/routes.py): `app/reports/routes.py`
- [Report generators](https://github.com/w1ztechsolutions/trackwise/tree/main/app/services/reports): `app/services/reports`
- [Budget management](https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/budget_service.py): `app/services/budget_service.py`
- [Financial imports](https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/import_service.py): `app/services/import_service.py`
- [Spreadsheet import and export](https://github.com/w1ztechsolutions/trackwise/blob/main/app/services/xlsx_import.py): `app/services/xlsx_import.py`

### Identity and persistence

- [Authentication and RBAC](https://github.com/w1ztechsolutions/trackwise/blob/main/app/auth/routes.py): `app/auth/routes.py`
- [Business settings](https://github.com/w1ztechsolutions/trackwise/blob/main/app/settings/routes.py): `app/settings/routes.py`
- [Platform administration](https://github.com/w1ztechsolutions/trackwise/blob/main/app/superadmin/routes.py): `app/superadmin/routes.py`
- [Business data models](https://github.com/w1ztechsolutions/trackwise/blob/main/app/models/accounting.py): `app/models/accounting.py`

### Other components

- **Business user**

## Connections

- Business user → Flask application: uses
- Flask application → Authentication and RBAC: serves
- Flask application → Dashboard: serves
- Dashboard → Budget management: uses (evidence: `app/dashboard/routes.py`)
- Dashboard → Report generators: uses (evidence: `app/dashboard/routes.py`)
- Sales and invoices → FIFO costing: uses (evidence: `app/sales/routes.py`)
- Sales and invoices → Accounting service: posts entries (evidence: `app/sales/routes.py`)
- Sales and invoices → Financial imports: stages imports (evidence: `app/sales/routes.py`)
- Purchases and bills → FIFO costing: uses (evidence: `app/purchases/routes.py`)
- Purchases and bills → Accounting service: posts entries (evidence: `app/purchases/routes.py`)
- Purchases and bills → Financial imports: stages imports (evidence: `app/purchases/routes.py`)
- Inventory management → FIFO costing: uses (evidence: `app/inventory/routes.py`)
- Inventory management → Business data models: reads and writes (evidence: `app/inventory/routes.py`)
- Production tracking → Business data models: reads and writes (evidence: `app/production/routes.py`)
- Approval workflows → Accounting service: executes approved entries (evidence: `app/approvals/routes.py`)
- Accounting and journals → Accounting service: posts entries (evidence: `app/accounting/routes.py`)
- Accounting and journals → Bank reconciliation: uses (evidence: `app/accounting/routes.py`)
- Accounting and journals → Financial imports: uses (evidence: `app/accounting/routes.py`)
- Accounting and journals → Audit and period controls: records actions (evidence: `app/accounting/routes.py`)
- Accounting service → Business data models: persists journals (evidence: `app/services/accounting_service.py`)
- Audit and period controls → Business data models: writes audit logs (evidence: `app/services/audit_service.py`)
- Financial reports → Report generators: requests reports (evidence: `app/reports/routes.py`)
- Financial reports → Budget management: uses (evidence: `app/reports/routes.py`)
- Financial reports → Audit and period controls: uses (evidence: `app/reports/routes.py`)
- Financial reports → Spreadsheet import and export: exports workbooks (evidence: `app/reports/routes.py`)
- Financial imports → Spreadsheet import and export: parses workbooks (evidence: `app/services/import_service.py`)
- Authentication and RBAC → Business data models: loads identity (evidence: `app/auth/routes.py`)
- Business settings → Business data models: reads and writes (evidence: `app/settings/routes.py`)
- Platform administration → Business data models: manages platform data (evidence: `app/superadmin/routes.py`)
