# meji87/labtrack architecture

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

- Interactive diagram: https://gitdiagram.com/meji87/labtrack
- Repository: https://github.com/meji87/labtrack

## Overview

LabTrack is a desktop laboratory inventory and procurement application. Staff sign in, then use its views to manage products and suppliers, create and email purchase orders, record receptions with PDF paperwork, track stock movements, and review alerts or dashboard summaries. Administration manages users and categories. The views operate on SQLAlchemy models stored in SQLite; shared view infrastructure and helpers support the workflows. The README is empty, so capabilities and relationships here are based on the supplied source excerpts and source index; unsampled implementation details are not assumed.

Main entry points: [`main.py`](https://github.com/meji87/labtrack/blob/main/main.py) (App shell), [`database.py`](https://github.com/meji87/labtrack/blob/main/database.py) (Models and sessions), [`views/receptions_view.py`](https://github.com/meji87/labtrack/blob/main/views/receptions_view.py) (Order receptions), [`utils/helpers.py`](https://github.com/meji87/labtrack/blob/main/utils/helpers.py) (Inventory and document helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_app["App shell<br/>[main.py]"]
  node_login["Sign in<br/>[login_view.py]"]
  node_dashboard["Dashboard<br/>[dashboard_view.py]"]
  node_admin["Users and categories<br/>[admin_view.py]"]
end

subgraph group_inventory["Inventory operations"]
  node_products["Product catalog<br/>[products_view.py]"]
  node_movements["Stock movements<br/>[movements_view.py]"]
  node_alerts["Stock and expiry alerts<br/>[alerts_view.py]"]
end

subgraph group_procurement["Procurement"]
  node_suppliers["Supplier management<br/>[suppliers_view.py]"]
  node_orders["Purchase orders<br/>[orders_view.py]"]
  node_receptions["Order receptions<br/>[receptions_view.py]"]
end

subgraph group_platform["Data and shared services"]
  node_email["Email service<br/>[email_utils.py]"]
  node_helpers["Inventory and document helpers<br/>[helpers.py]"]
  node_base["Shared view framework<br/>[base_view.py]"]
  node_config["Application configuration<br/>[config.py]"]
  node_database["Models and sessions<br/>[database.py]"]
  node_sqlite[("SQLite database<br/>[labstock.db]")]
end

node_staff(("Lab staff"))
node_smtp["SMTP server"]

node_staff -->|"launches"| node_app
node_app -->|"shows"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_products
node_app -->|"routes to"| node_suppliers
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_receptions
node_app -->|"routes to"| node_movements
node_app -->|"routes to"| node_alerts
node_app -->|"routes to"| node_admin
node_app -->|"initializes"| node_database
node_app -.->|"uses"| node_base
node_login -->|"authenticates with"| node_database
node_dashboard -->|"queries"| node_database
node_dashboard -->|"summarizes alerts"| node_helpers
node_products -->|"reads and updates"| node_database
node_movements -->|"records and queries"| node_database
node_alerts -->|"uses alert summary"| node_helpers
node_alerts -.->|"queries"| node_database
node_suppliers -->|"reads and updates"| node_database
node_orders -->|"creates and queries"| node_database
node_orders -->|"sends order"| node_email
node_receptions -->|"records reception"| node_database
node_receptions -->|"stores and opens PDFs"| node_helpers
node_receptions -.->|"sends confirmation"| node_email
node_email -->|"sends mail"| node_smtp
node_helpers -->|"uses document path"| node_config
node_database -->|"uses database path"| node_config
node_database -.->|"persists data"| node_sqlite

click node_app "https://github.com/meji87/labtrack/blob/main/main.py"
click node_login "https://github.com/meji87/labtrack/blob/main/views/login_view.py"
click node_dashboard "https://github.com/meji87/labtrack/blob/main/views/dashboard_view.py"
click node_admin "https://github.com/meji87/labtrack/blob/main/views/admin_view.py"
click node_products "https://github.com/meji87/labtrack/blob/main/views/products_view.py"
click node_movements "https://github.com/meji87/labtrack/blob/main/views/movements_view.py"
click node_alerts "https://github.com/meji87/labtrack/blob/main/views/alerts_view.py"
click node_suppliers "https://github.com/meji87/labtrack/blob/main/views/suppliers_view.py"
click node_orders "https://github.com/meji87/labtrack/blob/main/views/orders_view.py"
click node_receptions "https://github.com/meji87/labtrack/blob/main/views/receptions_view.py"
click node_email "https://github.com/meji87/labtrack/blob/main/utils/email_utils.py"
click node_helpers "https://github.com/meji87/labtrack/blob/main/utils/helpers.py"
click node_base "https://github.com/meji87/labtrack/blob/main/views/base_view.py"
click node_config "https://github.com/meji87/labtrack/blob/main/config.py"
click node_database "https://github.com/meji87/labtrack/blob/main/database.py"
click node_sqlite "https://github.com/meji87/labtrack/blob/main/labstock.db"

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_login,node_dashboard,node_admin toneBlue
class node_products,node_movements,node_alerts toneAmber
class node_suppliers,node_orders,node_receptions,node_smtp toneMint
class node_email,node_helpers,node_base,node_config,node_database,node_sqlite toneRose
class node_staff toneIndigo
```

## Components

### Desktop application

- [App shell](https://github.com/meji87/labtrack/blob/main/main.py): `main.py`
- [Sign in](https://github.com/meji87/labtrack/blob/main/views/login_view.py): `views/login_view.py`
- [Dashboard](https://github.com/meji87/labtrack/blob/main/views/dashboard_view.py): `views/dashboard_view.py`
- [Users and categories](https://github.com/meji87/labtrack/blob/main/views/admin_view.py): `views/admin_view.py`

### Inventory operations

- [Product catalog](https://github.com/meji87/labtrack/blob/main/views/products_view.py): `views/products_view.py`
- [Stock movements](https://github.com/meji87/labtrack/blob/main/views/movements_view.py): `views/movements_view.py`
- [Stock and expiry alerts](https://github.com/meji87/labtrack/blob/main/views/alerts_view.py): `views/alerts_view.py`

### Procurement

- [Supplier management](https://github.com/meji87/labtrack/blob/main/views/suppliers_view.py): `views/suppliers_view.py`
- [Purchase orders](https://github.com/meji87/labtrack/blob/main/views/orders_view.py): `views/orders_view.py`
- [Order receptions](https://github.com/meji87/labtrack/blob/main/views/receptions_view.py): `views/receptions_view.py`

### Data and shared services

- [Email service](https://github.com/meji87/labtrack/blob/main/utils/email_utils.py): `utils/email_utils.py`
- [Inventory and document helpers](https://github.com/meji87/labtrack/blob/main/utils/helpers.py): `utils/helpers.py`
- [Shared view framework](https://github.com/meji87/labtrack/blob/main/views/base_view.py): `views/base_view.py`
- [Application configuration](https://github.com/meji87/labtrack/blob/main/config.py): `config.py`
- [Models and sessions](https://github.com/meji87/labtrack/blob/main/database.py): `database.py`
- [SQLite database](https://github.com/meji87/labtrack/blob/main/labstock.db): `labstock.db`

### Other components

- **Lab staff**
- **SMTP server**

## Connections

- Lab staff → App shell: launches (evidence: `main.py`)
- App shell → Sign in: shows (evidence: `main.py`)
- App shell → Dashboard: routes to (evidence: `main.py`)
- App shell → Product catalog: routes to (evidence: `main.py`)
- App shell → Supplier management: routes to (evidence: `main.py`)
- App shell → Purchase orders: routes to (evidence: `main.py`)
- App shell → Order receptions: routes to (evidence: `main.py`)
- App shell → Stock movements: routes to (evidence: `main.py`)
- App shell → Stock and expiry alerts: routes to (evidence: `main.py`)
- App shell → Users and categories: routes to (evidence: `main.py`)
- App shell → Models and sessions: initializes (evidence: `main.py`)
- App shell → Shared view framework: uses
- Sign in → Models and sessions: authenticates with (evidence: `views/login_view.py`)
- Dashboard → Models and sessions: queries (evidence: `views/dashboard_view.py`)
- Dashboard → Inventory and document helpers: summarizes alerts (evidence: `views/dashboard_view.py`)
- Product catalog → Models and sessions: reads and updates (evidence: `views/products_view.py`)
- Stock movements → Models and sessions: records and queries (evidence: `views/movements_view.py`)
- Stock and expiry alerts → Inventory and document helpers: uses alert summary (evidence: `views/alerts_view.py`)
- Stock and expiry alerts → Models and sessions: queries
- Supplier management → Models and sessions: reads and updates (evidence: `views/suppliers_view.py`)
- Purchase orders → Models and sessions: creates and queries (evidence: `views/orders_view.py`)
- Purchase orders → Email service: sends order (evidence: `views/orders_view.py`)
- Order receptions → Models and sessions: records reception (evidence: `views/receptions_view.py`)
- Order receptions → Inventory and document helpers: stores and opens PDFs (evidence: `views/receptions_view.py`)
- Order receptions → Email service: sends confirmation (evidence: `views/receptions_view.py`)
- Email service → SMTP server: sends mail (evidence: `utils/email_utils.py`)
- Inventory and document helpers → Application configuration: uses document path (evidence: `utils/helpers.py`)
- Models and sessions → Application configuration: uses database path (evidence: `database.py`)
- Models and sessions → SQLite database: persists data
