# poisomn/boskepos architecture

> Architecture diagram of the GitHub repository poisomn/boskepos, 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/poisomn/boskepos
- Repository: https://github.com/poisomn/boskepos

## Overview

BoskePOS is a hardware-store ERP/POS: staff sign in, access permission-gated screens, manage catalog and stock, record purchases, and complete sales through the POS. The React client calls a Django REST API; backend business logic owns transactional sales, purchasing, and stock updates. The README also identifies customer/supplier management, dashboard summaries, and business settings. Several backend views and frontend pages are listed but unsampled, so their detailed internals and some links are not asserted.

Main entry points: [`frontend/src/api/http.js`](https://github.com/poisomn/boskepos/blob/main/frontend/src/api/http.js) (HTTP client), [`frontend/src/routes/AppRoutes.jsx`](https://github.com/poisomn/boskepos/blob/main/frontend/src/routes/AppRoutes.jsx) (App routing), [`apps/purchases/services.py`](https://github.com/poisomn/boskepos/blob/main/apps/purchases/services.py) (Purchase transactions), [`frontend/src/pages/Inventory/ProductsPage.jsx`](https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/Inventory/ProductsPage.jsx) (Inventory screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["App routing<br/>[AppRoutes.jsx]"]
  node_authui["Authentication state<br/>[AuthContext.jsx]"]
  node_http["HTTP client<br/>[http.js]"]
  node_authsvc["Auth service<br/>[authService.js]"]
  node_posui["POS screen<br/>[POSPage.jsx]"]
  node_inventoryui["Inventory screens<br/>[ProductsPage.jsx]"]
  node_dashui["Dashboard screen<br/>[DashboardPage.jsx]"]
  node_salesui["Sales screens"]
  node_purchaseui["Purchase screens<br/>[PurchasesPage.jsx]"]
  node_inventorysvc["Inventory API service"]
end

subgraph group_commerce["Sales and purchasing"]
  node_salesapi["Sales API<br/>[views.py]"]
  node_salesservice["Sales transactions<br/>[services.py]"]
  node_purchaseapi["Purchases API<br/>[views.py]"]
  node_purchaseservice["Purchase transactions<br/>[services.py]"]
end

subgraph group_stock["Inventory"]
  node_stockservice["Stock movement service<br/>[services.py]"]
  node_inventorymodels[("Catalog and stock records<br/>[models.py]")]
end

subgraph group_business["Business records"]
  node_customers["Customer management<br/>[views.py]"]
  node_suppliers["Supplier management<br/>[views.py]"]
  node_dashboard["Dashboard summaries<br/>[views.py]"]
  node_settings["Business settings<br/>[views.py]"]
end

subgraph group_platform["API and identity"]
  node_accounts["Accounts API<br/>[views.py]"]
end

node_staff(("Staff user"))
node_database[("PostgreSQL")]

node_staff -->|"uses"| node_app
node_app -->|"routes to"| node_posui
node_app -->|"routes to"| node_inventoryui
node_app -->|"routes to"| node_dashui
node_app -->|"routes to"| node_salesui
node_app -->|"routes to"| node_purchaseui
node_authui -->|"requests identity"| node_authsvc
node_authsvc -->|"sends requests"| node_http
node_inventoryui -->|"calls"| node_inventorysvc
node_inventorysvc -->|"sends requests"| node_http
node_posui -.->|"uses API"| node_http
node_salesui -.->|"uses API"| node_http
node_purchaseui -.->|"uses API"| node_http
node_dashui -.->|"uses API"| node_http
node_http -.->|"REST requests"| node_accounts
node_http -.->|"REST requests"| node_salesapi
node_http -.->|"REST requests"| node_purchaseapi
node_http -.->|"REST requests"| node_inventoryui
node_salesapi -.->|"dispatches"| node_salesservice
node_purchaseapi -.->|"dispatches"| node_purchaseservice
node_salesservice -->|"applies stock movement"| node_stockservice
node_purchaseservice -->|"applies stock movement"| node_stockservice
node_stockservice -->|"updates records"| node_inventorymodels
node_salesservice -->|"reads products"| node_inventorymodels
node_purchaseservice -->|"reads products"| node_inventorymodels
node_purchaseservice -.->|"uses supplier model"| node_suppliers
node_inventorysvc -->|"serves catalog calls"| node_inventoryui
node_inventorymodels -.->|"persists"| node_database
node_customers -.->|"persists"| node_database
node_suppliers -.->|"persists"| node_database
node_dashboard -.->|"reads summaries"| node_database
node_settings -.->|"persists"| node_database

click node_app "https://github.com/poisomn/boskepos/blob/main/frontend/src/routes/AppRoutes.jsx"
click node_authui "https://github.com/poisomn/boskepos/blob/main/frontend/src/contexts/AuthContext.jsx"
click node_http "https://github.com/poisomn/boskepos/blob/main/frontend/src/api/http.js"
click node_authsvc "https://github.com/poisomn/boskepos/blob/main/frontend/src/services/authService.js"
click node_posui "https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/POS/POSPage.jsx"
click node_inventoryui "https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/Inventory/ProductsPage.jsx"
click node_dashui "https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/Dashboard/DashboardPage.jsx"
click node_salesui "https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/Sales/SalesHistoryPage.jsx"
click node_purchaseui "https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/Purchases/PurchasesPage.jsx"
click node_inventorysvc "https://github.com/poisomn/boskepos/blob/main/frontend/src/services/inventoryService.js"
click node_salesapi "https://github.com/poisomn/boskepos/blob/main/apps/sales/views.py"
click node_salesservice "https://github.com/poisomn/boskepos/blob/main/apps/sales/services.py"
click node_purchaseapi "https://github.com/poisomn/boskepos/blob/main/apps/purchases/views.py"
click node_purchaseservice "https://github.com/poisomn/boskepos/blob/main/apps/purchases/services.py"
click node_stockservice "https://github.com/poisomn/boskepos/blob/main/apps/inventory/services.py"
click node_inventorymodels "https://github.com/poisomn/boskepos/blob/main/apps/inventory/models.py"
click node_customers "https://github.com/poisomn/boskepos/blob/main/apps/customers/views.py"
click node_suppliers "https://github.com/poisomn/boskepos/blob/main/apps/suppliers/views.py"
click node_dashboard "https://github.com/poisomn/boskepos/blob/main/apps/dashboard/views.py"
click node_settings "https://github.com/poisomn/boskepos/blob/main/apps/system_settings/views.py"
click node_accounts "https://github.com/poisomn/boskepos/blob/main/apps/accounts/views.py"

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_app,node_authui,node_http,node_authsvc,node_posui,node_inventoryui,node_dashui,node_salesui,node_purchaseui,node_inventorysvc,node_staff toneBlue
class node_salesapi,node_salesservice,node_purchaseapi,node_purchaseservice,node_database toneAmber
class node_stockservice,node_inventorymodels toneMint
class node_customers,node_suppliers,node_dashboard,node_settings toneRose
class node_accounts toneIndigo
```

## Components

### React client

- [App routing](https://github.com/poisomn/boskepos/blob/main/frontend/src/routes/AppRoutes.jsx): `frontend/src/routes/AppRoutes.jsx`
- [Authentication state](https://github.com/poisomn/boskepos/blob/main/frontend/src/contexts/AuthContext.jsx): `frontend/src/contexts/AuthContext.jsx`
- [HTTP client](https://github.com/poisomn/boskepos/blob/main/frontend/src/api/http.js): `frontend/src/api/http.js`
- [Auth service](https://github.com/poisomn/boskepos/blob/main/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [POS screen](https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/POS/POSPage.jsx): `frontend/src/pages/POS/POSPage.jsx`
- [Inventory screens](https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/Inventory/ProductsPage.jsx): `frontend/src/pages/Inventory/ProductsPage.jsx`
- [Dashboard screen](https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/Dashboard/DashboardPage.jsx): `frontend/src/pages/Dashboard/DashboardPage.jsx`
- [Sales screens](https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/Sales/SalesHistoryPage.jsx): `frontend/src/pages/Sales/SalesHistoryPage.jsx`
- [Purchase screens](https://github.com/poisomn/boskepos/blob/main/frontend/src/pages/Purchases/PurchasesPage.jsx): `frontend/src/pages/Purchases/PurchasesPage.jsx`
- [Inventory API service](https://github.com/poisomn/boskepos/blob/main/frontend/src/services/inventoryService.js): `frontend/src/services/inventoryService.js`

### Sales and purchasing

- [Sales API](https://github.com/poisomn/boskepos/blob/main/apps/sales/views.py): `apps/sales/views.py`
- [Sales transactions](https://github.com/poisomn/boskepos/blob/main/apps/sales/services.py): `apps/sales/services.py`
- [Purchases API](https://github.com/poisomn/boskepos/blob/main/apps/purchases/views.py): `apps/purchases/views.py`
- [Purchase transactions](https://github.com/poisomn/boskepos/blob/main/apps/purchases/services.py): `apps/purchases/services.py`

### Inventory

- [Stock movement service](https://github.com/poisomn/boskepos/blob/main/apps/inventory/services.py): `apps/inventory/services.py`
- [Catalog and stock records](https://github.com/poisomn/boskepos/blob/main/apps/inventory/models.py): `apps/inventory/models.py`

### Business records

- [Customer management](https://github.com/poisomn/boskepos/blob/main/apps/customers/views.py): `apps/customers/views.py`
- [Supplier management](https://github.com/poisomn/boskepos/blob/main/apps/suppliers/views.py): `apps/suppliers/views.py`
- [Dashboard summaries](https://github.com/poisomn/boskepos/blob/main/apps/dashboard/views.py): `apps/dashboard/views.py`
- [Business settings](https://github.com/poisomn/boskepos/blob/main/apps/system_settings/views.py): `apps/system_settings/views.py`

### API and identity

- [Accounts API](https://github.com/poisomn/boskepos/blob/main/apps/accounts/views.py): `apps/accounts/views.py`

### Other components

- **Staff user**
- **PostgreSQL**

## Connections

- Staff user → App routing: uses
- App routing → POS screen: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- App routing → Inventory screens: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- App routing → Dashboard screen: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- App routing → Sales screens: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- App routing → Purchase screens: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Authentication state → Auth service: requests identity (evidence: `frontend/src/contexts/AuthContext.jsx`)
- Auth service → HTTP client: sends requests (evidence: `frontend/src/services/authService.js`)
- Inventory screens → Inventory API service: calls (evidence: `frontend/src/pages/Inventory/ProductsPage.jsx`)
- Inventory API service → HTTP client: sends requests (evidence: `frontend/src/services/inventoryService.js`)
- POS screen → HTTP client: uses API
- Sales screens → HTTP client: uses API
- Purchase screens → HTTP client: uses API
- Dashboard screen → HTTP client: uses API
- HTTP client → Accounts API: REST requests
- HTTP client → Sales API: REST requests
- HTTP client → Purchases API: REST requests
- HTTP client → Inventory screens: REST requests
- Sales API → Sales transactions: dispatches
- Purchases API → Purchase transactions: dispatches
- Sales transactions → Stock movement service: applies stock movement (evidence: `apps/sales/services.py`)
- Purchase transactions → Stock movement service: applies stock movement (evidence: `apps/purchases/services.py`)
- Stock movement service → Catalog and stock records: updates records (evidence: `apps/inventory/services.py`)
- Sales transactions → Catalog and stock records: reads products (evidence: `apps/sales/services.py`)
- Purchase transactions → Catalog and stock records: reads products (evidence: `apps/purchases/services.py`)
- Purchase transactions → Supplier management: uses supplier model
- Inventory API service → Inventory screens: serves catalog calls (evidence: `frontend/src/pages/Inventory/ProductsPage.jsx`)
- Catalog and stock records → PostgreSQL: persists
- Customer management → PostgreSQL: persists
- Supplier management → PostgreSQL: persists
- Dashboard summaries → PostgreSQL: reads summaries
- Business settings → PostgreSQL: persists
