# azuliatech/chobo architecture

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

- Interactive diagram: https://gitdiagram.com/azuliatech/chobo
- Repository: https://github.com/azuliatech/chobo

## Overview

Chobo is a mobile-first point-of-sale and store-management product with a NestJS API. The main workflow is staff using the mobile app to manage inventory and record sales locally, then synchronize workspace data with the API; the app also supports accounts, staff workspaces, debts, payments, notifications, and subscriptions. The sampled sync code shows local database access and several API transfers. Some domain modules are represented from the source index and file tree rather than inspected implementation, so uncertain links are omitted.

Main entry points: [`apps/mobile/App.tsx`](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/App.tsx) (App navigation), [`apps/mobile/src/services/syncService.ts`](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/services/syncService.ts) (Data synchronization), [`apps/api/src/prisma/prisma.service.ts`](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/prisma/prisma.service.ts) (PostgreSQL access), [`apps/api/src/sales/sales.service.ts`](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/sales/sales.service.ts) (Sales processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_mobile_app["App navigation<br/>[App.tsx]"]
  node_sales_ui["Sales screens<br/>[SellScreen.tsx]"]
  node_inventory_ui["Inventory screen"]
  node_transaction_ui["Transaction history"]
  node_login_ui["Login screen<br/>[LoginScreen.tsx]"]
  node_currency["Currency settings<br/>[useCurrency.ts]"]
end

subgraph group_identity["Identity and workspace"]
  node_auth_store["Auth state<br/>[authStore.ts]"]
  node_api_auth["Authentication API<br/>[auth.service.ts]"]
  node_auth_guard["JWT guard<br/>[auth.guard.ts]"]
  node_roles_guard["Workspace roles<br/>[roles.guard.ts]"]
  node_workspace["Workspace management"]
end

subgraph group_commerce["Store operations"]
  node_product_api["Product management"]
  node_sales_api["Sales processing<br/>[sales.service.ts]"]
  node_customers_api["Customer records"]
  node_debts_api["Debt tracking<br/>[debts.service.ts]"]
  node_payments_api["Payments"]
end

subgraph group_platform["Data and integrations"]
  node_sync_service["Data synchronization<br/>[syncService.ts]"]
  node_local_db[("Local SQLite<br/>[index.ts]")]
  node_subscription["Subscription service"]
  node_notifications_api["Notifications"]
  node_api_store[("PostgreSQL access<br/>[prisma.service.ts]")]
end

node_staff(("Store staff"))
node_external_services{{"External services"}}

node_staff -->|"uses"| node_mobile_app
node_mobile_app -->|"renders"| node_sales_ui
node_mobile_app -->|"renders"| node_inventory_ui
node_mobile_app -->|"renders"| node_transaction_ui
node_mobile_app -->|"renders"| node_login_ui
node_login_ui -->|"uses"| node_auth_store
node_auth_store -->|"logs in"| node_subscription
node_mobile_app -->|"restores products"| node_local_db
node_mobile_app -->|"builds headers"| node_sync_service
node_sync_service -->|"reads and updates"| node_local_db
node_sync_service -->|"syncs products"| node_product_api
node_sync_service -->|"syncs customers"| node_customers_api
node_sync_service -->|"syncs debts"| node_debts_api
node_sync_service -->|"syncs payments"| node_payments_api
node_api_auth -->|"reads and writes"| node_api_store
node_roles_guard -->|"checks membership"| node_api_store
node_workspace -->|"reads and writes"| node_api_store
node_sales_api -->|"reads and writes"| node_api_store
node_sales_api -->|"creates notifications"| node_notifications_api
node_customers_api -->|"reads and writes"| node_api_store
node_debts_api -->|"reads and writes"| node_api_store
node_mobile_app -.->|"uses purchases"| node_external_services

click node_mobile_app "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/App.tsx"
click node_sales_ui "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/screens/SellScreen.tsx"
click node_inventory_ui "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/screens/InventoryScreen.tsx"
click node_transaction_ui "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/screens/TransactionScreen.tsx"
click node_login_ui "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/screens/LoginScreen.tsx"
click node_auth_store "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/store/authStore.ts"
click node_sync_service "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/services/syncService.ts"
click node_local_db "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/db/index.ts"
click node_currency "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/hooks/useCurrency.ts"
click node_subscription "https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/services/revenueCatService.ts"
click node_api_auth "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/auth/auth.service.ts"
click node_auth_guard "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/auth/auth.guard.ts"
click node_roles_guard "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/auth/roles.guard.ts"
click node_workspace "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/workspace/workspace.service.ts"
click node_product_api "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/products/products.service.ts"
click node_sales_api "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/sales/sales.service.ts"
click node_customers_api "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/customers/customers.service.ts"
click node_debts_api "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/debts/debts.service.ts"
click node_payments_api "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/payments/payments.service.ts"
click node_notifications_api "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/notifications/notifications.service.ts"
click node_api_store "https://github.com/azuliatech/chobo/blob/develop/apps/api/src/prisma/prisma.service.ts"

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_mobile_app,node_sales_ui,node_inventory_ui,node_transaction_ui,node_login_ui,node_currency toneBlue
class node_auth_store,node_api_auth,node_auth_guard,node_roles_guard,node_workspace toneAmber
class node_product_api,node_sales_api,node_customers_api,node_debts_api,node_payments_api toneMint
class node_sync_service,node_local_db,node_subscription,node_notifications_api,node_api_store toneRose
class node_staff,node_external_services toneIndigo
```

## Components

### Mobile app

- [App navigation](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/App.tsx): `apps/mobile/App.tsx`
- [Sales screens](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/screens/SellScreen.tsx): `apps/mobile/src/screens/SellScreen.tsx`
- [Inventory screen](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/screens/InventoryScreen.tsx): `apps/mobile/src/screens/InventoryScreen.tsx`
- [Transaction history](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/screens/TransactionScreen.tsx): `apps/mobile/src/screens/TransactionScreen.tsx`
- [Login screen](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/screens/LoginScreen.tsx): `apps/mobile/src/screens/LoginScreen.tsx`
- [Currency settings](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/hooks/useCurrency.ts): `apps/mobile/src/hooks/useCurrency.ts`

### Identity and workspace

- [Auth state](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/store/authStore.ts): `apps/mobile/src/store/authStore.ts`
- [Authentication API](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/auth/auth.service.ts): `apps/api/src/auth/auth.service.ts`
- [JWT guard](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/auth/auth.guard.ts): `apps/api/src/auth/auth.guard.ts`
- [Workspace roles](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/auth/roles.guard.ts): `apps/api/src/auth/roles.guard.ts`
- [Workspace management](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/workspace/workspace.service.ts): `apps/api/src/workspace/workspace.service.ts`

### Store operations

- [Product management](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/products/products.service.ts): `apps/api/src/products/products.service.ts`
- [Sales processing](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/sales/sales.service.ts): `apps/api/src/sales/sales.service.ts`
- [Customer records](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/customers/customers.service.ts): `apps/api/src/customers/customers.service.ts`
- [Debt tracking](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/debts/debts.service.ts): `apps/api/src/debts/debts.service.ts`
- [Payments](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/payments/payments.service.ts): `apps/api/src/payments/payments.service.ts`

### Data and integrations

- [Data synchronization](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/services/syncService.ts): `apps/mobile/src/services/syncService.ts`
- [Local SQLite](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/db/index.ts): `apps/mobile/src/db/index.ts`
- [Subscription service](https://github.com/azuliatech/chobo/blob/develop/apps/mobile/src/services/revenueCatService.ts): `apps/mobile/src/services/revenueCatService.ts`
- [Notifications](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/notifications/notifications.service.ts): `apps/api/src/notifications/notifications.service.ts`
- [PostgreSQL access](https://github.com/azuliatech/chobo/blob/develop/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`

### Other components

- **Store staff**
- **External services**

## Connections

- Store staff → App navigation: uses (evidence: `apps/mobile/App.tsx`)
- App navigation → Sales screens: renders (evidence: `apps/mobile/App.tsx`)
- App navigation → Inventory screen: renders (evidence: `apps/mobile/App.tsx`)
- App navigation → Transaction history: renders (evidence: `apps/mobile/App.tsx`)
- App navigation → Login screen: renders (evidence: `apps/mobile/App.tsx`)
- Login screen → Auth state: uses (evidence: `apps/mobile/src/screens/LoginScreen.tsx`)
- Auth state → Subscription service: logs in (evidence: `apps/mobile/src/store/authStore.ts`)
- App navigation → Local SQLite: restores products (evidence: `apps/mobile/App.tsx`)
- App navigation → Data synchronization: builds headers (evidence: `apps/mobile/App.tsx`)
- Data synchronization → Local SQLite: reads and updates (evidence: `apps/mobile/src/services/syncService.ts`)
- Data synchronization → Product management: syncs products (evidence: `apps/mobile/src/services/syncService.ts`)
- Data synchronization → Customer records: syncs customers (evidence: `apps/mobile/src/services/syncService.ts`)
- Data synchronization → Debt tracking: syncs debts (evidence: `apps/mobile/src/services/syncService.ts`)
- Data synchronization → Payments: syncs payments (evidence: `apps/mobile/src/services/syncService.ts`)
- Authentication API → PostgreSQL access: reads and writes (evidence: `apps/api/src/auth/auth.service.ts`)
- Workspace roles → PostgreSQL access: checks membership (evidence: `apps/api/src/auth/roles.guard.ts`)
- Workspace management → PostgreSQL access: reads and writes (evidence: `apps/api/src/workspace/workspace.service.ts`)
- Sales processing → PostgreSQL access: reads and writes (evidence: `apps/api/src/sales/sales.service.ts`)
- Sales processing → Notifications: creates notifications (evidence: `apps/api/src/sales/sales.service.ts`)
- Customer records → PostgreSQL access: reads and writes (evidence: `apps/api/src/customers/customers.service.ts`)
- Debt tracking → PostgreSQL access: reads and writes (evidence: `apps/api/src/debts/debts.service.ts`)
- App navigation → External services: uses purchases (evidence: `apps/mobile/App.tsx`)
