# moonglade-07/eatup-sales-tracker architecture

> Architecture diagram of the GitHub repository moonglade-07/eatup-sales-tracker, 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/moonglade-07/eatup-sales-tracker
- Repository: https://github.com/moonglade-07/eatup-sales-tracker

## Overview

EatUp is an offline-first Android sales tracker backed by Room, with Google Sheets sync and spreadsheet-side accounting. The main workflow is recording orders, reviewing sales and profit, then syncing or exporting business data. The README documents the product capabilities and broad architecture; Android implementation files were not sampled, so internal app call edges are omitted where their ownership cannot be verified.

Main entry points: [`app/src/main/java/com/example/myapplication/ui/screens/Screens.kt`](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/ui/screens/Screens.kt) (Sales Screens), [`app/src/main/java/com/example/myapplication/ui/viewmodel/SalesViewModel.kt`](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/ui/viewmodel/SalesViewModel.kt) (Sales State), [`app/src/main/java/com/example/myapplication/data/repository/SalesRepository.kt`](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/repository/SalesRepository.kt) (Sales Repository), [`app/src/main/java/com/example/myapplication/data/local/AppDatabase.kt`](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/local/AppDatabase.kt) (Local Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sales["Sales Management"]
  node_screens["Sales Screens<br/>[Screens.kt]"]
  node_viewmodel["Sales State<br/>[SalesViewModel.kt]"]
  node_repository["Sales Repository<br/>[SalesRepository.kt]"]
  node_database[("Local Database<br/>[AppDatabase.kt]")]
  node_entities["Sales Records<br/>[Entities.kt]"]
  node_dao["Sales Queries<br/>[SalesDao.kt]"]
end

subgraph group_insights["Analytics"]
  node_analytics["Growth Analytics"]
end

subgraph group_sync["Cloud Sync"]
  node_sheets["Sheets API Client"]
  node_worker["Background Sync<br/>[SyncWorker.kt]"]
  node_spreadsheet[("Google Sheets")]
end

subgraph group_accounting["Accounting Tools"]
  node_script["Accounting Script"]
end

subgraph group_platform["App Platform"]
  node_activity["App Entry<br/>[MainActivity.kt]"]
  node_export["Data Export<br/>[ExportService.kt]"]
  node_updates["App Updates<br/>[UpdateManager.kt]"]
end

node_owner(("Business Owner"))

node_owner -->|"opens app"| node_activity
node_activity -.->|"presents UI"| node_screens
node_screens -.->|"uses state"| node_viewmodel
node_viewmodel -.->|"requests sales"| node_repository
node_repository -.->|"queries sales"| node_dao
node_dao -.->|"reads and writes"| node_database
node_database -.->|"stores records"| node_entities
node_owner -->|"records orders"| node_screens
node_owner -->|"reviews insights"| node_analytics
node_owner -.->|"exports data"| node_export
node_worker -.->|"syncs data"| node_sheets
node_sheets -->|"transfers records"| node_spreadsheet
node_spreadsheet -->|"runs accounting"| node_script
node_owner -->|"uses sheet tools"| node_script
node_owner -.->|"manages updates"| node_updates

click node_activity "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/MainActivity.kt"
click node_screens "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/ui/screens/Screens.kt"
click node_viewmodel "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/ui/viewmodel/SalesViewModel.kt"
click node_repository "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/repository/SalesRepository.kt"
click node_database "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/local/AppDatabase.kt"
click node_entities "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/local/Entities.kt"
click node_dao "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/local/SalesDao.kt"
click node_analytics "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/ui/components/AnalyticsComponents.kt"
click node_sheets "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/remote/SheetsApiService.kt"
click node_worker "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/remote/SyncWorker.kt"
click node_script "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/GOOGLE_APPS_SCRIPT.js"
click node_export "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/util/ExportService.kt"
click node_updates "https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/util/UpdateManager.kt"

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_screens,node_viewmodel,node_repository,node_database,node_entities,node_dao toneBlue
class node_analytics toneAmber
class node_sheets,node_worker,node_spreadsheet toneMint
class node_script toneRose
class node_activity,node_export,node_updates,node_owner toneIndigo
```

## Components

### Sales Management

- [Sales Screens](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/ui/screens/Screens.kt): `app/src/main/java/com/example/myapplication/ui/screens/Screens.kt`
- [Sales State](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/ui/viewmodel/SalesViewModel.kt): `app/src/main/java/com/example/myapplication/ui/viewmodel/SalesViewModel.kt`
- [Sales Repository](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/repository/SalesRepository.kt): `app/src/main/java/com/example/myapplication/data/repository/SalesRepository.kt`
- [Local Database](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/local/AppDatabase.kt): `app/src/main/java/com/example/myapplication/data/local/AppDatabase.kt`
- [Sales Records](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/local/Entities.kt): `app/src/main/java/com/example/myapplication/data/local/Entities.kt`
- [Sales Queries](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/local/SalesDao.kt): `app/src/main/java/com/example/myapplication/data/local/SalesDao.kt`

### Analytics

- [Growth Analytics](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/ui/components/AnalyticsComponents.kt): `app/src/main/java/com/example/myapplication/ui/components/AnalyticsComponents.kt`

### Cloud Sync

- [Sheets API Client](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/remote/SheetsApiService.kt): `app/src/main/java/com/example/myapplication/data/remote/SheetsApiService.kt`
- [Background Sync](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/data/remote/SyncWorker.kt): `app/src/main/java/com/example/myapplication/data/remote/SyncWorker.kt`
- **Google Sheets**

### Accounting Tools

- [Accounting Script](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/GOOGLE_APPS_SCRIPT.js): `GOOGLE_APPS_SCRIPT.js`

### App Platform

- [App Entry](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/MainActivity.kt): `app/src/main/java/com/example/myapplication/MainActivity.kt`
- [Data Export](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/util/ExportService.kt): `app/src/main/java/com/example/myapplication/util/ExportService.kt`
- [App Updates](https://github.com/moonglade-07/eatup-sales-tracker/blob/main/app/src/main/java/com/example/myapplication/util/UpdateManager.kt): `app/src/main/java/com/example/myapplication/util/UpdateManager.kt`

### Other components

- **Business Owner**

## Connections

- Business Owner → App Entry: opens app (evidence: `README.md`)
- App Entry → Sales Screens: presents UI
- Sales Screens → Sales State: uses state
- Sales State → Sales Repository: requests sales
- Sales Repository → Sales Queries: queries sales
- Sales Queries → Local Database: reads and writes
- Local Database → Sales Records: stores records
- Business Owner → Sales Screens: records orders (evidence: `README.md`)
- Business Owner → Growth Analytics: reviews insights (evidence: `README.md`)
- Business Owner → Data Export: exports data
- Background Sync → Sheets API Client: syncs data
- Sheets API Client → Google Sheets: transfers records (evidence: `README.md`)
- Google Sheets → Accounting Script: runs accounting (evidence: `README.md`)
- Business Owner → Accounting Script: uses sheet tools (evidence: `GOOGLE_APPS_SCRIPT.js`)
- Business Owner → App Updates: manages updates
