# vianvezo/systemscanprintlocal architecture

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

- Interactive diagram: https://gitdiagram.com/vianvezo/systemscanprintlocal
- Repository: https://github.com/vianvezo/systemscanprintlocal

## Overview

SystemScanPrintLocal is a Flask application for discovering network printers, tracking them by site/network, and reporting device and supply status. Users request a scan; the background scan sweeps the configured range, identifies printer devices, and stores discoveries. Status requests read registered printers, query their embedded web interfaces or SNMP, and return cached results; users can also maintain site and printer records and export supply reports. The source excerpts show these flows, but not the rendered templates or the full scan-task implementation.

Main entry points: [`app.py`](https://github.com/vianvezo/systemscanprintlocal/blob/main/app.py) (Flask routes), [`scraper.py`](https://github.com/vianvezo/systemscanprintlocal/blob/main/scraper.py) (Status and supplies), [`db.py`](https://github.com/vianvezo/systemscanprintlocal/blob/main/db.py) (Record operations), [`scanner.py`](https://github.com/vianvezo/systemscanprintlocal/blob/main/scanner.py) (Network sweep)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask routes<br/>[app.py]"]
  node_scan_task["Background scan<br/>[app.py]"]
  node_report["Spreadsheet export<br/>[app.py]"]
end

subgraph group_discovery["Printer discovery"]
  node_scanner["Network sweep<br/>[scanner.py]"]
  node_detector["Printer identification"]
end

subgraph group_status["Status collection"]
  node_scraper["Status and supplies<br/>[scraper.py]"]
end

subgraph group_data["Configuration and records"]
  node_db_module["Record operations<br/>[db.py]"]
  node_sqlite[("Printer records<br/>[printers.db]")]
  node_config["Scan settings<br/>[config.py]"]
end

node_user(("Operator"))
node_printer_network(("Network printers"))
node_snmp(("SNMP agents"))
node_xlsx["Excel workbook"]

node_user -->|"uses"| node_app
node_app -->|"starts scan"| node_scan_task
node_scan_task -->|"sweeps range"| node_scanner
node_scanner -->|"reads settings"| node_config
node_scanner -->|"probes hosts"| node_printer_network
node_scan_task -->|"identifies hosts"| node_detector
node_detector -->|"checks ports"| node_scanner
node_detector -->|"queries interfaces"| node_printer_network
node_scan_task -->|"stores discoveries"| node_db_module
node_app -->|"manages records"| node_db_module
node_db_module -->|"reads and writes"| node_sqlite
node_app -->|"requests status"| node_scraper
node_scraper -->|"loads printers"| node_db_module
node_scraper -->|"fetches status"| node_printer_network
node_scraper -.->|"queries supplies"| node_snmp
node_app -->|"requests export"| node_report
node_report -->|"gets status"| node_scraper
node_report -->|"loads site details"| node_db_module
node_report -->|"creates workbook"| node_xlsx
node_app -->|"returns API results"| node_user

click node_app "https://github.com/vianvezo/systemscanprintlocal/blob/main/app.py"
click node_scan_task "https://github.com/vianvezo/systemscanprintlocal/blob/main/app.py"
click node_report "https://github.com/vianvezo/systemscanprintlocal/blob/main/app.py"
click node_scanner "https://github.com/vianvezo/systemscanprintlocal/blob/main/scanner.py"
click node_detector "https://github.com/vianvezo/systemscanprintlocal/blob/main/printer_detector.py"
click node_scraper "https://github.com/vianvezo/systemscanprintlocal/blob/main/scraper.py"
click node_db_module "https://github.com/vianvezo/systemscanprintlocal/blob/main/db.py"
click node_sqlite "https://github.com/vianvezo/systemscanprintlocal/blob/main/printers.db"
click node_config "https://github.com/vianvezo/systemscanprintlocal/blob/main/config.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_scan_task,node_report toneBlue
class node_scanner,node_detector toneAmber
class node_scraper toneMint
class node_db_module,node_sqlite,node_config toneRose
class node_user,node_printer_network,node_snmp,node_xlsx toneIndigo
```

## Components

### Web application

- [Flask routes](https://github.com/vianvezo/systemscanprintlocal/blob/main/app.py): `app.py`
- [Background scan](https://github.com/vianvezo/systemscanprintlocal/blob/main/app.py): `app.py`
- [Spreadsheet export](https://github.com/vianvezo/systemscanprintlocal/blob/main/app.py): `app.py`

### Printer discovery

- [Network sweep](https://github.com/vianvezo/systemscanprintlocal/blob/main/scanner.py): `scanner.py`
- [Printer identification](https://github.com/vianvezo/systemscanprintlocal/blob/main/printer_detector.py): `printer_detector.py`

### Status collection

- [Status and supplies](https://github.com/vianvezo/systemscanprintlocal/blob/main/scraper.py): `scraper.py`

### Configuration and records

- [Record operations](https://github.com/vianvezo/systemscanprintlocal/blob/main/db.py): `db.py`
- [Printer records](https://github.com/vianvezo/systemscanprintlocal/blob/main/printers.db): `printers.db`
- [Scan settings](https://github.com/vianvezo/systemscanprintlocal/blob/main/config.py): `config.py`

### Other components

- **Operator**
- **Network printers**
- **SNMP agents**
- **Excel workbook**

## Connections

- Operator → Flask routes: uses
- Flask routes → Background scan: starts scan
- Background scan → Network sweep: sweeps range
- Network sweep → Scan settings: reads settings
- Network sweep → Network printers: probes hosts
- Background scan → Printer identification: identifies hosts
- Printer identification → Network sweep: checks ports
- Printer identification → Network printers: queries interfaces
- Background scan → Record operations: stores discoveries
- Flask routes → Record operations: manages records
- Record operations → Printer records: reads and writes
- Flask routes → Status and supplies: requests status
- Status and supplies → Record operations: loads printers
- Status and supplies → Network printers: fetches status
- Status and supplies → SNMP agents: queries supplies
- Flask routes → Spreadsheet export: requests export
- Spreadsheet export → Status and supplies: gets status
- Spreadsheet export → Record operations: loads site details
- Spreadsheet export → Excel workbook: creates workbook
- Flask routes → Operator: returns API results
