# saurabh1e/open-pos architecture

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

- Interactive diagram: https://gitdiagram.com/saurabh1e/open-pos
- Repository: https://github.com/saurabh1e/open-pos

## Overview

This is a deprecated Angular point-of-sale frontend. Its central workflow is selecting a shop, billing products into a cart, and checking out an order; surrounding capabilities cover inventory, stock, reporting, staff, and shop configuration. The graph uses the routes and sampled service interactions where shown. Several feature implementations were not excerpted, so their internal calls are omitted rather than inferred.

Main entry points: [`src/app/app.routes.ts`](https://github.com/saurabh1e/open-pos/blob/master/src/app/app.routes.ts) (Application routes), [`src/app/billing/billing.component.ts`](https://github.com/saurabh1e/open-pos/blob/master/src/app/billing/billing.component.ts) (Product billing), [`src/app/billing/checkout/checkout.component.ts`](https://github.com/saurabh1e/open-pos/blob/master/src/app/billing/checkout/checkout.component.ts) (Checkout), [`src/services/users.service.ts`](https://github.com/saurabh1e/open-pos/blob/master/src/services/users.service.ts) (User service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["POS application"]
  node_routes["Application routes<br/>[app.routes.ts]"]
  node_login["Login<br/>[login.component.ts]"]
  node_guard["Authentication guard"]
end

subgraph group_sales["Sales workflow"]
  node_shops["Shop selection<br/>[shops.component.ts]"]
  node_billing["Product billing"]
  node_cart["Cart state and totals<br/>[cart.service.ts]"]
  node_checkout["Checkout"]
end

subgraph group_operations["Store operations"]
  node_inventory["Inventory management"]
  node_stock["Stock management"]
  node_reporting["Sales and stock reports"]
  node_staff["Staff management<br/>[staff.component.ts]"]
  node_shopconfig["Shop and printer settings"]
end

subgraph group_services["Domain services"]
  node_items["Products and catalog<br/>[items.service.ts]"]
  node_shopservice["Shops and synchronization<br/>[shop.service.ts]"]
  node_orders["Order service<br/>[orders.service.ts]"]
  node_customers["Customer service"]
  node_users["User service<br/>[users.service.ts]"]
  node_auth["Authentication state<br/>[auth.service.ts]"]
  node_localdb[("IndexedDB<br/>[indexdb.service.ts]")]
end

node_operator(("Operator"))
node_api{{"POS API"}}

node_operator -->|"opens"| node_routes
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_billing
node_routes -->|"routes to"| node_inventory
node_routes -->|"routes to"| node_stock
node_routes -->|"routes to"| node_reporting
node_routes -->|"routes to"| node_staff
node_routes -->|"defaults to"| node_shops
node_routes -->|"guards routes"| node_guard
node_guard -->|"checks login"| node_users
node_login -->|"authenticates"| node_users
node_users -->|"observes auth"| node_auth
node_users -->|"queries shops"| node_shopservice
node_auth -->|"reads and writes"| node_localdb
node_shops -->|"uses local data"| node_localdb
node_billing -->|"loads cart and products"| node_localdb
node_billing -->|"queries products"| node_items
node_billing -->|"sets active shop"| node_shopservice
node_billing -.->|"manages cart"| node_cart
node_billing -.->|"opens checkout"| node_checkout
node_checkout -->|"submits orders"| node_orders
node_checkout -->|"uses customer data"| node_customers
node_checkout -->|"uses shop data"| node_shopservice
node_checkout -->|"reads cart"| node_cart
node_items -->|"requests catalog"| node_api
node_orders -->|"requests orders"| node_api
node_customers -->|"requests customers"| node_api
node_users -->|"requests users"| node_api
node_shopservice -->|"requests shop data"| node_api
node_items -->|"uses local data"| node_localdb
node_shopservice -->|"syncs local data"| node_localdb

click node_routes "https://github.com/saurabh1e/open-pos/blob/master/src/app/app.routes.ts"
click node_login "https://github.com/saurabh1e/open-pos/blob/master/src/app/login/login.component.ts"
click node_guard "https://github.com/saurabh1e/open-pos/blob/master/src/services/auth-gaurd.service.ts"
click node_shops "https://github.com/saurabh1e/open-pos/blob/master/src/app/dashboard/shops/shops.component.ts"
click node_billing "https://github.com/saurabh1e/open-pos/blob/master/src/app/billing/billing.component.ts"
click node_cart "https://github.com/saurabh1e/open-pos/blob/master/src/services/cart.service.ts"
click node_checkout "https://github.com/saurabh1e/open-pos/blob/master/src/app/billing/checkout/checkout.component.ts"
click node_inventory "https://github.com/saurabh1e/open-pos/tree/master/src/app/inventory"
click node_stock "https://github.com/saurabh1e/open-pos/tree/master/src/app/stock-management"
click node_reporting "https://github.com/saurabh1e/open-pos/tree/master/src/app/reporting"
click node_staff "https://github.com/saurabh1e/open-pos/blob/master/src/app/staff/staff.component.ts"
click node_shopconfig "https://github.com/saurabh1e/open-pos/blob/master/src/app/dashboard/printer-config/printer-config.component.ts"
click node_items "https://github.com/saurabh1e/open-pos/blob/master/src/services/items.service.ts"
click node_shopservice "https://github.com/saurabh1e/open-pos/blob/master/src/services/shop.service.ts"
click node_orders "https://github.com/saurabh1e/open-pos/blob/master/src/services/orders.service.ts"
click node_customers "https://github.com/saurabh1e/open-pos/blob/master/src/services/customer.service.ts"
click node_users "https://github.com/saurabh1e/open-pos/blob/master/src/services/users.service.ts"
click node_auth "https://github.com/saurabh1e/open-pos/blob/master/src/services/auth.service.ts"
click node_localdb "https://github.com/saurabh1e/open-pos/blob/master/src/services/indexdb.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_routes,node_login,node_guard toneBlue
class node_shops,node_billing,node_cart,node_checkout toneAmber
class node_inventory,node_stock,node_reporting,node_staff,node_shopconfig,node_api toneMint
class node_items,node_shopservice,node_orders,node_customers,node_users,node_auth,node_localdb toneRose
class node_operator toneIndigo
```

## Components

### POS application

- [Application routes](https://github.com/saurabh1e/open-pos/blob/master/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Login](https://github.com/saurabh1e/open-pos/blob/master/src/app/login/login.component.ts): `src/app/login/login.component.ts`
- [Authentication guard](https://github.com/saurabh1e/open-pos/blob/master/src/services/auth-gaurd.service.ts): `src/services/auth-gaurd.service.ts`

### Sales workflow

- [Shop selection](https://github.com/saurabh1e/open-pos/blob/master/src/app/dashboard/shops/shops.component.ts): `src/app/dashboard/shops/shops.component.ts`
- [Product billing](https://github.com/saurabh1e/open-pos/blob/master/src/app/billing/billing.component.ts): `src/app/billing/billing.component.ts`
- [Cart state and totals](https://github.com/saurabh1e/open-pos/blob/master/src/services/cart.service.ts): `src/services/cart.service.ts`
- [Checkout](https://github.com/saurabh1e/open-pos/blob/master/src/app/billing/checkout/checkout.component.ts): `src/app/billing/checkout/checkout.component.ts`

### Store operations

- [Inventory management](https://github.com/saurabh1e/open-pos/tree/master/src/app/inventory): `src/app/inventory`
- [Stock management](https://github.com/saurabh1e/open-pos/tree/master/src/app/stock-management): `src/app/stock-management`
- [Sales and stock reports](https://github.com/saurabh1e/open-pos/tree/master/src/app/reporting): `src/app/reporting`
- [Staff management](https://github.com/saurabh1e/open-pos/blob/master/src/app/staff/staff.component.ts): `src/app/staff/staff.component.ts`
- [Shop and printer settings](https://github.com/saurabh1e/open-pos/blob/master/src/app/dashboard/printer-config/printer-config.component.ts): `src/app/dashboard/printer-config/printer-config.component.ts`

### Domain services

- [Products and catalog](https://github.com/saurabh1e/open-pos/blob/master/src/services/items.service.ts): `src/services/items.service.ts`
- [Shops and synchronization](https://github.com/saurabh1e/open-pos/blob/master/src/services/shop.service.ts): `src/services/shop.service.ts`
- [Order service](https://github.com/saurabh1e/open-pos/blob/master/src/services/orders.service.ts): `src/services/orders.service.ts`
- [Customer service](https://github.com/saurabh1e/open-pos/blob/master/src/services/customer.service.ts): `src/services/customer.service.ts`
- [User service](https://github.com/saurabh1e/open-pos/blob/master/src/services/users.service.ts): `src/services/users.service.ts`
- [Authentication state](https://github.com/saurabh1e/open-pos/blob/master/src/services/auth.service.ts): `src/services/auth.service.ts`
- [IndexedDB](https://github.com/saurabh1e/open-pos/blob/master/src/services/indexdb.service.ts): `src/services/indexdb.service.ts`

### Other components

- **Operator**
- **POS API**

## Connections

- Operator → Application routes: opens (evidence: `src/app/app.routes.ts`)
- Application routes → Login: routes to (evidence: `src/app/app.routes.ts`)
- Application routes → Product billing: routes to (evidence: `src/app/app.routes.ts`)
- Application routes → Inventory management: routes to (evidence: `src/app/app.routes.ts`)
- Application routes → Stock management: routes to (evidence: `src/app/app.routes.ts`)
- Application routes → Sales and stock reports: routes to (evidence: `src/app/app.routes.ts`)
- Application routes → Staff management: routes to (evidence: `src/app/app.routes.ts`)
- Application routes → Shop selection: defaults to (evidence: `src/app/app.routes.ts`)
- Application routes → Authentication guard: guards routes (evidence: `src/app/app.routes.ts`)
- Authentication guard → User service: checks login (evidence: `src/services/auth-gaurd.service.ts`)
- Login → User service: authenticates (evidence: `src/app/login/login.component.ts`)
- User service → Authentication state: observes auth (evidence: `src/services/users.service.ts`)
- User service → Shops and synchronization: queries shops (evidence: `src/services/users.service.ts`)
- Authentication state → IndexedDB: reads and writes (evidence: `src/services/auth.service.ts`)
- Shop selection → IndexedDB: uses local data (evidence: `src/app/dashboard/shops/shops.component.ts`)
- Product billing → IndexedDB: loads cart and products (evidence: `src/app/billing/billing.component.ts`)
- Product billing → Products and catalog: queries products (evidence: `src/app/billing/billing.component.ts`)
- Product billing → Shops and synchronization: sets active shop (evidence: `src/app/billing/billing.component.ts`)
- Product billing → Cart state and totals: manages cart (evidence: `src/app/billing/billing.component.ts`)
- Product billing → Checkout: opens checkout (evidence: `src/app/billing/billing.component.ts`)
- Checkout → Order service: submits orders (evidence: `src/app/billing/checkout/checkout.component.ts`)
- Checkout → Customer service: uses customer data (evidence: `src/app/billing/checkout/checkout.component.ts`)
- Checkout → Shops and synchronization: uses shop data (evidence: `src/app/billing/checkout/checkout.component.ts`)
- Checkout → Cart state and totals: reads cart (evidence: `src/app/billing/checkout/checkout.component.ts`)
- Products and catalog → POS API: requests catalog (evidence: `src/services/items.service.ts`)
- Order service → POS API: requests orders (evidence: `src/services/orders.service.ts`)
- Customer service → POS API: requests customers (evidence: `src/services/customer.service.ts`)
- User service → POS API: requests users (evidence: `src/services/users.service.ts`)
- Shops and synchronization → POS API: requests shop data (evidence: `src/services/shop.service.ts`)
- Products and catalog → IndexedDB: uses local data (evidence: `src/services/items.service.ts`)
- Shops and synchronization → IndexedDB: syncs local data (evidence: `src/services/shop.service.ts`)
