# shabanraza/gst-accounting-software architecture

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

- Interactive diagram: https://gitdiagram.com/shabanraza/gst-accounting-software
- Repository: https://github.com/shabanraza/gst-accounting-software

## Overview

HisaabKro is a web and mobile GST billing, inventory, khata-ledger, and accounting workspace. The principal flow is a business user signing in, selecting or creating a company, maintaining parties and items, and creating sales or purchase vouchers; those transactions calculate GST and update accounting and stock records. The tRPC API exposes these domain services to the clients. Other major capabilities include payments, bank reconciliation, GST reporting, OCR-assisted purchase entry, and dashboard summaries. Source excerpts show key service calls and API registrations; unsampled capabilities are included from the README and tree.

Main entry points: [`src/integrations/trpc/router.ts`](https://github.com/shabanraza/gst-accounting-software/blob/main/src/integrations/trpc/router.ts) (tRPC API), [`src/features/purchases/purchase-bill-service.ts`](https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/purchases/purchase-bill-service.ts) (Purchase Bills), [`src/features/dashboard/dashboard-owner-service.ts`](https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/dashboard/dashboard-owner-service.ts) (Dashboard), [`src/routes/app.tsx`](https://github.com/shabanraza/gst-accounting-software/blob/main/src/routes/app.tsx) (Web Workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Workspaces"]
  node_web_workspace["Web Workspace<br/>[app.tsx]"]
  node_mobile_workspace["Mobile Workspace<br/>[dashboard.tsx]"]
end

subgraph group_access["Access and Companies"]
  node_auth["Authentication<br/>[auth-client.ts]"]
  node_company_workspace["Company Workspace"]
  node_trpc_api["tRPC API<br/>[router.ts]"]
end

subgraph group_transactions["Business Transactions"]
  node_parties["Parties<br/>[party-service.ts]"]
  node_inventory["Inventory<br/>[item-service.ts]"]
  node_sales["Sales Invoices"]
  node_purchases["Purchase Bills"]
  node_purchase_orders["Orders and GRNs"]
  node_payments["Payments and Returns"]
end

subgraph group_books["Books and Compliance"]
  node_gst["GST Compliance"]
  node_posting["Ledger Posting<br/>[posting-engine.ts]"]
  node_accounting["Accounting and Reports"]
  node_database[("PostgreSQL Data<br/>[schema.ts]")]
end

subgraph group_operations["Operations and Insight"]
  node_banking["Bank Reconciliation"]
  node_ocr["Purchase OCR"]
  node_dashboard["Dashboard"]
  node_documents["Voucher Documents"]
end

node_business_user(("Business User"))

node_business_user -->|"uses"| node_web_workspace
node_business_user -->|"uses"| node_mobile_workspace
node_web_workspace -->|"checks session"| node_auth
node_web_workspace -->|"loads companies"| node_company_workspace
node_web_workspace -->|"queries companies"| node_trpc_api
node_trpc_api -->|"registers routes"| node_company_workspace
node_trpc_api -->|"registers routes"| node_parties
node_trpc_api -->|"registers routes"| node_inventory
node_trpc_api -->|"registers routes"| node_purchases
node_trpc_api -->|"registers routes"| node_purchase_orders
node_trpc_api -->|"registers routes"| node_payments
node_trpc_api -->|"registers routes"| node_banking
node_trpc_api -->|"registers routes"| node_accounting
node_trpc_api -->|"registers routes"| node_documents
node_sales -->|"posts ledger"| node_posting
node_sales -->|"validates invoice"| node_gst
node_sales -->|"checks stock"| node_inventory
node_purchases -->|"posts ledger"| node_posting
node_purchases -->|"validates invoice"| node_gst
node_purchases -->|"records stock"| node_inventory
node_posting -.->|"persists entries"| node_database
node_banking -->|"reconciles postings"| node_posting
node_ocr -->|"prefills bills"| node_purchases
node_dashboard -->|"reads ageing"| node_accounting
node_dashboard -->|"reads invoices"| node_sales
node_dashboard -->|"reads bills"| node_purchases
node_dashboard -->|"reads stock"| node_inventory

click node_web_workspace "https://github.com/shabanraza/gst-accounting-software/blob/main/src/routes/app.tsx"
click node_mobile_workspace "https://github.com/shabanraza/gst-accounting-software/blob/main/mobile/app/(app)/(tabs)/dashboard.tsx"
click node_auth "https://github.com/shabanraza/gst-accounting-software/blob/main/src/lib/auth-client.ts"
click node_company_workspace "https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/companies"
click node_trpc_api "https://github.com/shabanraza/gst-accounting-software/blob/main/src/integrations/trpc/router.ts"
click node_parties "https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/parties/party-service.ts"
click node_inventory "https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/inventory/item-service.ts"
click node_sales "https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/sales/sales-invoice-service.ts"
click node_purchases "https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/purchases/purchase-bill-service.ts"
click node_purchase_orders "https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/purchases"
click node_payments "https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/payments"
click node_gst "https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/gst"
click node_posting "https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/accounting/posting-engine.ts"
click node_accounting "https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/accounting"
click node_database "https://github.com/shabanraza/gst-accounting-software/blob/main/src/db/schema.ts"
click node_banking "https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/banking"
click node_ocr "https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/ocr"
click node_dashboard "https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/dashboard/dashboard-owner-service.ts"
click node_documents "https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/documents"

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_web_workspace,node_mobile_workspace,node_business_user toneBlue
class node_auth,node_company_workspace,node_trpc_api toneAmber
class node_parties,node_inventory,node_sales,node_purchases,node_purchase_orders,node_payments toneMint
class node_gst,node_posting,node_accounting,node_database toneRose
class node_banking,node_ocr,node_dashboard,node_documents toneIndigo
```

## Components

### User Workspaces

- [Web Workspace](https://github.com/shabanraza/gst-accounting-software/blob/main/src/routes/app.tsx): `src/routes/app.tsx`
- [Mobile Workspace](https://github.com/shabanraza/gst-accounting-software/blob/main/mobile/app/(app)/(tabs)/dashboard.tsx): `mobile/app/(app)/(tabs)/dashboard.tsx`

### Access and Companies

- [Authentication](https://github.com/shabanraza/gst-accounting-software/blob/main/src/lib/auth-client.ts): `src/lib/auth-client.ts`
- [Company Workspace](https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/companies): `src/features/companies`
- [tRPC API](https://github.com/shabanraza/gst-accounting-software/blob/main/src/integrations/trpc/router.ts): `src/integrations/trpc/router.ts`

### Business Transactions

- [Parties](https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/parties/party-service.ts): `src/features/parties/party-service.ts`
- [Inventory](https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/inventory/item-service.ts): `src/features/inventory/item-service.ts`
- [Sales Invoices](https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/sales/sales-invoice-service.ts): `src/features/sales/sales-invoice-service.ts`
- [Purchase Bills](https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/purchases/purchase-bill-service.ts): `src/features/purchases/purchase-bill-service.ts`
- [Orders and GRNs](https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/purchases): `src/features/purchases`
- [Payments and Returns](https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/payments): `src/features/payments`

### Books and Compliance

- [GST Compliance](https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/gst): `src/features/gst`
- [Ledger Posting](https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/accounting/posting-engine.ts): `src/features/accounting/posting-engine.ts`
- [Accounting and Reports](https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/accounting): `src/features/accounting`
- [PostgreSQL Data](https://github.com/shabanraza/gst-accounting-software/blob/main/src/db/schema.ts): `src/db/schema.ts`

### Operations and Insight

- [Bank Reconciliation](https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/banking): `src/features/banking`
- [Purchase OCR](https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/ocr): `src/features/ocr`
- [Dashboard](https://github.com/shabanraza/gst-accounting-software/blob/main/src/features/dashboard/dashboard-owner-service.ts): `src/features/dashboard/dashboard-owner-service.ts`
- [Voucher Documents](https://github.com/shabanraza/gst-accounting-software/tree/main/src/features/documents): `src/features/documents`

### Other components

- **Business User**

## Connections

- Business User → Web Workspace: uses
- Business User → Mobile Workspace: uses
- Web Workspace → Authentication: checks session (evidence: `src/routes/app.tsx`)
- Web Workspace → Company Workspace: loads companies (evidence: `src/routes/app.tsx`)
- Web Workspace → tRPC API: queries companies (evidence: `src/routes/app.tsx`)
- tRPC API → Company Workspace: registers routes (evidence: `src/integrations/trpc/router.ts`)
- tRPC API → Parties: registers routes (evidence: `src/integrations/trpc/router.ts`)
- tRPC API → Inventory: registers routes (evidence: `src/integrations/trpc/router.ts`)
- tRPC API → Purchase Bills: registers routes (evidence: `src/integrations/trpc/router.ts`)
- tRPC API → Orders and GRNs: registers routes (evidence: `src/integrations/trpc/router.ts`)
- tRPC API → Payments and Returns: registers routes (evidence: `src/integrations/trpc/router.ts`)
- tRPC API → Bank Reconciliation: registers routes (evidence: `src/integrations/trpc/router.ts`)
- tRPC API → Accounting and Reports: registers routes (evidence: `src/integrations/trpc/router.ts`)
- tRPC API → Voucher Documents: registers routes (evidence: `src/integrations/trpc/router.ts`)
- Sales Invoices → Ledger Posting: posts ledger (evidence: `src/features/sales/sales-invoice-service.ts`)
- Sales Invoices → GST Compliance: validates invoice (evidence: `src/features/sales/sales-invoice-service.ts`)
- Sales Invoices → Inventory: checks stock (evidence: `src/features/sales/sales-invoice-service.ts`)
- Purchase Bills → Ledger Posting: posts ledger (evidence: `src/features/purchases/purchase-bill-service.ts`)
- Purchase Bills → GST Compliance: validates invoice (evidence: `src/features/purchases/purchase-bill-service.ts`)
- Purchase Bills → Inventory: records stock (evidence: `src/features/purchases/purchase-bill-service.ts`)
- Ledger Posting → PostgreSQL Data: persists entries
- Bank Reconciliation → Ledger Posting: reconciles postings (evidence: `src/features/banking/bank-reconciliation-service.ts`)
- Purchase OCR → Purchase Bills: prefills bills (evidence: `src/features/ocr/ocr-draft-service.ts`)
- Dashboard → Accounting and Reports: reads ageing (evidence: `src/features/dashboard/dashboard-owner-service.ts`)
- Dashboard → Sales Invoices: reads invoices (evidence: `src/features/dashboard/dashboard-owner-service.ts`)
- Dashboard → Purchase Bills: reads bills (evidence: `src/features/dashboard/dashboard-owner-service.ts`)
- Dashboard → Inventory: reads stock (evidence: `src/features/dashboard/dashboard-owner-service.ts`)
