# nanthakumaran120/billing-software architecture

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

- Interactive diagram: https://gitdiagram.com/nanthakumaran120/billing-software
- Repository: https://github.com/nanthakumaran120/billing-software

## Overview

Srinivasa Billing is a desktop/web billing and invoice-management application. Staff log in, enter customer and product details, calculate taxes and totals, preview/print an invoice, and save it; they can then review, cancel, and export invoice reports. The React app uses an HTTP API backed by server-side persistence, while the Electron shell adds native printing and file dialogs. The README describes JSON data and report files; sampled server code also shows SQLite operations and JSON migration. Some routes and component behavior were not sampled, so only evidenced links are drawn.

Main entry points: [`src/App.jsx`](https://github.com/nanthakumaran120/billing-software/blob/main/src/App.jsx) (Application shell), [`src/services/api.js`](https://github.com/nanthakumaran120/billing-software/blob/main/src/services/api.js) (API client), [`src/components/PrintPreview.jsx`](https://github.com/nanthakumaran120/billing-software/blob/main/src/components/PrintPreview.jsx) (Invoice preview), [`server.js`](https://github.com/nanthakumaran120/billing-software/blob/main/server.js) (Express API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Billing interface"]
  node_app["Application shell<br/>[App.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_customers["Customer entry"]
  node_products["Product entry<br/>[ProductTable.jsx]"]
  node_totals["Tax summary<br/>[SummarySection.jsx]"]
  node_preview["Invoice preview<br/>[PrintPreview.jsx]"]
  node_printsettings["Print settings<br/>[PrintSettings.jsx]"]
end

subgraph group_records["Invoice operations"]
  node_reports["Invoice reports<br/>[ReportList.jsx]"]
  node_cancellation["Bill cancellation<br/>[CancelBill.jsx]"]
end

subgraph group_backend["API and persistence"]
  node_api_client["API client<br/>[api.js]"]
  node_server["Express API<br/>[server.js]"]
  node_database[("Billing database<br/>[billing.db]")]
  node_jsondata[("JSON records<br/>[customerdb.json]")]
  node_invoicefiles["Invoice reports"]
end

subgraph group_desktop["Desktop printing"]
  node_electron["Electron shell<br/>[main.cjs]"]
  node_printipc["Native print handlers<br/>[ipcPrint.cjs]"]
end

node_staff(("Billing staff"))
node_os_printer(("System printers"))

node_staff -->|"uses"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_customers
node_app -->|"renders"| node_products
node_app -->|"renders"| node_totals
node_app -->|"renders"| node_preview
node_app -->|"renders"| node_reports
node_app -->|"renders"| node_cancellation
node_customers -->|"loads and saves"| node_api_client
node_products -->|"loads and saves"| node_api_client
node_app -->|"saves invoices"| node_api_client
node_app -->|"loads settings"| node_api_client
node_reports -->|"loads and exports"| node_api_client
node_cancellation -->|"cancels invoices"| node_api_client
node_preview -->|"renders"| node_customers
node_preview -->|"renders"| node_products
node_preview -->|"renders"| node_totals
node_preview -->|"renders"| node_printsettings
node_preview -->|"uploads PDF"| node_api_client
node_api_client -->|"requests routes"| node_server
node_server -->|"reads and writes"| node_database
node_server -->|"migrates records"| node_jsondata
node_server -->|"writes reports"| node_invoicefiles
node_electron -->|"starts process"| node_server
node_electron -->|"registers handlers"| node_printipc
node_printipc -->|"queries and prints"| node_os_printer

click node_app "https://github.com/nanthakumaran120/billing-software/blob/main/src/App.jsx"
click node_login "https://github.com/nanthakumaran120/billing-software/blob/main/src/components/Login.jsx"
click node_customers "https://github.com/nanthakumaran120/billing-software/blob/main/src/components/CustomerSection.jsx"
click node_products "https://github.com/nanthakumaran120/billing-software/blob/main/src/components/ProductTable.jsx"
click node_totals "https://github.com/nanthakumaran120/billing-software/blob/main/src/components/SummarySection.jsx"
click node_preview "https://github.com/nanthakumaran120/billing-software/blob/main/src/components/PrintPreview.jsx"
click node_printsettings "https://github.com/nanthakumaran120/billing-software/blob/main/src/components/PrintSettings.jsx"
click node_api_client "https://github.com/nanthakumaran120/billing-software/blob/main/src/services/api.js"
click node_reports "https://github.com/nanthakumaran120/billing-software/blob/main/src/components/ReportList.jsx"
click node_cancellation "https://github.com/nanthakumaran120/billing-software/blob/main/src/components/CancelBill.jsx"
click node_server "https://github.com/nanthakumaran120/billing-software/blob/main/server.js"
click node_database "https://github.com/nanthakumaran120/billing-software/blob/main/data/billing.db"
click node_jsondata "https://github.com/nanthakumaran120/billing-software/blob/main/data/customerdb.json"
click node_invoicefiles "https://github.com/nanthakumaran120/billing-software/tree/main/data/invoices"
click node_electron "https://github.com/nanthakumaran120/billing-software/blob/main/electron/main.cjs"
click node_printipc "https://github.com/nanthakumaran120/billing-software/blob/main/electron/ipcPrint.cjs"

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_login,node_customers,node_products,node_totals,node_preview,node_printsettings toneBlue
class node_reports,node_cancellation toneAmber
class node_api_client,node_server,node_database,node_jsondata,node_invoicefiles toneMint
class node_electron,node_printipc toneRose
class node_staff,node_os_printer toneIndigo
```

## Components

### Billing interface

- [Application shell](https://github.com/nanthakumaran120/billing-software/blob/main/src/App.jsx): `src/App.jsx`
- [Login](https://github.com/nanthakumaran120/billing-software/blob/main/src/components/Login.jsx): `src/components/Login.jsx`
- [Customer entry](https://github.com/nanthakumaran120/billing-software/blob/main/src/components/CustomerSection.jsx): `src/components/CustomerSection.jsx`
- [Product entry](https://github.com/nanthakumaran120/billing-software/blob/main/src/components/ProductTable.jsx): `src/components/ProductTable.jsx`
- [Tax summary](https://github.com/nanthakumaran120/billing-software/blob/main/src/components/SummarySection.jsx): `src/components/SummarySection.jsx`
- [Invoice preview](https://github.com/nanthakumaran120/billing-software/blob/main/src/components/PrintPreview.jsx): `src/components/PrintPreview.jsx`
- [Print settings](https://github.com/nanthakumaran120/billing-software/blob/main/src/components/PrintSettings.jsx): `src/components/PrintSettings.jsx`

### Invoice operations

- [Invoice reports](https://github.com/nanthakumaran120/billing-software/blob/main/src/components/ReportList.jsx): `src/components/ReportList.jsx`
- [Bill cancellation](https://github.com/nanthakumaran120/billing-software/blob/main/src/components/CancelBill.jsx): `src/components/CancelBill.jsx`

### API and persistence

- [API client](https://github.com/nanthakumaran120/billing-software/blob/main/src/services/api.js): `src/services/api.js`
- [Express API](https://github.com/nanthakumaran120/billing-software/blob/main/server.js): `server.js`
- [Billing database](https://github.com/nanthakumaran120/billing-software/blob/main/data/billing.db): `data/billing.db`
- [JSON records](https://github.com/nanthakumaran120/billing-software/blob/main/data/customerdb.json): `data/customerdb.json`
- [Invoice reports](https://github.com/nanthakumaran120/billing-software/tree/main/data/invoices): `data/invoices`

### Desktop printing

- [Electron shell](https://github.com/nanthakumaran120/billing-software/blob/main/electron/main.cjs): `electron/main.cjs`
- [Native print handlers](https://github.com/nanthakumaran120/billing-software/blob/main/electron/ipcPrint.cjs): `electron/ipcPrint.cjs`

### Other components

- **Billing staff**
- **System printers**

## Connections

- Billing staff → Application shell: uses (evidence: `src/App.jsx`)
- Application shell → Login: renders (evidence: `src/App.jsx`)
- Application shell → Customer entry: renders (evidence: `src/App.jsx`)
- Application shell → Product entry: renders (evidence: `src/App.jsx`)
- Application shell → Tax summary: renders (evidence: `src/App.jsx`)
- Application shell → Invoice preview: renders (evidence: `src/App.jsx`)
- Application shell → Invoice reports: renders (evidence: `src/App.jsx`)
- Application shell → Bill cancellation: renders (evidence: `src/App.jsx`)
- Customer entry → API client: loads and saves (evidence: `src/components/CustomerSection.jsx`)
- Product entry → API client: loads and saves (evidence: `src/components/ProductTable.jsx`)
- Application shell → API client: saves invoices (evidence: `src/App.jsx`)
- Application shell → API client: loads settings (evidence: `src/App.jsx`)
- Invoice reports → API client: loads and exports (evidence: `src/components/ReportList.jsx`)
- Bill cancellation → API client: cancels invoices (evidence: `src/components/CancelBill.jsx`)
- Invoice preview → Customer entry: renders (evidence: `src/components/PrintPreview.jsx`)
- Invoice preview → Product entry: renders (evidence: `src/components/PrintPreview.jsx`)
- Invoice preview → Tax summary: renders (evidence: `src/components/PrintPreview.jsx`)
- Invoice preview → Print settings: renders (evidence: `src/components/PrintPreview.jsx`)
- Invoice preview → API client: uploads PDF (evidence: `src/components/PrintPreview.jsx`)
- API client → Express API: requests routes (evidence: `src/services/api.js`)
- Express API → Billing database: reads and writes (evidence: `server.js`)
- Express API → JSON records: migrates records (evidence: `server.js`)
- Express API → Invoice reports: writes reports (evidence: `server.js`)
- Electron shell → Express API: starts process (evidence: `electron/main.cjs`)
- Electron shell → Native print handlers: registers handlers (evidence: `electron/main.cjs`)
- Native print handlers → System printers: queries and prints (evidence: `electron/ipcPrint.cjs`)
