# tarun-suthar-04/order-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/tarun-suthar-04/order-analyzer
- Repository: https://github.com/tarun-suthar-04/order-analyzer

## Overview

Order Analyzer is an Android app for recording a shop’s daily retailer orders and calculating product demand, plus a separate spreadsheet analyzer for Amul orders. The main workflow is sign-in (optional for local spreadsheet analysis), manage product and retailer catalogs, enter retailer quantities, then review totals, bills, history, and pending orders. Daily orders use local SQLite and can sync through Firebase; the Amul workflow parses selected Excel/CSV files and summarizes them by vehicle and retailer. Several screen-level links are based on the README or source-index references because their implementations were not excerpted.

Main entry points: [`app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java) (Daily orders dashboard), [`app/src/main/java/com/orderanalyzer/db/DailyOrderRepository.java`](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/db/DailyOrderRepository.java) (Order repository), [`app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java`](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java) (Amul orders screen), [`app/src/main/java/com/orderanalyzer/AddRetailerOrderActivity.java`](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AddRetailerOrderActivity.java) (Retailer order entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Shop access"]
  node_login["Login<br/>[LoginActivity.java]"]
  node_auth["Shop authentication"]
end

subgraph group_daily["Daily ordering"]
  node_dashboard["Daily orders dashboard"]
  node_orderentry["Retailer order entry"]
  node_products["Product management"]
  node_retailers["Retailer management"]
  node_addretailer["Add retailer"]
  node_today["Today’s retailers"]
  node_pending["Pending orders"]
  node_totals["Product totals"]
  node_history["Order history"]
  node_detail["Order bill detail"]
  node_profile["Shop profile"]
end

subgraph group_storage["Local data and sync"]
  node_domainmodels["Order and catalog models<br/>[DailyOrder.java]"]
  node_repository["Order repository"]
  node_sqlite[("SQLite database")]
  node_sync["Cloud sync"]
  node_syncstatus["Sync status<br/>[SyncStatus.java]"]
end

subgraph group_amul["Amul analysis"]
  node_amulhome["Amul orders screen"]
  node_excel["Excel parser<br/>[ExcelParser.java]"]
  node_csv["CSV parser<br/>[CsvParser.java]"]
  node_rowmodel["Imported order rows<br/>[OrderRow.java]"]
  node_processor["Order summarizer<br/>[DataProcessor.java]"]
  node_amulresults["Vehicle and retailer results"]
  node_amulmain["App navigation<br/>[MainActivity.java]"]
end

node_shopper(("Shop user"))
node_firebase[("Firebase services")]
node_file["Selected spreadsheet"]

node_shopper -->|"signs in"| node_login
node_login -->|"authenticates"| node_auth
node_login -->|"opens after login"| node_dashboard
node_shopper -->|"records orders"| node_dashboard
node_dashboard -->|"opens entry"| node_orderentry
node_dashboard -->|"opens management"| node_products
node_dashboard -->|"opens management"| node_retailers
node_dashboard -->|"opens view"| node_today
node_dashboard -->|"opens view"| node_pending
node_dashboard -->|"opens totals"| node_totals
node_dashboard -->|"opens history"| node_history
node_dashboard -->|"opens profile"| node_profile
node_orderentry -->|"adds retailer"| node_addretailer
node_orderentry -->|"saves order"| node_repository
node_orderentry -->|"edits order data"| node_domainmodels
node_products -.->|"manages catalog"| node_repository
node_retailers -.->|"manages catalog"| node_repository
node_today -.->|"reads orders"| node_repository
node_pending -.->|"reads pending"| node_repository
node_totals -.->|"reads totals"| node_repository
node_history -.->|"reads history"| node_repository
node_history -.->|"opens bill"| node_detail
node_detail -->|"loads order"| node_repository
node_repository -->|"uses database"| node_sqlite
node_repository -->|"uploads changes"| node_sync
node_sync -->|"applies remote data"| node_repository
node_sync -->|"syncs shop data"| node_firebase
node_auth -->|"signs in"| node_firebase
node_sync -->|"updates status"| node_syncstatus
node_shopper -->|"opens analyzer"| node_amulmain
node_amulmain -.->|"opens screen"| node_amulhome
node_shopper -->|"chooses file"| node_file
node_amulhome -->|"reads selection"| node_file
node_amulhome -->|"parses Excel"| node_excel
node_amulhome -->|"parses CSV"| node_csv
node_excel -->|"creates rows"| node_rowmodel
node_csv -->|"creates rows"| node_rowmodel
node_amulhome -->|"summarizes rows"| node_processor
node_processor -->|"processes rows"| node_rowmodel
node_amulhome -->|"displays summaries"| node_amulresults

click node_login "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/LoginActivity.java"
click node_auth "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/firebase/FirebaseShopAuthManager.java"
click node_dashboard "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java"
click node_orderentry "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AddRetailerOrderActivity.java"
click node_products "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/ProductsManagementActivity.java"
click node_retailers "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/RetailersManagementActivity.java"
click node_addretailer "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AddRetailerActivity.java"
click node_today "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/TodayRetailersActivity.java"
click node_pending "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/PendingOrdersActivity.java"
click node_totals "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/ProductTotalsActivity.java"
click node_history "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/OrderHistoryActivity.java"
click node_detail "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/RetailerOrderDetailActivity.java"
click node_profile "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/ShopProfileActivity.java"
click node_domainmodels "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/model/DailyOrder.java"
click node_repository "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/db/DailyOrderRepository.java"
click node_sqlite "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/db/DailyOrderDbHelper.java"
click node_sync "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/firebase/FirebaseSyncManager.java"
click node_syncstatus "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/firebase/SyncStatus.java"
click node_amulhome "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java"
click node_excel "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/parser/ExcelParser.java"
click node_csv "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/parser/CsvParser.java"
click node_rowmodel "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/model/OrderRow.java"
click node_processor "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/utils/DataProcessor.java"
click node_amulresults "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java"
click node_amulmain "https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/MainActivity.java"

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_login,node_auth,node_shopper toneBlue
class node_dashboard,node_orderentry,node_products,node_retailers,node_addretailer,node_today,node_pending,node_totals,node_history,node_detail,node_profile,node_firebase toneAmber
class node_domainmodels,node_repository,node_sqlite,node_sync,node_syncstatus toneMint
class node_amulhome,node_excel,node_csv,node_rowmodel,node_processor,node_amulresults,node_amulmain toneRose
class node_file toneIndigo
```

## Components

### Shop access

- [Login](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/LoginActivity.java): `app/src/main/java/com/orderanalyzer/LoginActivity.java`
- [Shop authentication](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/firebase/FirebaseShopAuthManager.java): `app/src/main/java/com/orderanalyzer/firebase/FirebaseShopAuthManager.java`

### Daily ordering

- [Daily orders dashboard](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java): `app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`
- [Retailer order entry](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AddRetailerOrderActivity.java): `app/src/main/java/com/orderanalyzer/AddRetailerOrderActivity.java`
- [Product management](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/ProductsManagementActivity.java): `app/src/main/java/com/orderanalyzer/ProductsManagementActivity.java`
- [Retailer management](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/RetailersManagementActivity.java): `app/src/main/java/com/orderanalyzer/RetailersManagementActivity.java`
- [Add retailer](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AddRetailerActivity.java): `app/src/main/java/com/orderanalyzer/AddRetailerActivity.java`
- [Today’s retailers](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/TodayRetailersActivity.java): `app/src/main/java/com/orderanalyzer/TodayRetailersActivity.java`
- [Pending orders](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/PendingOrdersActivity.java): `app/src/main/java/com/orderanalyzer/PendingOrdersActivity.java`
- [Product totals](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/ProductTotalsActivity.java): `app/src/main/java/com/orderanalyzer/ProductTotalsActivity.java`
- [Order history](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/OrderHistoryActivity.java): `app/src/main/java/com/orderanalyzer/OrderHistoryActivity.java`
- [Order bill detail](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/RetailerOrderDetailActivity.java): `app/src/main/java/com/orderanalyzer/RetailerOrderDetailActivity.java`
- [Shop profile](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/ShopProfileActivity.java): `app/src/main/java/com/orderanalyzer/ShopProfileActivity.java`

### Local data and sync

- [Order and catalog models](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/model/DailyOrder.java): `app/src/main/java/com/orderanalyzer/model/DailyOrder.java`
- [Order repository](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/db/DailyOrderRepository.java): `app/src/main/java/com/orderanalyzer/db/DailyOrderRepository.java`
- [SQLite database](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/db/DailyOrderDbHelper.java): `app/src/main/java/com/orderanalyzer/db/DailyOrderDbHelper.java`
- [Cloud sync](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/firebase/FirebaseSyncManager.java): `app/src/main/java/com/orderanalyzer/firebase/FirebaseSyncManager.java`
- [Sync status](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/firebase/SyncStatus.java): `app/src/main/java/com/orderanalyzer/firebase/SyncStatus.java`

### Amul analysis

- [Amul orders screen](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java): `app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java`
- [Excel parser](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/parser/ExcelParser.java): `app/src/main/java/com/orderanalyzer/parser/ExcelParser.java`
- [CSV parser](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/parser/CsvParser.java): `app/src/main/java/com/orderanalyzer/parser/CsvParser.java`
- [Imported order rows](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/model/OrderRow.java): `app/src/main/java/com/orderanalyzer/model/OrderRow.java`
- [Order summarizer](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/utils/DataProcessor.java): `app/src/main/java/com/orderanalyzer/utils/DataProcessor.java`
- [Vehicle and retailer results](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java): `app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java`
- [App navigation](https://github.com/tarun-suthar-04/order-analyzer/blob/main/app/src/main/java/com/orderanalyzer/MainActivity.java): `app/src/main/java/com/orderanalyzer/MainActivity.java`

### Other components

- **Shop user**
- **Firebase services**
- **Selected spreadsheet**

## Connections

- Shop user → Login: signs in
- Login → Shop authentication: authenticates (evidence: `app/src/main/java/com/orderanalyzer/LoginActivity.java`)
- Login → Daily orders dashboard: opens after login (evidence: `app/src/main/java/com/orderanalyzer/LoginActivity.java`)
- Shop user → Daily orders dashboard: records orders
- Daily orders dashboard → Retailer order entry: opens entry (evidence: `app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`)
- Daily orders dashboard → Product management: opens management (evidence: `app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`)
- Daily orders dashboard → Retailer management: opens management (evidence: `app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`)
- Daily orders dashboard → Today’s retailers: opens view (evidence: `app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`)
- Daily orders dashboard → Pending orders: opens view (evidence: `app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`)
- Daily orders dashboard → Product totals: opens totals (evidence: `app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`)
- Daily orders dashboard → Order history: opens history (evidence: `app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`)
- Daily orders dashboard → Shop profile: opens profile (evidence: `app/src/main/java/com/orderanalyzer/DailyProductOrdersActivity.java`)
- Retailer order entry → Add retailer: adds retailer (evidence: `app/src/main/java/com/orderanalyzer/AddRetailerOrderActivity.java`)
- Retailer order entry → Order repository: saves order (evidence: `app/src/main/java/com/orderanalyzer/AddRetailerOrderActivity.java`)
- Retailer order entry → Order and catalog models: edits order data (evidence: `app/src/main/java/com/orderanalyzer/AddRetailerOrderActivity.java`)
- Product management → Order repository: manages catalog (evidence: `app/src/main/java/com/orderanalyzer/ProductsManagementActivity.java`)
- Retailer management → Order repository: manages catalog (evidence: `app/src/main/java/com/orderanalyzer/RetailersManagementActivity.java`)
- Today’s retailers → Order repository: reads orders (evidence: `app/src/main/java/com/orderanalyzer/TodayRetailersActivity.java`)
- Pending orders → Order repository: reads pending (evidence: `app/src/main/java/com/orderanalyzer/PendingOrdersActivity.java`)
- Product totals → Order repository: reads totals (evidence: `app/src/main/java/com/orderanalyzer/ProductTotalsActivity.java`)
- Order history → Order repository: reads history (evidence: `app/src/main/java/com/orderanalyzer/OrderHistoryActivity.java`)
- Order history → Order bill detail: opens bill
- Order bill detail → Order repository: loads order (evidence: `app/src/main/java/com/orderanalyzer/RetailerOrderDetailActivity.java`)
- Order repository → SQLite database: uses database (evidence: `app/src/main/java/com/orderanalyzer/db/DailyOrderRepository.java`)
- Order repository → Cloud sync: uploads changes (evidence: `app/src/main/java/com/orderanalyzer/db/DailyOrderRepository.java`)
- Cloud sync → Order repository: applies remote data (evidence: `app/src/main/java/com/orderanalyzer/firebase/FirebaseSyncManager.java`)
- Cloud sync → Firebase services: syncs shop data
- Shop authentication → Firebase services: signs in (evidence: `app/src/main/java/com/orderanalyzer/firebase/FirebaseShopAuthManager.java`)
- Cloud sync → Sync status: updates status (evidence: `app/src/main/java/com/orderanalyzer/firebase/FirebaseSyncManager.java`)
- Shop user → App navigation: opens analyzer
- App navigation → Amul orders screen: opens screen
- Shop user → Selected spreadsheet: chooses file
- Amul orders screen → Selected spreadsheet: reads selection (evidence: `app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java`)
- Amul orders screen → Excel parser: parses Excel (evidence: `app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java`)
- Amul orders screen → CSV parser: parses CSV (evidence: `app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java`)
- Excel parser → Imported order rows: creates rows (evidence: `app/src/main/java/com/orderanalyzer/parser/ExcelParser.java`)
- CSV parser → Imported order rows: creates rows (evidence: `app/src/main/java/com/orderanalyzer/parser/CsvParser.java`)
- Amul orders screen → Order summarizer: summarizes rows (evidence: `app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java`)
- Order summarizer → Imported order rows: processes rows (evidence: `app/src/main/java/com/orderanalyzer/utils/DataProcessor.java`)
- Amul orders screen → Vehicle and retailer results: displays summaries (evidence: `app/src/main/java/com/orderanalyzer/AmulMilkOrdersActivity.java`)
