# it-leadic/asset-management architecture

> Architecture diagram of the GitHub repository it-leadic/asset-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/it-leadic/asset-management
- Repository: https://github.com/it-leadic/asset-management

## Overview

This repository is a small IT asset-management application with a Flask web interface and separate command-line workflows for QR labels and printable label sheets. The principal user flow is an administrator logging in, viewing the asset dashboard, and editing an assignment; a public QR scan resolves to asset details. The web app obtains workbook data from SharePoint, while the standalone scripts generate QR images and PDFs from the local workbook. The README gives no further feature detail, and the excerpts do not establish links between the web app and the SQLite utilities.

Main entry points: [`app.py`](https://github.com/it-leadic/asset-management/blob/main/app.py) (Web routes and views), [`IT_Assets.xlsx`](https://github.com/it-leadic/asset-management/blob/main/IT_Assets.xlsx) (Asset workbook), [`generate_qr.py`](https://github.com/it-leadic/asset-management/blob/main/generate_qr.py) (QR label generation), [`generate_labels.py`](https://github.com/it-leadic/asset-management/blob/main/generate_labels.py) (A4 PDF layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Asset web app"]
  node_flask["Web routes and views<br/>[app.py]"]
  node_sharepoint[("SharePoint workbook")]
  node_azure["Microsoft identity"]
end

subgraph group_labels["Label production"]
  node_qr_make["QR label generation<br/>[generate_qr.py]"]
  node_qr_images["QR label images"]
  node_new_list["New QR file list<br/>[new_qr_files.txt]"]
  node_pdf_make["A4 PDF layout<br/>[generate_labels.py]"]
  node_pdf_output["Printable label PDF"]
end

subgraph group_localdata["Local asset data"]
  node_workbook["Asset workbook<br/>[IT_Assets.xlsx]"]
  node_sqlite_setup["SQLite initialization<br/>[database.py]"]
  node_sqlite_sync["Add new assets"]
  node_asset_db[("SQLite asset database<br/>[assets.db]")]
end

node_admin(("Administrator"))
node_scanner(("QR scanner user"))

node_admin -->|"uses dashboard"| node_flask
node_flask -.->|"authenticates with"| node_azure
node_flask -->|"downloads and updates"| node_sharepoint
node_scanner -->|"opens asset page"| node_flask
node_workbook -->|"supplies rows"| node_sqlite_setup
node_sqlite_setup -->|"creates and fills"| node_asset_db
node_workbook -->|"supplies rows"| node_sqlite_sync
node_sqlite_sync -->|"inserts new assets"| node_asset_db
node_workbook -->|"supplies asset IDs"| node_qr_make
node_qr_make -->|"writes images"| node_qr_images
node_qr_make -->|"records generated files"| node_new_list
node_new_list -->|"selects new labels"| node_pdf_make
node_qr_images -->|"supplies label images"| node_pdf_make
node_pdf_make -->|"writes PDF"| node_pdf_output

click node_flask "https://github.com/it-leadic/asset-management/blob/main/app.py"
click node_workbook "https://github.com/it-leadic/asset-management/blob/main/IT_Assets.xlsx"
click node_sqlite_setup "https://github.com/it-leadic/asset-management/blob/main/database.py"
click node_sqlite_sync "https://github.com/it-leadic/asset-management/blob/main/import_new_assets.py"
click node_asset_db "https://github.com/it-leadic/asset-management/blob/main/assets.db"
click node_qr_make "https://github.com/it-leadic/asset-management/blob/main/generate_qr.py"
click node_new_list "https://github.com/it-leadic/asset-management/blob/main/new_qr_files.txt"
click node_pdf_make "https://github.com/it-leadic/asset-management/blob/main/generate_labels.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_sharepoint,node_azure,node_scanner toneBlue
class node_qr_make,node_qr_images,node_new_list,node_pdf_make,node_pdf_output toneAmber
class node_workbook,node_sqlite_setup,node_sqlite_sync,node_asset_db toneMint
class node_admin toneIndigo
```

## Components

### Asset web app

- [Web routes and views](https://github.com/it-leadic/asset-management/blob/main/app.py): `app.py`
- **SharePoint workbook**
- **Microsoft identity**

### Label production

- [QR label generation](https://github.com/it-leadic/asset-management/blob/main/generate_qr.py): `generate_qr.py`
- **QR label images**
- [New QR file list](https://github.com/it-leadic/asset-management/blob/main/new_qr_files.txt): `new_qr_files.txt`
- [A4 PDF layout](https://github.com/it-leadic/asset-management/blob/main/generate_labels.py): `generate_labels.py`
- **Printable label PDF**

### Local asset data

- [Asset workbook](https://github.com/it-leadic/asset-management/blob/main/IT_Assets.xlsx): `IT_Assets.xlsx`
- [SQLite initialization](https://github.com/it-leadic/asset-management/blob/main/database.py): `database.py`
- [Add new assets](https://github.com/it-leadic/asset-management/blob/main/import_new_assets.py): `import_new_assets.py`
- [SQLite asset database](https://github.com/it-leadic/asset-management/blob/main/assets.db): `assets.db`

### Other components

- **Administrator**
- **QR scanner user**

## Connections

- Administrator → Web routes and views: uses dashboard (evidence: `app.py`)
- Web routes and views → Microsoft identity: authenticates with
- Web routes and views → SharePoint workbook: downloads and updates (evidence: `app.py`)
- QR scanner user → Web routes and views: opens asset page
- Asset workbook → SQLite initialization: supplies rows (evidence: `database.py`)
- SQLite initialization → SQLite asset database: creates and fills (evidence: `database.py`)
- Asset workbook → Add new assets: supplies rows (evidence: `import_new_assets.py`)
- Add new assets → SQLite asset database: inserts new assets (evidence: `import_new_assets.py`)
- Asset workbook → QR label generation: supplies asset IDs (evidence: `generate_qr.py`)
- QR label generation → QR label images: writes images (evidence: `generate_qr.py`)
- QR label generation → New QR file list: records generated files (evidence: `generate_qr.py`)
- New QR file list → A4 PDF layout: selects new labels (evidence: `generate_labels.py`)
- QR label images → A4 PDF layout: supplies label images (evidence: `generate_labels.py`)
- A4 PDF layout → Printable label PDF: writes PDF (evidence: `generate_labels.py`)
