# fmfizzy/laptoppos architecture

> Architecture diagram of the GitHub repository fmfizzy/laptoppos, 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/fmfizzy/laptoppos
- Repository: https://github.com/fmfizzy/laptoppos

## Overview

This is an offline Flask point-of-sale application focused on recording repair jobs and invoicing customers. Staff use its web interface to create and track repairs, prepare invoices, record payments, and review sales; invoices can also be printed as quotations. The sampled routes show the web controller performing database operations and rendering templates. The models define additional quotation data, but the excerpts do not establish its route-level workflow, so that wiring is omitted.

Main entry points: [`app.py`](https://github.com/fmfizzy/laptoppos/blob/main/app.py) (Web workflows), [`app/templates/base.html`](https://github.com/fmfizzy/laptoppos/blob/main/app/templates/base.html) (Shared page layout), [`app/templates`](https://github.com/fmfizzy/laptoppos/tree/main/app/templates) (Repair screens), [`app/templates/sales.html`](https://github.com/fmfizzy/laptoppos/blob/main/app/templates/sales.html) (Sales screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_repair_ui["Repair screens"]
  node_invoice_ui["Invoice screens"]
  node_sales_ui["Sales screen<br/>[sales.html]"]
  node_base_template["Shared page layout<br/>[base.html]"]
end

subgraph group_workflows["Repair and billing"]
  node_routes["Web workflows<br/>[app.py]"]
end

subgraph group_records["Business records"]
  node_repair_records["Repair records<br/>[models.py]"]
  node_invoice_records["Invoice and items<br/>[models.py]"]
  node_customer_records["Customer records<br/>[models.py]"]
  node_sales_records["Sales entries<br/>[models.py]"]
  node_quotation_records["Quotation records<br/>[models.py]"]
  node_job_counter["Job numbering<br/>[models.py]"]
end

subgraph group_runtime["Application runtime"]
  node_database[("SQLite database<br/>[config.py]")]
  node_app_factory["Flask setup<br/>[__init__.py]"]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_routes
node_routes -->|"creates app"| node_app_factory
node_app_factory -->|"initializes tables"| node_database
node_routes -->|"creates and queries"| node_customer_records
node_routes -->|"creates and updates"| node_repair_records
node_routes -->|"allocates numbers"| node_job_counter
node_routes -->|"creates and updates"| node_invoice_records
node_routes -->|"records and queries"| node_sales_records
node_routes -->|"commits records"| node_database
node_routes -->|"renders"| node_repair_ui
node_routes -->|"renders"| node_invoice_ui
node_routes -->|"renders"| node_sales_ui
node_repair_ui -->|"extends"| node_base_template
node_invoice_ui -->|"extends"| node_base_template
node_sales_ui -->|"extends"| node_base_template

click node_routes "https://github.com/fmfizzy/laptoppos/blob/main/app.py"
click node_repair_ui "https://github.com/fmfizzy/laptoppos/tree/main/app/templates"
click node_invoice_ui "https://github.com/fmfizzy/laptoppos/tree/main/app/templates"
click node_sales_ui "https://github.com/fmfizzy/laptoppos/blob/main/app/templates/sales.html"
click node_repair_records "https://github.com/fmfizzy/laptoppos/blob/main/app/models.py"
click node_invoice_records "https://github.com/fmfizzy/laptoppos/blob/main/app/models.py"
click node_customer_records "https://github.com/fmfizzy/laptoppos/blob/main/app/models.py"
click node_sales_records "https://github.com/fmfizzy/laptoppos/blob/main/app/models.py"
click node_quotation_records "https://github.com/fmfizzy/laptoppos/blob/main/app/models.py"
click node_job_counter "https://github.com/fmfizzy/laptoppos/blob/main/app/models.py"
click node_database "https://github.com/fmfizzy/laptoppos/blob/main/config.py"
click node_app_factory "https://github.com/fmfizzy/laptoppos/blob/main/app/__init__.py"
click node_base_template "https://github.com/fmfizzy/laptoppos/blob/main/app/templates/base.html"

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_repair_ui,node_invoice_ui,node_sales_ui,node_base_template,node_staff toneBlue
class node_routes toneAmber
class node_repair_records,node_invoice_records,node_customer_records,node_sales_records,node_quotation_records,node_job_counter toneMint
class node_database,node_app_factory toneRose
```

## Components

### Web interface

- [Repair screens](https://github.com/fmfizzy/laptoppos/tree/main/app/templates): `app/templates`
- [Invoice screens](https://github.com/fmfizzy/laptoppos/tree/main/app/templates): `app/templates`
- [Sales screen](https://github.com/fmfizzy/laptoppos/blob/main/app/templates/sales.html): `app/templates/sales.html`
- [Shared page layout](https://github.com/fmfizzy/laptoppos/blob/main/app/templates/base.html): `app/templates/base.html`

### Repair and billing

- [Web workflows](https://github.com/fmfizzy/laptoppos/blob/main/app.py): `app.py`

### Business records

- [Repair records](https://github.com/fmfizzy/laptoppos/blob/main/app/models.py): `app/models.py`
- [Invoice and items](https://github.com/fmfizzy/laptoppos/blob/main/app/models.py): `app/models.py`
- [Customer records](https://github.com/fmfizzy/laptoppos/blob/main/app/models.py): `app/models.py`
- [Sales entries](https://github.com/fmfizzy/laptoppos/blob/main/app/models.py): `app/models.py`
- [Quotation records](https://github.com/fmfizzy/laptoppos/blob/main/app/models.py): `app/models.py`
- [Job numbering](https://github.com/fmfizzy/laptoppos/blob/main/app/models.py): `app/models.py`

### Application runtime

- [SQLite database](https://github.com/fmfizzy/laptoppos/blob/main/config.py): `config.py`
- [Flask setup](https://github.com/fmfizzy/laptoppos/blob/main/app/__init__.py): `app/__init__.py`

### Other components

- **Staff user**

## Connections

- Staff user → Web workflows: uses
- Web workflows → Flask setup: creates app
- Flask setup → SQLite database: initializes tables
- Web workflows → Customer records: creates and queries
- Web workflows → Repair records: creates and updates
- Web workflows → Job numbering: allocates numbers
- Web workflows → Invoice and items: creates and updates
- Web workflows → Sales entries: records and queries
- Web workflows → SQLite database: commits records
- Web workflows → Repair screens: renders
- Web workflows → Invoice screens: renders
- Web workflows → Sales screen: renders
- Repair screens → Shared page layout: extends
- Invoice screens → Shared page layout: extends
- Sales screen → Shared page layout: extends
