# ragavendra0604/atomid architecture

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

- Interactive diagram: https://gitdiagram.com/ragavendra0604/atomid
- Repository: https://github.com/ragavendra0604/atomid

## Overview

Atomid is an offline-first, cross-platform retail POS. The principal workflow is an operator action that updates local Hive data, queues the change, and synchronizes it with Firestore when connectivity returns; signing in also supports pulling store history. The graph preserves the README’s billing, inventory, CRM, reporting/export, tax/loyalty, hardware, and sync capabilities. Dart implementation excerpts were not provided, so internal links beyond documented sync behavior are left unasserted or marked unverified.

Main entry points: [`lib/data/repositories/storage_repository.dart`](https://github.com/ragavendra0604/atomid/blob/main/lib/data/repositories/storage_repository.dart) (Hive local storage), [`lib/presentation/features/billing`](https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/billing) (POS and billing), [`lib/domain/services/sync_service.dart`](https://github.com/ragavendra0604/atomid/blob/main/lib/domain/services/sync_service.dart) (Sync service), [`lib/data/repositories/firebase_repository.dart`](https://github.com/ragavendra0604/atomid/blob/main/lib/data/repositories/firebase_repository.dart) (Firebase repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App composition"]
  node_bootstrap["App bootstrap<br/>[bootstrap.dart]"]
  node_providers["State providers"]
end

subgraph group_retail["Retail workflows"]
  node_pos["POS and billing"]
  node_inventory["Inventory management"]
  node_customers["Customer CRM"]
  node_purchases["Purchases"]
  node_reports["Dashboard and reports"]
  node_settings["Tax and loyalty settings"]
end

subgraph group_domain["Business logic"]
  node_pricing["Pricing and GST<br/>[pricing.dart]"]
  node_sales_service["Sales service<br/>[sale_service.dart]"]
  node_sync_service["Sync service<br/>[sync_service.dart]"]
end

subgraph group_data["Persistence and sync"]
  node_models["Retail data models"]
  node_local_store[("Hive local storage")]
  node_sync_queue["Sync queue"]
  node_codec["Entity codec<br/>[entity_codec.dart]"]
  node_firebase_repo["Firebase repository"]
end

subgraph group_services["Device and cloud"]
  node_hardware["Retail hardware"]
  node_export["PDF export"]
  node_firestore[("Cloud Firestore")]
  node_connectivity["Connectivity"]
  node_auth["Firebase Auth"]
end

node_operator(("Shop operator"))

node_operator -->|"uses"| node_pos
node_pos -->|"writes locally"| node_local_store
node_local_store -->|"queues writes"| node_sync_queue
node_sync_service -.->|"uploads queued data"| node_sync_queue
node_sync_service -.->|"dispatches sync"| node_firebase_repo
node_firebase_repo -->|"syncs data"| node_firestore
node_auth -->|"gates cloud sync"| node_sync_service
node_sync_service -.->|"waits for connectivity"| node_connectivity
node_inventory -.->|"records stock"| node_local_store
node_customers -.->|"stores customer data"| node_local_store
node_purchases -.->|"stores purchases"| node_local_store
node_reports -.->|"exports documents"| node_export
node_pos -.->|"calculates totals"| node_pricing
node_pos -.->|"records sales"| node_sales_service
node_pos -.->|"scans and prints"| node_hardware
node_bootstrap -.->|"composes app"| node_providers
node_local_store -.->|"persists entities"| node_models
node_sync_service -.->|"encodes entities"| node_codec

click node_bootstrap "https://github.com/ragavendra0604/atomid/blob/main/lib/bootstrap.dart"
click node_providers "https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/providers"
click node_pos "https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/billing"
click node_inventory "https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/inventory"
click node_customers "https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/customers"
click node_purchases "https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/purchases"
click node_reports "https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/reports"
click node_settings "https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/settings"
click node_pricing "https://github.com/ragavendra0604/atomid/blob/main/lib/domain/pricing.dart"
click node_sales_service "https://github.com/ragavendra0604/atomid/blob/main/lib/domain/services/sale_service.dart"
click node_sync_service "https://github.com/ragavendra0604/atomid/blob/main/lib/domain/services/sync_service.dart"
click node_models "https://github.com/ragavendra0604/atomid/tree/main/lib/data/models"
click node_local_store "https://github.com/ragavendra0604/atomid/blob/main/lib/data/repositories/storage_repository.dart"
click node_sync_queue "https://github.com/ragavendra0604/atomid/blob/main/lib/data/models/sync_queue_model.dart"
click node_codec "https://github.com/ragavendra0604/atomid/blob/main/lib/data/sync/entity_codec.dart"
click node_firebase_repo "https://github.com/ragavendra0604/atomid/blob/main/lib/data/repositories/firebase_repository.dart"
click node_hardware "https://github.com/ragavendra0604/atomid/tree/main/lib/core/hardware"
click node_export "https://github.com/ragavendra0604/atomid/blob/main/lib/core/services/export_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_bootstrap,node_providers toneBlue
class node_pos,node_inventory,node_customers,node_purchases,node_reports,node_settings toneAmber
class node_pricing,node_sales_service,node_sync_service toneMint
class node_models,node_local_store,node_sync_queue,node_codec,node_firebase_repo toneRose
class node_hardware,node_export,node_firestore,node_connectivity,node_auth,node_operator toneIndigo
```

## Components

### App composition

- [App bootstrap](https://github.com/ragavendra0604/atomid/blob/main/lib/bootstrap.dart): `lib/bootstrap.dart`
- [State providers](https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/providers): `lib/presentation/providers`

### Retail workflows

- [POS and billing](https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/billing): `lib/presentation/features/billing`
- [Inventory management](https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/inventory): `lib/presentation/features/inventory`
- [Customer CRM](https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/customers): `lib/presentation/features/customers`
- [Purchases](https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/purchases): `lib/presentation/features/purchases`
- [Dashboard and reports](https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/reports): `lib/presentation/features/reports`
- [Tax and loyalty settings](https://github.com/ragavendra0604/atomid/tree/main/lib/presentation/features/settings): `lib/presentation/features/settings`

### Business logic

- [Pricing and GST](https://github.com/ragavendra0604/atomid/blob/main/lib/domain/pricing.dart): `lib/domain/pricing.dart`
- [Sales service](https://github.com/ragavendra0604/atomid/blob/main/lib/domain/services/sale_service.dart): `lib/domain/services/sale_service.dart`
- [Sync service](https://github.com/ragavendra0604/atomid/blob/main/lib/domain/services/sync_service.dart): `lib/domain/services/sync_service.dart`

### Persistence and sync

- [Retail data models](https://github.com/ragavendra0604/atomid/tree/main/lib/data/models): `lib/data/models`
- [Hive local storage](https://github.com/ragavendra0604/atomid/blob/main/lib/data/repositories/storage_repository.dart): `lib/data/repositories/storage_repository.dart`
- [Sync queue](https://github.com/ragavendra0604/atomid/blob/main/lib/data/models/sync_queue_model.dart): `lib/data/models/sync_queue_model.dart`
- [Entity codec](https://github.com/ragavendra0604/atomid/blob/main/lib/data/sync/entity_codec.dart): `lib/data/sync/entity_codec.dart`
- [Firebase repository](https://github.com/ragavendra0604/atomid/blob/main/lib/data/repositories/firebase_repository.dart): `lib/data/repositories/firebase_repository.dart`

### Device and cloud

- [Retail hardware](https://github.com/ragavendra0604/atomid/tree/main/lib/core/hardware): `lib/core/hardware`
- [PDF export](https://github.com/ragavendra0604/atomid/blob/main/lib/core/services/export_service.dart): `lib/core/services/export_service.dart`
- **Cloud Firestore**
- **Connectivity**
- **Firebase Auth**

### Other components

- **Shop operator**

## Connections

- Shop operator → POS and billing: uses (evidence: `README.md`)
- POS and billing → Hive local storage: writes locally (evidence: `README.md`)
- Hive local storage → Sync queue: queues writes (evidence: `README.md`)
- Sync service → Sync queue: uploads queued data
- Sync service → Firebase repository: dispatches sync
- Firebase repository → Cloud Firestore: syncs data (evidence: `README.md`)
- Firebase Auth → Sync service: gates cloud sync (evidence: `README.md`)
- Sync service → Connectivity: waits for connectivity
- Inventory management → Hive local storage: records stock
- Customer CRM → Hive local storage: stores customer data
- Purchases → Hive local storage: stores purchases
- Dashboard and reports → PDF export: exports documents
- POS and billing → Pricing and GST: calculates totals
- POS and billing → Sales service: records sales
- POS and billing → Retail hardware: scans and prints
- App bootstrap → State providers: composes app
- Hive local storage → Retail data models: persists entities
- Sync service → Entity codec: encodes entities
