# subhash8729/billing-system architecture

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

- Interactive diagram: https://gitdiagram.com/subhash8729/billing-system
- Repository: https://github.com/subhash8729/billing-system

## Overview

This is a multi-tenant point-of-sale platform: store owners onboard and configure stores, while platform administrators approve stores and manage plans; branch staff manage stock, sales, returns, and shift reporting. The React application selects role-specific pages, and the Spring backend provides the corresponding business services and persistence. README-level workflow and capability links are cited; most backend and Redux internals were not excerpted, so their detailed call relationships are not asserted.

Main entry points: [`pos-frontend-vite/src/App.jsx`](https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/App.jsx) (Role-based app), [`pos-frontend-vite/src/routes/StoreRoutes.jsx`](https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/StoreRoutes.jsx) (Store console), [`pos-frontend-vite/src/routes/CashierRoutes.jsx`](https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/CashierRoutes.jsx) (Cashier POS), [`pos-frontend-vite/src/routes/SuperAdminRoutes.jsx`](https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/SuperAdminRoutes.jsx) (Admin console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User applications"]
  node_app["Role-based app<br/>[App.jsx]"]
  node_admin_ui["Admin console"]
  node_store_ui["Store console<br/>[StoreRoutes.jsx]"]
  node_branch_ui["Branch console"]
  node_cashier_ui["Cashier POS<br/>[CashierRoutes.jsx]"]
end

subgraph group_identity["Identity and tenancy"]
  node_auth_api["Authentication API"]
  node_auth_service["Authentication service"]
  node_user_service["User management<br/>[UserService.java]"]
end

subgraph group_operations["Store operations"]
  node_store_setup["Store and branches"]
  node_catalog_stock["Catalog and inventory"]
  node_sales["Orders and payments"]
  node_returns["Refunds"]
  node_shift_reports["Shift reporting"]
  node_analytics["Analytics"]
end

subgraph group_platform["Platform services"]
  node_subscriptions["Subscriptions and plans"]
  node_gateway["Payment gateways"]
end

subgraph group_persistence["Backend persistence"]
  node_store_db[("Application database")]
end

node_platform_admin(("Platform admin"))
node_store_owner(("Store owner"))
node_branch_staff(("Branch staff"))
node_customer(("Customer"))

node_platform_admin -->|"uses platform"| node_app
node_store_owner -->|"configures store"| node_app
node_branch_staff -->|"runs branch"| node_app
node_customer -->|"receives receipt"| node_app
node_app -->|"routes by role"| node_admin_ui
node_app -->|"routes by role"| node_store_ui
node_app -->|"routes by role"| node_branch_ui
node_app -->|"routes by role"| node_cashier_ui
node_admin_ui -->|"manages plans"| node_subscriptions
node_admin_ui -->|"approves stores"| node_store_setup
node_store_ui -->|"configures branches"| node_store_setup
node_store_ui -->|"manages products"| node_catalog_stock
node_store_ui -->|"selects plan"| node_subscriptions
node_branch_ui -->|"manages stock"| node_catalog_stock
node_branch_ui -->|"views reports"| node_analytics
node_cashier_ui -->|"records sales"| node_sales
node_cashier_ui -->|"records returns"| node_returns
node_cashier_ui -->|"ends shift"| node_shift_reports
node_auth_api -.->|"delegates auth"| node_auth_service
node_auth_service -->|"loads user"| node_user_service
node_subscriptions -.->|"initiates payment"| node_gateway
node_store_setup -.->|"persists stores"| node_store_db
node_catalog_stock -.->|"persists stock"| node_store_db
node_sales -.->|"persists orders"| node_store_db

click node_app "https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/App.jsx"
click node_admin_ui "https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/SuperAdminRoutes.jsx"
click node_store_ui "https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/StoreRoutes.jsx"
click node_branch_ui "https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/BranchManagerRoutes.jsx"
click node_cashier_ui "https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/CashierRoutes.jsx"
click node_auth_api "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/controller/AuthController.java"
click node_auth_service "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/AuthServiceImpl.java"
click node_user_service "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/UserService.java"
click node_store_setup "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/StoreServiceImpl.java"
click node_catalog_stock "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/InventoryServiceImpl.java"
click node_sales "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/OrderServiceImpl.java"
click node_returns "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/RefundServiceImpl.java"
click node_shift_reports "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/ShiftReportService.java"
click node_analytics "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/StoreAnalyticsServiceImpl.java"
click node_subscriptions "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/SubscriptionService.java"
click node_gateway "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/gateway/RazorpayService.java"
click node_store_db "https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/repository/StoreRepository.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_admin_ui,node_store_ui,node_branch_ui,node_cashier_ui toneBlue
class node_auth_api,node_auth_service,node_user_service toneAmber
class node_store_setup,node_catalog_stock,node_sales,node_returns,node_shift_reports,node_analytics toneMint
class node_subscriptions,node_gateway toneRose
class node_store_db,node_platform_admin,node_store_owner,node_branch_staff,node_customer toneIndigo
```

## Components

### User applications

- [Role-based app](https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/App.jsx): `pos-frontend-vite/src/App.jsx`
- [Admin console](https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/SuperAdminRoutes.jsx): `pos-frontend-vite/src/routes/SuperAdminRoutes.jsx`
- [Store console](https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/StoreRoutes.jsx): `pos-frontend-vite/src/routes/StoreRoutes.jsx`
- [Branch console](https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/BranchManagerRoutes.jsx): `pos-frontend-vite/src/routes/BranchManagerRoutes.jsx`
- [Cashier POS](https://github.com/subhash8729/billing-system/blob/main/pos-frontend-vite/src/routes/CashierRoutes.jsx): `pos-frontend-vite/src/routes/CashierRoutes.jsx`

### Identity and tenancy

- [Authentication API](https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/controller/AuthController.java): `pos-backend/src/main/java/com/zosh/controller/AuthController.java`
- [Authentication service](https://github.com/subhash8729/billing-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`
- [User management](https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/UserService.java): `pos-backend/src/main/java/com/zosh/service/UserService.java`

### Store operations

- [Store and branches](https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/impl/StoreServiceImpl.java): `pos-backend/src/main/java/com/zosh/service/impl/StoreServiceImpl.java`
- [Catalog and inventory](https://github.com/subhash8729/billing-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`
- [Orders and payments](https://github.com/subhash8729/billing-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`
- [Refunds](https://github.com/subhash8729/billing-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`
- [Shift reporting](https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/ShiftReportService.java): `pos-backend/src/main/java/com/zosh/service/ShiftReportService.java`
- [Analytics](https://github.com/subhash8729/billing-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`

### Platform services

- [Subscriptions and plans](https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/SubscriptionService.java): `pos-backend/src/main/java/com/zosh/service/SubscriptionService.java`
- [Payment gateways](https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/service/gateway/RazorpayService.java): `pos-backend/src/main/java/com/zosh/service/gateway/RazorpayService.java`

### Backend persistence

- [Application database](https://github.com/subhash8729/billing-system/blob/main/pos-backend/src/main/java/com/zosh/repository/StoreRepository.java): `pos-backend/src/main/java/com/zosh/repository/StoreRepository.java`

### Other components

- **Platform admin**
- **Store owner**
- **Branch staff**
- **Customer**

## Connections

- Platform admin → Role-based app: uses platform (evidence: `README.md`)
- Store owner → Role-based app: configures store (evidence: `README.md`)
- Branch staff → Role-based app: runs branch (evidence: `README.md`)
- Customer → Role-based app: receives receipt (evidence: `README.md`)
- Role-based app → Admin console: routes by role (evidence: `pos-frontend-vite/src/App.jsx`)
- Role-based app → Store console: routes by role (evidence: `pos-frontend-vite/src/App.jsx`)
- Role-based app → Branch console: routes by role (evidence: `pos-frontend-vite/src/App.jsx`)
- Role-based app → Cashier POS: routes by role (evidence: `pos-frontend-vite/src/App.jsx`)
- Admin console → Subscriptions and plans: manages plans (evidence: `README.md`)
- Admin console → Store and branches: approves stores (evidence: `README.md`)
- Store console → Store and branches: configures branches (evidence: `README.md`)
- Store console → Catalog and inventory: manages products (evidence: `README.md`)
- Store console → Subscriptions and plans: selects plan (evidence: `README.md`)
- Branch console → Catalog and inventory: manages stock (evidence: `README.md`)
- Branch console → Analytics: views reports (evidence: `README.md`)
- Cashier POS → Orders and payments: records sales (evidence: `README.md`)
- Cashier POS → Refunds: records returns (evidence: `README.md`)
- Cashier POS → Shift reporting: ends shift (evidence: `README.md`)
- Authentication API → Authentication service: delegates auth
- Authentication service → User management: loads user (evidence: `pos-backend/src/main/java/com/zosh/service/impl/AuthServiceImpl.java`)
- Subscriptions and plans → Payment gateways: initiates payment
- Store and branches → Application database: persists stores
- Catalog and inventory → Application database: persists stock
- Orders and payments → Application database: persists orders
