# saikothawal21/pos-system architecture

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

- Interactive diagram: https://gitdiagram.com/saikothawal21/pos-system
- Repository: https://github.com/saikothawal21/pos-system

## Overview

This is a multi-role point-of-sale platform: store administrators manage stores, branches, products, staff, and subscriptions; branch managers oversee operations and reports; cashiers create sales; and super administrators manage stores and plans. The primary workflow is a cashier assembling an order, recording payment, and reviewing shift results, with backend services for orders, payments, refunds, and reporting. The tree and excerpts establish role-based routing and parts of authentication, but do not expose most sales-service calls or frontend API wiring; those links are therefore omitted or marked unverified.

Main entry points: [`pos-frontend-vite/src/App.jsx`](https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/App.jsx) (Role router), [`pos-backend/src/main/java/com/zosh/service/impl/PaymentServiceImpl.java`](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/PaymentServiceImpl.java) (Payment processing), [`pos-backend/src/main/java/com/zosh/service/impl/AuthServiceImpl.java`](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/AuthServiceImpl.java) (Authentication logic), [`pos-backend/src/main/java/com/zosh/service/impl/OrderServiceImpl.java`](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/OrderServiceImpl.java) (Order processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client application"]
  node_app["Role router<br/>[App.jsx]"]
  node_store_routes["Store workspace<br/>[StoreRoutes.jsx]"]
  node_admin_routes["Admin workspace"]
  node_branch_routes["Branch workspace"]
  node_cashier_routes["Cashier workspace<br/>[CashierRoutes.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_controller["Authentication API"]
  node_auth_service["Authentication logic"]
  node_jwt["JWT provider<br/>[JwtProvider.java]"]
  node_user_controller["User API"]
  node_user_service["User services<br/>[UserService.java]"]
  node_user_store[("Users and stores<br/>[User.java]")]
end

subgraph group_retail["Store operations"]
  node_catalog["Catalog and branches"]
  node_inventory["Inventory control"]
  node_customer["Customer records"]
end

subgraph group_commerce["Sales and billing"]
  node_orders["Order processing"]
  node_payments["Payment processing"]
  node_gateways["Payment gateways<br/>[StripeService.java]"]
  node_refunds["Refund handling"]
  node_subscriptions["Subscriptions"]
end

subgraph group_oversight["Administration and analytics"]
  node_analytics["Store and branch analytics"]
  node_shift_reports["Shift reporting"]
  node_admin["Platform administration"]
end

node_user(("Staff or admin"))
node_database[("Application database")]
node_gateway_service["External payment provider"]

node_user -->|"uses"| node_app
node_app -->|"routes by role"| node_store_routes
node_app -->|"routes by role"| node_admin_routes
node_app -->|"routes by role"| node_branch_routes
node_app -->|"routes by role"| node_cashier_routes
node_app -.->|"loads profile"| node_user_service
node_store_routes -.->|"manages catalog"| node_catalog
node_cashier_routes -.->|"submits sales"| node_orders
node_orders -.->|"records payment"| node_payments
node_payments -.->|"delegates payment"| node_gateways
node_payments -.->|"charges externally"| node_gateway_service
node_branch_routes -.->|"reviews shifts"| node_shift_reports
node_user -.->|"authenticates"| node_auth_controller
node_auth_controller -.->|"delegates auth"| node_auth_service
node_auth_service -->|"reads and saves"| node_user_store
node_auth_service -->|"creates token"| node_jwt
node_user_controller -->|"requests users"| node_user_service
node_user_controller -.->|"reads users"| node_user_store
node_catalog -.->|"persists catalog"| node_database
node_inventory -.->|"persists stock"| node_database
node_customer -.->|"persists customers"| node_database
node_orders -.->|"persists orders"| node_database
node_payments -.->|"persists payments"| node_database
node_refunds -.->|"persists refunds"| node_database
node_subscriptions -.->|"persists plans"| node_database
node_analytics -.->|"queries sales"| node_database
node_shift_reports -.->|"queries shifts"| node_database
node_admin -.->|"queries platform"| node_database

click node_app "https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/App.jsx"
click node_store_routes "https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/routes/StoreRoutes.jsx"
click node_admin_routes "https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/routes/SuperAdminRoutes.jsx"
click node_branch_routes "https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/routes/BranchManagerRoutes.jsx"
click node_cashier_routes "https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/routes/CashierRoutes.jsx"
click node_auth_controller "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/controller/AuthController.java"
click node_auth_service "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/AuthServiceImpl.java"
click node_jwt "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/configrations/JwtProvider.java"
click node_user_controller "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/controller/UserController.java"
click node_user_service "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/UserService.java"
click node_user_store "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/modal/User.java"
click node_catalog "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/ProductServiceImpl.java"
click node_inventory "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/InventoryServiceImpl.java"
click node_customer "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/CustomerServiceImpl.java"
click node_orders "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/OrderServiceImpl.java"
click node_payments "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/PaymentServiceImpl.java"
click node_gateways "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/gateway/StripeService.java"
click node_refunds "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/RefundServiceImpl.java"
click node_subscriptions "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/SubscriptionService.java"
click node_analytics "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/StoreAnalyticsServiceImpl.java"
click node_shift_reports "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/ShiftReportService.java"
click node_admin "https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/AdminDashboardServiceImpl.java"

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_store_routes,node_admin_routes,node_branch_routes,node_cashier_routes toneBlue
class node_auth_controller,node_auth_service,node_jwt,node_user_controller,node_user_service,node_user_store,node_database toneAmber
class node_catalog,node_inventory,node_customer toneMint
class node_orders,node_payments,node_gateways,node_refunds,node_subscriptions toneRose
class node_analytics,node_shift_reports,node_admin,node_user,node_gateway_service toneIndigo
```

## Components

### Client application

- [Role router](https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/App.jsx): `pos-frontend-vite/src/App.jsx`
- [Store workspace](https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/routes/StoreRoutes.jsx): `pos-frontend-vite/src/routes/StoreRoutes.jsx`
- [Admin workspace](https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/routes/SuperAdminRoutes.jsx): `pos-frontend-vite/src/routes/SuperAdminRoutes.jsx`
- [Branch workspace](https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/routes/BranchManagerRoutes.jsx): `pos-frontend-vite/src/routes/BranchManagerRoutes.jsx`
- [Cashier workspace](https://github.com/saikothawal21/pos-system/blob/main/pos-frontend-vite/src/routes/CashierRoutes.jsx): `pos-frontend-vite/src/routes/CashierRoutes.jsx`

### Identity and access

- [Authentication API](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/controller/AuthController.java): `pos-backend/src/main/java/com/zosh/controller/AuthController.java`
- [Authentication logic](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/AuthServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/AuthServiceImpl.java`
- [JWT provider](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/configrations/JwtProvider.java): `pos-backend/src/main/java/com/zosh/configrations/JwtProvider.java`
- [User API](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/controller/UserController.java): `pos-backend/src/main/java/com/zosh/controller/UserController.java`
- [User services](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/UserService.java): `pos-backend/src/main/java/com/zosh/service/UserService.java`
- [Users and stores](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/modal/User.java): `pos-backend/src/main/java/com/zosh/modal/User.java`

### Store operations

- [Catalog and branches](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/ProductServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/ProductServiceImpl.java`
- [Inventory control](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/InventoryServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/InventoryServiceImpl.java`
- [Customer records](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/CustomerServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/CustomerServiceImpl.java`

### Sales and billing

- [Order processing](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/OrderServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/OrderServiceImpl.java`
- [Payment processing](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/PaymentServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/PaymentServiceImpl.java`
- [Payment gateways](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/gateway/StripeService.java): `pos-backend/src/main/java/com/zosh/service/gateway/StripeService.java`
- [Refund handling](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/RefundServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/RefundServiceImpl.java`
- [Subscriptions](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/SubscriptionService.java): `pos-backend/src/main/java/com/zosh/service/SubscriptionService.java`

### Administration and analytics

- [Store and branch analytics](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/StoreAnalyticsServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/StoreAnalyticsServiceImpl.java`
- [Shift reporting](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/ShiftReportService.java): `pos-backend/src/main/java/com/zosh/service/ShiftReportService.java`
- [Platform administration](https://github.com/saikothawal21/pos-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/AdminDashboardServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/AdminDashboardServiceImpl.java`

### Other components

- **Staff or admin**
- **Application database**
- **External payment provider**

## Connections

- Staff or admin → Role router: uses (evidence: `pos-frontend-vite/src/App.jsx`)
- Role router → Store workspace: routes by role (evidence: `pos-frontend-vite/src/App.jsx`)
- Role router → Admin workspace: routes by role (evidence: `pos-frontend-vite/src/App.jsx`)
- Role router → Branch workspace: routes by role (evidence: `pos-frontend-vite/src/App.jsx`)
- Role router → Cashier workspace: routes by role (evidence: `pos-frontend-vite/src/App.jsx`)
- Role router → User services: loads profile
- Store workspace → Catalog and branches: manages catalog
- Cashier workspace → Order processing: submits sales
- Order processing → Payment processing: records payment
- Payment processing → Payment gateways: delegates payment
- Payment processing → External payment provider: charges externally
- Branch workspace → Shift reporting: reviews shifts
- Staff or admin → Authentication API: authenticates
- Authentication API → Authentication logic: delegates auth
- Authentication logic → Users and stores: reads and saves (evidence: `pos-backend/src/main/java/com/zosh/service/impl/AuthServiceImpl.java`)
- Authentication logic → JWT provider: creates token (evidence: `pos-backend/src/main/java/com/zosh/service/impl/AuthServiceImpl.java`)
- User API → User services: requests users (evidence: `pos-backend/src/main/java/com/zosh/controller/UserController.java`)
- User API → Users and stores: reads users (evidence: `pos-backend/src/main/java/com/zosh/controller/UserController.java`)
- Catalog and branches → Application database: persists catalog
- Inventory control → Application database: persists stock
- Customer records → Application database: persists customers
- Order processing → Application database: persists orders
- Payment processing → Application database: persists payments
- Refund handling → Application database: persists refunds
- Subscriptions → Application database: persists plans
- Store and branch analytics → Application database: queries sales
- Shift reporting → Application database: queries shifts
- Platform administration → Application database: queries platform
