# kcsimfinity/saripos architecture

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

- Interactive diagram: https://gitdiagram.com/kcsimfinity/saripos
- Repository: https://github.com/kcsimfinity/saripos

## Overview

SariPOS is a mobile point-of-sale and store-management app. A cashier works through the POS screen to build a cart and check out by cash or customer credit; POSContext coordinates checkout and refreshes app state through the database service. Other screens cover inventory and categories, sales, customer balances, cash-drawer shifts, and settings. The excerpts confirm the app shell, shared state, SQLite setup, and some database operations; wiring for unsampled screens and modals is left unspecified.

Main entry points: [`src/SariPos/app/index.tsx`](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/app/index.tsx) (SariPOS app), [`src/SariPos/context/POSContext.tsx`](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/context/POSContext.tsx) (POS context), [`src/SariPos/database/databaseService.ts`](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/database/databaseService.ts) (Database service), [`src/SariPos/database/db.ts`](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/database/db.ts) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_entry["Expo entry<br/>[index.tsx]"]
  node_application["SariPOS app<br/>[index.tsx]"]
  node_navigation["Navigation bar<br/>[NavigationBar.tsx]"]
  node_state["POS context<br/>[POSContext.tsx]"]
end

subgraph group_commerce["Sales and inventory"]
  node_pos["POS screen<br/>[POSScreen.tsx]"]
  node_checkout["Checkout modal<br/>[CheckoutModal.tsx]"]
  node_receipt["Receipt modal<br/>[ReceiptModal.tsx]"]
  node_inventory["Inventory screen"]
  node_categories["Category products"]
  node_product["Product editor<br/>[ProductModal.tsx]"]
  node_sales["Sales screen<br/>[SalesScreen.tsx]"]
end

subgraph group_operations["Store operations"]
  node_utang["Customer balances<br/>[UtangScreen.tsx]"]
  node_cash["Cash drawer"]
  node_settings["Store settings<br/>[SettingsScreen.tsx]"]
end

subgraph group_persistence["Persistence"]
  node_dbservice["Database service<br/>[databaseService.ts]"]
  node_database[("SQLite database<br/>[db.ts]")]
end

node_cashier(("Cashier"))
node_sqlite["Expo SQLite"]

node_cashier -->|"opens app"| node_entry
node_entry -->|"renders"| node_application
node_application -->|"provides state"| node_state
node_application -->|"renders"| node_navigation
node_application -->|"selects screen"| node_pos
node_application -->|"selects screen"| node_inventory
node_application -->|"selects screen"| node_categories
node_application -->|"selects screen"| node_sales
node_application -->|"selects screen"| node_utang
node_application -->|"selects screen"| node_cash
node_application -->|"selects screen"| node_settings
node_product -->|"reads/writes products"| node_dbservice
node_product -->|"refreshes inventory"| node_state
node_state -->|"initializes"| node_database
node_state -->|"loads and updates"| node_dbservice
node_dbservice -->|"queries and writes"| node_database
node_database -->|"opens database"| node_sqlite

click node_entry "https://github.com/kcsimfinity/saripos/blob/main/src/app/index.tsx"
click node_application "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/app/index.tsx"
click node_navigation "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/components/NavigationBar.tsx"
click node_pos "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/POSScreen.tsx"
click node_checkout "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/components/CheckoutModal.tsx"
click node_receipt "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/components/ReceiptModal.tsx"
click node_inventory "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/InventoryScreen.tsx"
click node_categories "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/CategoryProductsScreen.tsx"
click node_product "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/components/ProductModal.tsx"
click node_sales "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/SalesScreen.tsx"
click node_state "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/context/POSContext.tsx"
click node_utang "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/UtangScreen.tsx"
click node_cash "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/CashDrawerScreen.tsx"
click node_settings "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/SettingsScreen.tsx"
click node_dbservice "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/database/databaseService.ts"
click node_database "https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/database/db.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_entry,node_application,node_navigation,node_state toneBlue
class node_pos,node_checkout,node_receipt,node_inventory,node_categories,node_product,node_sales,node_sqlite toneAmber
class node_utang,node_cash,node_settings toneMint
class node_dbservice,node_database toneRose
class node_cashier toneIndigo
```

## Components

### App shell

- [Expo entry](https://github.com/kcsimfinity/saripos/blob/main/src/app/index.tsx): `src/app/index.tsx`
- [SariPOS app](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/app/index.tsx): `src/SariPos/app/index.tsx`
- [Navigation bar](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/components/NavigationBar.tsx): `src/SariPos/components/NavigationBar.tsx`
- [POS context](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/context/POSContext.tsx): `src/SariPos/context/POSContext.tsx`

### Sales and inventory

- [POS screen](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/POSScreen.tsx): `src/SariPos/screens/POSScreen.tsx`
- [Checkout modal](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/components/CheckoutModal.tsx): `src/SariPos/components/CheckoutModal.tsx`
- [Receipt modal](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/components/ReceiptModal.tsx): `src/SariPos/components/ReceiptModal.tsx`
- [Inventory screen](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/InventoryScreen.tsx): `src/SariPos/screens/InventoryScreen.tsx`
- [Category products](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/CategoryProductsScreen.tsx): `src/SariPos/screens/CategoryProductsScreen.tsx`
- [Product editor](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/components/ProductModal.tsx): `src/SariPos/components/ProductModal.tsx`
- [Sales screen](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/SalesScreen.tsx): `src/SariPos/screens/SalesScreen.tsx`

### Store operations

- [Customer balances](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/UtangScreen.tsx): `src/SariPos/screens/UtangScreen.tsx`
- [Cash drawer](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/CashDrawerScreen.tsx): `src/SariPos/screens/CashDrawerScreen.tsx`
- [Store settings](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/screens/SettingsScreen.tsx): `src/SariPos/screens/SettingsScreen.tsx`

### Persistence

- [Database service](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/database/databaseService.ts): `src/SariPos/database/databaseService.ts`
- [SQLite database](https://github.com/kcsimfinity/saripos/blob/main/src/SariPos/database/db.ts): `src/SariPos/database/db.ts`

### Other components

- **Cashier**
- **Expo SQLite**

## Connections

- Cashier → Expo entry: opens app
- Expo entry → SariPOS app: renders
- SariPOS app → POS context: provides state
- SariPOS app → Navigation bar: renders
- SariPOS app → POS screen: selects screen
- SariPOS app → Inventory screen: selects screen
- SariPOS app → Category products: selects screen
- SariPOS app → Sales screen: selects screen
- SariPOS app → Customer balances: selects screen
- SariPOS app → Cash drawer: selects screen
- SariPOS app → Store settings: selects screen
- Product editor → Database service: reads/writes products
- Product editor → POS context: refreshes inventory
- POS context → SQLite database: initializes
- POS context → Database service: loads and updates
- Database service → SQLite database: queries and writes
- SQLite database → Expo SQLite: opens database
