# averoseee/receiptapp architecture

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

- Interactive diagram: https://gitdiagram.com/averoseee/receiptapp
- Repository: https://github.com/averoseee/receiptapp

## Overview

DokumenUsaha is an offline, single-business desktop administration app. The main workflow starts at the Flet UI, where users manage business details, customers, catalog items, invoices, and quotations; invoice drafts can be created directly, while quotations have draft and status-related service capabilities. Services validate and calculate document data, repositories persist it in SQLite, and the database layer initializes and migrates the store. The README describes payment rules as database-only and PDF/export as unavailable. Some view/service wiring is inferred from documented capabilities; unsampled internals are not expanded.

Main entry points: [`main.py`](https://github.com/averoseee/receiptapp/blob/development/main.py) (App entry), [`app/services/invoice_service.py`](https://github.com/averoseee/receiptapp/blob/development/app/services/invoice_service.py) (Invoice service), [`app/services/quotation_service.py`](https://github.com/averoseee/receiptapp/blob/development/app/services/quotation_service.py) (Quotation service), [`app/database/database.py`](https://github.com/averoseee/receiptapp/blob/development/app/database/database.py) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_entry["App entry<br/>[main.py]"]
  node_profile_view["Profile page"]
  node_customer_view["Customer page<br/>[customer_view.py]"]
  node_catalog_view["Catalog page<br/>[catalog_view.py]"]
  node_invoice_view["Invoice page<br/>[invoice_view.py]"]
  node_quotation_view["Quotation page<br/>[quotation_view.py]"]
end

subgraph group_business["Business records"]
  node_profile_service["Profile service"]
  node_profile_repo["Profile repository"]
  node_image_service["Business images"]
  node_customer_service["Customer service"]
  node_customer_repo["Customer repository"]
  node_catalog_service["Catalog service<br/>[catalog_service.py]"]
  node_catalog_repo["Catalog repository"]
end

subgraph group_documents["Documents"]
  node_invoice_service["Invoice service<br/>[invoice_service.py]"]
  node_invoice_repo["Invoice repository"]
  node_quotation_service["Quotation service"]
  node_quotation_repo["Quotation repository"]
  node_calculator["Document calculator"]
  node_number_service["Number service"]
  node_number_repo["Number repository"]
end

subgraph group_storage["Persistence"]
  node_database[("SQLite database<br/>[database.py]")]
end

node_user(("Business user"))

node_user -->|"uses"| node_entry
node_entry -->|"initializes"| node_database
node_entry -->|"builds"| node_profile_view
node_entry -->|"builds"| node_customer_view
node_entry -->|"builds"| node_catalog_view
node_entry -->|"builds"| node_invoice_view
node_entry -->|"builds"| node_quotation_view
node_user -->|"edits profile"| node_profile_view
node_user -->|"manages customers"| node_customer_view
node_user -->|"manages catalog"| node_catalog_view
node_user -->|"creates drafts"| node_invoice_view
node_user -->|"manages quotations"| node_quotation_view
node_profile_view -->|"submits profile"| node_profile_service
node_profile_service -->|"reads and writes"| node_profile_repo
node_image_service -->|"reads and saves profile"| node_profile_service
node_profile_view -->|"saves images"| node_image_service
node_customer_view -->|"manages records"| node_customer_service
node_customer_service -->|"reads and writes"| node_customer_repo
node_catalog_view -->|"manages items"| node_catalog_service
node_catalog_service -->|"reads and writes"| node_catalog_repo
node_invoice_view -->|"requests operations"| node_invoice_service
node_invoice_service -->|"reads and writes"| node_invoice_repo
node_invoice_service -->|"calculates totals"| node_calculator
node_invoice_service -->|"checks customer"| node_customer_repo
node_invoice_service -->|"checks catalog"| node_catalog_repo
node_quotation_view -->|"requests operations"| node_quotation_service
node_quotation_service -->|"reads and writes"| node_quotation_repo
node_quotation_service -->|"calculates totals"| node_calculator
node_quotation_service -->|"checks customer"| node_customer_repo
node_quotation_service -->|"checks catalog"| node_catalog_repo
node_invoice_service -->|"allocates number"| node_number_service
node_quotation_service -->|"allocates number"| node_number_service
node_number_service -->|"allocates counter"| node_number_repo
node_profile_repo -->|"queries"| node_database
node_customer_repo -->|"queries"| node_database
node_catalog_repo -->|"queries"| node_database
node_invoice_repo -->|"queries"| node_database
node_quotation_repo -->|"queries"| node_database
node_number_repo -->|"queries"| node_database

click node_entry "https://github.com/averoseee/receiptapp/blob/development/main.py"
click node_profile_view "https://github.com/averoseee/receiptapp/blob/development/app/views/business_profile_view.py"
click node_customer_view "https://github.com/averoseee/receiptapp/blob/development/app/views/customer_view.py"
click node_catalog_view "https://github.com/averoseee/receiptapp/blob/development/app/views/catalog_view.py"
click node_invoice_view "https://github.com/averoseee/receiptapp/blob/development/app/views/invoice_view.py"
click node_quotation_view "https://github.com/averoseee/receiptapp/blob/development/app/views/quotation_view.py"
click node_profile_service "https://github.com/averoseee/receiptapp/blob/development/app/services/business_profile_service.py"
click node_profile_repo "https://github.com/averoseee/receiptapp/blob/development/app/repositories/business_profile_repository.py"
click node_image_service "https://github.com/averoseee/receiptapp/blob/development/app/services/business_image_service.py"
click node_customer_service "https://github.com/averoseee/receiptapp/blob/development/app/services/customer_service.py"
click node_customer_repo "https://github.com/averoseee/receiptapp/blob/development/app/repositories/customer_repository.py"
click node_catalog_service "https://github.com/averoseee/receiptapp/blob/development/app/services/catalog_service.py"
click node_catalog_repo "https://github.com/averoseee/receiptapp/blob/development/app/repositories/catalog_repository.py"
click node_invoice_service "https://github.com/averoseee/receiptapp/blob/development/app/services/invoice_service.py"
click node_invoice_repo "https://github.com/averoseee/receiptapp/blob/development/app/repositories/invoice_repository.py"
click node_quotation_service "https://github.com/averoseee/receiptapp/blob/development/app/services/quotation_service.py"
click node_quotation_repo "https://github.com/averoseee/receiptapp/blob/development/app/repositories/quotation_repository.py"
click node_calculator "https://github.com/averoseee/receiptapp/blob/development/app/services/document_calculator.py"
click node_number_service "https://github.com/averoseee/receiptapp/blob/development/app/services/document_number_service.py"
click node_number_repo "https://github.com/averoseee/receiptapp/blob/development/app/repositories/document_number_repository.py"
click node_database "https://github.com/averoseee/receiptapp/blob/development/app/database/database.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_entry,node_profile_view,node_customer_view,node_catalog_view,node_invoice_view,node_quotation_view,node_user toneBlue
class node_profile_service,node_profile_repo,node_image_service,node_customer_service,node_customer_repo,node_catalog_service,node_catalog_repo toneAmber
class node_invoice_service,node_invoice_repo,node_quotation_service,node_quotation_repo,node_calculator,node_number_service,node_number_repo toneMint
class node_database toneRose
```

## Components

### Desktop interface

- [App entry](https://github.com/averoseee/receiptapp/blob/development/main.py): `main.py`
- [Profile page](https://github.com/averoseee/receiptapp/blob/development/app/views/business_profile_view.py): `app/views/business_profile_view.py`
- [Customer page](https://github.com/averoseee/receiptapp/blob/development/app/views/customer_view.py): `app/views/customer_view.py`
- [Catalog page](https://github.com/averoseee/receiptapp/blob/development/app/views/catalog_view.py): `app/views/catalog_view.py`
- [Invoice page](https://github.com/averoseee/receiptapp/blob/development/app/views/invoice_view.py): `app/views/invoice_view.py`
- [Quotation page](https://github.com/averoseee/receiptapp/blob/development/app/views/quotation_view.py): `app/views/quotation_view.py`

### Business records

- [Profile service](https://github.com/averoseee/receiptapp/blob/development/app/services/business_profile_service.py): `app/services/business_profile_service.py`
- [Profile repository](https://github.com/averoseee/receiptapp/blob/development/app/repositories/business_profile_repository.py): `app/repositories/business_profile_repository.py`
- [Business images](https://github.com/averoseee/receiptapp/blob/development/app/services/business_image_service.py): `app/services/business_image_service.py`
- [Customer service](https://github.com/averoseee/receiptapp/blob/development/app/services/customer_service.py): `app/services/customer_service.py`
- [Customer repository](https://github.com/averoseee/receiptapp/blob/development/app/repositories/customer_repository.py): `app/repositories/customer_repository.py`
- [Catalog service](https://github.com/averoseee/receiptapp/blob/development/app/services/catalog_service.py): `app/services/catalog_service.py`
- [Catalog repository](https://github.com/averoseee/receiptapp/blob/development/app/repositories/catalog_repository.py): `app/repositories/catalog_repository.py`

### Documents

- [Invoice service](https://github.com/averoseee/receiptapp/blob/development/app/services/invoice_service.py): `app/services/invoice_service.py`
- [Invoice repository](https://github.com/averoseee/receiptapp/blob/development/app/repositories/invoice_repository.py): `app/repositories/invoice_repository.py`
- [Quotation service](https://github.com/averoseee/receiptapp/blob/development/app/services/quotation_service.py): `app/services/quotation_service.py`
- [Quotation repository](https://github.com/averoseee/receiptapp/blob/development/app/repositories/quotation_repository.py): `app/repositories/quotation_repository.py`
- [Document calculator](https://github.com/averoseee/receiptapp/blob/development/app/services/document_calculator.py): `app/services/document_calculator.py`
- [Number service](https://github.com/averoseee/receiptapp/blob/development/app/services/document_number_service.py): `app/services/document_number_service.py`
- [Number repository](https://github.com/averoseee/receiptapp/blob/development/app/repositories/document_number_repository.py): `app/repositories/document_number_repository.py`

### Persistence

- [SQLite database](https://github.com/averoseee/receiptapp/blob/development/app/database/database.py): `app/database/database.py`

### Other components

- **Business user**

## Connections

- Business user → App entry: uses
- App entry → SQLite database: initializes
- App entry → Profile page: builds
- App entry → Customer page: builds
- App entry → Catalog page: builds
- App entry → Invoice page: builds
- App entry → Quotation page: builds
- Business user → Profile page: edits profile
- Business user → Customer page: manages customers
- Business user → Catalog page: manages catalog
- Business user → Invoice page: creates drafts
- Business user → Quotation page: manages quotations
- Profile page → Profile service: submits profile
- Profile service → Profile repository: reads and writes
- Business images → Profile service: reads and saves profile
- Profile page → Business images: saves images
- Customer page → Customer service: manages records
- Customer service → Customer repository: reads and writes
- Catalog page → Catalog service: manages items
- Catalog service → Catalog repository: reads and writes
- Invoice page → Invoice service: requests operations
- Invoice service → Invoice repository: reads and writes
- Invoice service → Document calculator: calculates totals
- Invoice service → Customer repository: checks customer
- Invoice service → Catalog repository: checks catalog
- Quotation page → Quotation service: requests operations
- Quotation service → Quotation repository: reads and writes
- Quotation service → Document calculator: calculates totals
- Quotation service → Customer repository: checks customer
- Quotation service → Catalog repository: checks catalog
- Invoice service → Number service: allocates number
- Quotation service → Number service: allocates number
- Number service → Number repository: allocates counter
- Profile repository → SQLite database: queries
- Customer repository → SQLite database: queries
- Catalog repository → SQLite database: queries
- Invoice repository → SQLite database: queries
- Quotation repository → SQLite database: queries
- Number repository → SQLite database: queries
