# ayyanarsripath-svg/pro_app architecture

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

- Interactive diagram: https://gitdiagram.com/ayyanarsripath-svg/pro_app
- Repository: https://github.com/ayyanarsripath-svg/pro_app

## Overview

This is an offline-first Flutter business manager for a mobile/laptop repair and second-hand phone shop. The documented user journey starts with first-run admin setup and PIN access, then uses the app to manage customers, repair jobs, inventory, sales, purchases and expenses; owners can review profit and loss and create local or optional Google Drive backups. The README establishes these capabilities and a few user-facing relationships, but no source excerpts were provided, so internal calls and data flows are not asserted.

Main entry points: [`lib/screens/auth/app_access_gate_screen.dart`](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/auth/app_access_gate_screen.dart) (Access gate), [`lib/screens/auth/pin_login_screen.dart`](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/auth/pin_login_screen.dart) (PIN login), [`lib/screens/shell/app_shell.dart`](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/shell/app_shell.dart) (App navigation), [`lib/core/services/backup_service.dart`](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/core/services/backup_service.dart) (Backup and restore)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_gate["Access gate"]
  node_setup["Admin setup"]
  node_pin["PIN login"]
  node_shell["App navigation<br/>[app_shell.dart]"]
  node_dashboard["Business dashboard"]
  node_staff["Staff permissions<br/>[staff_screen.dart]"]
  node_settings["Business settings"]
end

subgraph group_operations["Shop operations"]
  node_customers["Customer records"]
  node_service["Repair jobs"]
  node_inventory["Parts and accessories"]
  node_sales["Sales billing"]
  node_secondhand["Used phone trade"]
  node_suppliers["Supplier purchases"]
end

subgraph group_finance["Finance and records"]
  node_expenses["Expenses"]
  node_pnl["Profit and loss"]
end

subgraph group_platform["Local and external services"]
  node_db[("Offline SQLite")]
  node_backup["Backup and restore"]
  node_drive["Google Drive"]
  node_billing["A5 bill printing<br/>[pdf_service.dart]"]
end

node_user(("Shop staff"))

node_user -->|"opens app"| node_gate
node_gate -->|"first-run setup"| node_setup
node_user -->|"enters PIN"| node_pin
node_pin -->|"grants access"| node_shell
node_shell -->|"opens dashboard"| node_dashboard
node_user -->|"manages job cards"| node_service
node_user -->|"manages customers"| node_customers
node_user -->|"manages stock"| node_inventory
node_user -->|"creates bills"| node_sales
node_user -->|"trades phones"| node_secondhand
node_user -->|"records purchases"| node_suppliers
node_user -->|"records expenses"| node_expenses
node_user -->|"reviews results"| node_pnl
node_user -->|"sets permissions"| node_staff
node_user -->|"prints bills"| node_billing
node_user -->|"starts backup"| node_backup
node_backup -.->|"backs up optionally"| node_drive

click node_gate "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/auth/app_access_gate_screen.dart"
click node_setup "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/auth/first_run_setup_screen.dart"
click node_pin "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/auth/pin_login_screen.dart"
click node_shell "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/shell/app_shell.dart"
click node_dashboard "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/dashboard/dashboard_screen.dart"
click node_customers "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/customers/customer_list_screen.dart"
click node_service "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/services/service_form_screen.dart"
click node_inventory "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/inventory/spare_parts_screen.dart"
click node_sales "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/sales/sales_bill_form_screen.dart"
click node_secondhand "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/second_hand/second_hand_purchase_form_screen.dart"
click node_suppliers "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/suppliers/purchase_form_screen.dart"
click node_expenses "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/expenses/expense_screen.dart"
click node_pnl "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/pnl/pnl_dashboard_screen.dart"
click node_staff "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/settings/staff_screen.dart"
click node_settings "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/settings/settings_screen.dart"
click node_db "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/core/db/database_helper.dart"
click node_backup "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/core/services/backup_service.dart"
click node_billing "https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/core/services/pdf_service.dart"

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_gate,node_setup,node_pin,node_shell,node_dashboard,node_staff,node_settings toneBlue
class node_customers,node_service,node_inventory,node_sales,node_secondhand,node_suppliers toneAmber
class node_expenses,node_pnl toneMint
class node_db,node_backup,node_drive,node_billing toneRose
class node_user toneIndigo
```

## Components

### Access and navigation

- [Access gate](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/auth/app_access_gate_screen.dart): `lib/screens/auth/app_access_gate_screen.dart`
- [Admin setup](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/auth/first_run_setup_screen.dart): `lib/screens/auth/first_run_setup_screen.dart`
- [PIN login](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/auth/pin_login_screen.dart): `lib/screens/auth/pin_login_screen.dart`
- [App navigation](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/shell/app_shell.dart): `lib/screens/shell/app_shell.dart`
- [Business dashboard](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/dashboard/dashboard_screen.dart): `lib/screens/dashboard/dashboard_screen.dart`
- [Staff permissions](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/settings/staff_screen.dart): `lib/screens/settings/staff_screen.dart`
- [Business settings](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/settings/settings_screen.dart): `lib/screens/settings/settings_screen.dart`

### Shop operations

- [Customer records](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/customers/customer_list_screen.dart): `lib/screens/customers/customer_list_screen.dart`
- [Repair jobs](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/services/service_form_screen.dart): `lib/screens/services/service_form_screen.dart`
- [Parts and accessories](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/inventory/spare_parts_screen.dart): `lib/screens/inventory/spare_parts_screen.dart`
- [Sales billing](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/sales/sales_bill_form_screen.dart): `lib/screens/sales/sales_bill_form_screen.dart`
- [Used phone trade](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/second_hand/second_hand_purchase_form_screen.dart): `lib/screens/second_hand/second_hand_purchase_form_screen.dart`
- [Supplier purchases](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/suppliers/purchase_form_screen.dart): `lib/screens/suppliers/purchase_form_screen.dart`

### Finance and records

- [Expenses](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/expenses/expense_screen.dart): `lib/screens/expenses/expense_screen.dart`
- [Profit and loss](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/screens/pnl/pnl_dashboard_screen.dart): `lib/screens/pnl/pnl_dashboard_screen.dart`

### Local and external services

- [Offline SQLite](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/core/db/database_helper.dart): `lib/core/db/database_helper.dart`
- [Backup and restore](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/core/services/backup_service.dart): `lib/core/services/backup_service.dart`
- **Google Drive**
- [A5 bill printing](https://github.com/ayyanarsripath-svg/pro_app/blob/main/lib/core/services/pdf_service.dart): `lib/core/services/pdf_service.dart`

### Other components

- **Shop staff**

## Connections

- Shop staff → Access gate: opens app (evidence: `README.md`)
- Access gate → Admin setup: first-run setup (evidence: `README.md`)
- Shop staff → PIN login: enters PIN (evidence: `README.md`)
- PIN login → App navigation: grants access (evidence: `README.md`)
- App navigation → Business dashboard: opens dashboard (evidence: `README.md`)
- Shop staff → Repair jobs: manages job cards (evidence: `README.md`)
- Shop staff → Customer records: manages customers (evidence: `README.md`)
- Shop staff → Parts and accessories: manages stock (evidence: `README.md`)
- Shop staff → Sales billing: creates bills (evidence: `README.md`)
- Shop staff → Used phone trade: trades phones (evidence: `README.md`)
- Shop staff → Supplier purchases: records purchases (evidence: `README.md`)
- Shop staff → Expenses: records expenses (evidence: `README.md`)
- Shop staff → Profit and loss: reviews results (evidence: `README.md`)
- Shop staff → Staff permissions: sets permissions (evidence: `README.md`)
- Shop staff → A5 bill printing: prints bills (evidence: `README.md`)
- Shop staff → Backup and restore: starts backup (evidence: `README.md`)
- Backup and restore → Google Drive: backs up optionally (evidence: `README.md`)
