# bharathkumar-c/billdeskpro architecture

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

- Interactive diagram: https://gitdiagram.com/bharathkumar-c/billdeskpro
- Repository: https://github.com/bharathkumar-c/billdeskpro

## Overview

BillDeskPro is a web billing application for business staff. Users sign in, manage products and customers, create and track invoices, and review sales analytics. The React pages call the Express API through a shared Axios client; API routes dispatch to controllers, which query MySQL. The README documents CSV reporting and invoice printing/PDF download; those capabilities are retained as part of the relevant UI workflows, though their implementation details were not sampled. Edges reflect explicit imports, route registration, or documented client/API use; unsampled links are omitted.

Main entry points: [`client/src/App.js`](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/App.js) (App routing), [`client/src/utils/api.js`](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/utils/api.js) (API client), [`server/index.js`](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/index.js) (HTTP application), [`server/config/db.js`](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/config/db.js) (MySQL access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App routing<br/>[App.js]"]
  node_login["Sign in<br/>[Login.js]"]
  node_authctx["Session context<br/>[AuthContext.js]"]
  node_layout["Workspace layout<br/>[Layout.js]"]
  node_dashboard["Dashboard<br/>[Dashboard.js]"]
  node_productsui["Product management<br/>[Products.js]"]
  node_customersui["Customer management<br/>[Customers.js]"]
  node_invoicesui["Invoice history<br/>[Invoices.js]"]
  node_newinvoice["Invoice creation<br/>[NewInvoice.js]"]
  node_invoicedetail["Invoice detail<br/>[InvoiceDetail.js]"]
  node_reportsui["Reports and export<br/>[Reports.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and access"]
  node_server["HTTP application<br/>[index.js]"]
  node_authmw["JWT authorization<br/>[auth.js]"]
  node_setup["Schema setup<br/>[setup.js]"]
end

subgraph group_domain["Billing services"]
  node_authcontroller["Authentication<br/>[authController.js]"]
  node_productcontroller["Product service"]
  node_customercontroller["Customer service"]
  node_invoicecontroller["Invoice service"]
  node_reportcontroller["Reporting service"]
end

subgraph group_storage["Persistence"]
  node_dbpool["MySQL access<br/>[db.js]"]
  node_mysql[("MySQL database")]
end

node_staff(("Business staff"))

node_staff -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_productsui
node_app -->|"routes to"| node_customersui
node_app -->|"routes to"| node_invoicesui
node_app -->|"routes to"| node_newinvoice
node_app -->|"routes to"| node_invoicedetail
node_app -->|"routes to"| node_reportsui
node_app -->|"provides"| node_authctx
node_app -->|"routes through"| node_layout
node_authctx -->|"calls"| node_api_client
node_login -->|"uses"| node_authctx
node_dashboard -->|"requests data"| node_api_client
node_productsui -->|"requests data"| node_api_client
node_customersui -->|"requests data"| node_api_client
node_invoicesui -->|"requests data"| node_api_client
node_newinvoice -->|"requests data"| node_api_client
node_invoicedetail -->|"requests data"| node_api_client
node_reportsui -->|"requests data"| node_api_client
node_api_client -->|"calls API"| node_server
node_server -->|"mounts routes"| node_authcontroller
node_server -->|"mounts routes"| node_productcontroller
node_server -->|"mounts routes"| node_customercontroller
node_server -->|"mounts routes"| node_invoicecontroller
node_server -->|"mounts routes"| node_reportcontroller
node_server -->|"mounts routes"| node_setup
node_authcontroller -->|"queries"| node_dbpool
node_productcontroller -->|"queries"| node_dbpool
node_customercontroller -->|"queries"| node_dbpool
node_invoicecontroller -->|"queries"| node_dbpool
node_reportcontroller -->|"queries"| node_dbpool
node_setup -->|"uses"| node_dbpool
node_dbpool -->|"connects"| node_mysql

click node_app "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/App.js"
click node_login "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Login.js"
click node_authctx "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/context/AuthContext.js"
click node_layout "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/components/Layout.js"
click node_dashboard "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Dashboard.js"
click node_productsui "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Products.js"
click node_customersui "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Customers.js"
click node_invoicesui "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Invoices.js"
click node_newinvoice "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/NewInvoice.js"
click node_invoicedetail "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/InvoiceDetail.js"
click node_reportsui "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Reports.js"
click node_api_client "https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/utils/api.js"
click node_server "https://github.com/bharathkumar-c/billdeskpro/blob/main/server/index.js"
click node_authmw "https://github.com/bharathkumar-c/billdeskpro/blob/main/server/middleware/auth.js"
click node_authcontroller "https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/authController.js"
click node_productcontroller "https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/productController.js"
click node_customercontroller "https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/customerController.js"
click node_invoicecontroller "https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/invoiceController.js"
click node_reportcontroller "https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/reportController.js"
click node_dbpool "https://github.com/bharathkumar-c/billdeskpro/blob/main/server/config/db.js"
click node_setup "https://github.com/bharathkumar-c/billdeskpro/blob/main/server/routes/setup.js"

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_authctx,node_layout,node_dashboard,node_productsui,node_customersui,node_invoicesui,node_newinvoice,node_invoicedetail,node_reportsui,node_api_client toneBlue
class node_server,node_authmw,node_setup toneAmber
class node_authcontroller,node_productcontroller,node_customercontroller,node_invoicecontroller,node_reportcontroller toneMint
class node_dbpool,node_mysql toneRose
class node_staff toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/App.js): `client/src/App.js`
- [Sign in](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Login.js): `client/src/pages/Login.js`
- [Session context](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/context/AuthContext.js): `client/src/context/AuthContext.js`
- [Workspace layout](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/components/Layout.js): `client/src/components/Layout.js`
- [Dashboard](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Dashboard.js): `client/src/pages/Dashboard.js`
- [Product management](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Products.js): `client/src/pages/Products.js`
- [Customer management](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Customers.js): `client/src/pages/Customers.js`
- [Invoice history](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Invoices.js): `client/src/pages/Invoices.js`
- [Invoice creation](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/NewInvoice.js): `client/src/pages/NewInvoice.js`
- [Invoice detail](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/InvoiceDetail.js): `client/src/pages/InvoiceDetail.js`
- [Reports and export](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/pages/Reports.js): `client/src/pages/Reports.js`
- [API client](https://github.com/bharathkumar-c/billdeskpro/blob/main/client/src/utils/api.js): `client/src/utils/api.js`

### API and access

- [HTTP application](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/index.js): `server/index.js`
- [JWT authorization](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [Schema setup](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/routes/setup.js): `server/routes/setup.js`

### Billing services

- [Authentication](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [Product service](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/productController.js): `server/controllers/productController.js`
- [Customer service](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/customerController.js): `server/controllers/customerController.js`
- [Invoice service](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/invoiceController.js): `server/controllers/invoiceController.js`
- [Reporting service](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/controllers/reportController.js): `server/controllers/reportController.js`

### Persistence

- [MySQL access](https://github.com/bharathkumar-c/billdeskpro/blob/main/server/config/db.js): `server/config/db.js`
- **MySQL database**

### Other components

- **Business staff**

## Connections

- Business staff → App routing: uses (evidence: `README.md`)
- App routing → Sign in: routes to (evidence: `client/src/App.js`)
- App routing → Dashboard: routes to (evidence: `client/src/App.js`)
- App routing → Product management: routes to (evidence: `client/src/App.js`)
- App routing → Customer management: routes to (evidence: `client/src/App.js`)
- App routing → Invoice history: routes to (evidence: `client/src/App.js`)
- App routing → Invoice creation: routes to (evidence: `client/src/App.js`)
- App routing → Invoice detail: routes to (evidence: `client/src/App.js`)
- App routing → Reports and export: routes to (evidence: `client/src/App.js`)
- App routing → Session context: provides (evidence: `client/src/App.js`)
- App routing → Workspace layout: routes through (evidence: `client/src/App.js`)
- Session context → API client: calls (evidence: `client/src/context/AuthContext.js`)
- Sign in → Session context: uses (evidence: `client/src/pages/Login.js`)
- Dashboard → API client: requests data (evidence: `client/src/pages/Dashboard.js`)
- Product management → API client: requests data (evidence: `client/src/pages/Products.js`)
- Customer management → API client: requests data (evidence: `client/src/pages/Customers.js`)
- Invoice history → API client: requests data (evidence: `client/src/pages/Invoices.js`)
- Invoice creation → API client: requests data (evidence: `client/src/pages/NewInvoice.js`)
- Invoice detail → API client: requests data (evidence: `client/src/pages/InvoiceDetail.js`)
- Reports and export → API client: requests data (evidence: `client/src/pages/Reports.js`)
- API client → HTTP application: calls API (evidence: `README.md`)
- HTTP application → Authentication: mounts routes (evidence: `server/index.js`)
- HTTP application → Product service: mounts routes (evidence: `server/index.js`)
- HTTP application → Customer service: mounts routes (evidence: `server/index.js`)
- HTTP application → Invoice service: mounts routes (evidence: `server/index.js`)
- HTTP application → Reporting service: mounts routes (evidence: `server/index.js`)
- HTTP application → Schema setup: mounts routes (evidence: `server/index.js`)
- Authentication → MySQL access: queries (evidence: `server/controllers/authController.js`)
- Product service → MySQL access: queries (evidence: `server/controllers/productController.js`)
- Customer service → MySQL access: queries (evidence: `server/controllers/customerController.js`)
- Invoice service → MySQL access: queries (evidence: `server/controllers/invoiceController.js`)
- Reporting service → MySQL access: queries (evidence: `server/controllers/reportController.js`)
- Schema setup → MySQL access: uses (evidence: `server/routes/setup.js`)
- MySQL access → MySQL database: connects (evidence: `README.md`)
