# chandru-webdev/jewellry-shop---billing-sysyem architecture

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

- Interactive diagram: https://gitdiagram.com/chandru-webdev/jewellry-shop---billing-sysyem
- Repository: https://github.com/chandru-webdev/jewellry-shop---billing-sysyem

## Overview

Opal Line ERP is a jewellery-business billing and operations system. Staff use the React application to manage products, silver-rate pricing, inventory, POS sales, purchasing, accounts, and reporting; requests pass through the Express API and business services to PostgreSQL. Authentication and role permissions protect the workflow, while Shopify synchronization is an optional integration. The README documents the broad backend layering and product capabilities; several domain-specific route and service implementations were not sampled, so their internal links are not expanded.

Main entry points: [`backend/src/services`](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/backend/src/services) (Business services), [`frontend/src/App.jsx`](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/frontend/src/App.jsx) (React application), [`backend/src/controllers`](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/backend/src/controllers) (HTTP controllers), [`frontend/src/api/client.js`](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/frontend/src/api/client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_web["React application<br/>[App.jsx]"]
  node_identity["Session and permissions<br/>[AuthContext.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_domain_pages["ERP screens"]
end

subgraph group_api["Backend API"]
  node_server["Express application<br/>[app.js]"]
  node_routes["API routes"]
  node_controllers["HTTP controllers"]
  node_services["Business services"]
  node_database_client["Prisma client<br/>[client.js]"]
end

subgraph group_commerce["Commerce operations"]
  node_catalog["Products and categories<br/>[product.service.js]"]
  node_rates["Silver pricing"]
  node_stock["Inventory ledger"]
  node_sales["POS and invoices<br/>[order.service.js]"]
  node_purchasing["Purchases and suppliers"]
end

subgraph group_finance["Finance and insights"]
  node_accounts["Payments and ledger<br/>[payment.service.js]"]
  node_insights["Dashboard and reports<br/>[report.service.js]"]
end

subgraph group_integrations["Integrations"]
  node_shopify_sync["Shopify synchronization<br/>[shopify.service.js]"]
end

node_staff(("Staff user"))
node_postgres[("ERP database")]
node_shopify["Shopify"]

node_staff -->|"uses"| node_web
node_web -->|"routes to"| node_domain_pages
node_web -->|"provides session"| node_identity
node_identity -->|"requests identity"| node_api_client
node_domain_pages -.->|"calls"| node_api_client
node_api_client -->|"sends API requests"| node_server
node_server -->|"mounts"| node_routes
node_routes -->|"dispatches"| node_controllers
node_controllers -->|"delegates"| node_services
node_services -->|"uses"| node_database_client
node_database_client -->|"queries"| node_postgres
node_services -.->|"implements"| node_catalog
node_services -.->|"implements"| node_rates
node_services -.->|"implements"| node_stock
node_services -.->|"implements"| node_sales
node_services -.->|"implements"| node_purchasing
node_services -.->|"implements"| node_accounts
node_services -.->|"implements"| node_insights
node_controllers -->|"invokes"| node_shopify_sync
node_shopify_sync -.->|"synchronizes"| node_shopify

click node_web "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/frontend/src/App.jsx"
click node_identity "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/frontend/src/context/AuthContext.jsx"
click node_api_client "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/frontend/src/api/client.js"
click node_domain_pages "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/frontend/src/pages"
click node_server "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/app.js"
click node_routes "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/backend/src/routes"
click node_controllers "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/backend/src/controllers"
click node_services "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/backend/src/services"
click node_database_client "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/prisma/client.js"
click node_catalog "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/product.service.js"
click node_rates "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/metalRate.service.js"
click node_stock "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/inventory.service.js"
click node_sales "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/order.service.js"
click node_purchasing "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/purchaseOrder.service.js"
click node_accounts "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/payment.service.js"
click node_insights "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/report.service.js"
click node_shopify_sync "https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/shopify.service.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_web,node_identity,node_api_client,node_domain_pages,node_staff toneBlue
class node_server,node_routes,node_controllers,node_services,node_database_client,node_postgres toneAmber
class node_catalog,node_rates,node_stock,node_sales,node_purchasing toneMint
class node_accounts,node_insights toneRose
class node_shopify_sync,node_shopify toneIndigo
```

## Components

### Web application

- [React application](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session and permissions](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [ERP screens](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/frontend/src/pages): `frontend/src/pages`

### Backend API

- [Express application](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/app.js): `backend/src/app.js`
- [API routes](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/backend/src/routes): `backend/src/routes`
- [HTTP controllers](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/backend/src/controllers): `backend/src/controllers`
- [Business services](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/tree/main/backend/src/services): `backend/src/services`
- [Prisma client](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/prisma/client.js): `backend/src/prisma/client.js`

### Commerce operations

- [Products and categories](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/product.service.js): `backend/src/services/product.service.js`
- [Silver pricing](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/metalRate.service.js): `backend/src/services/metalRate.service.js`
- [Inventory ledger](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/inventory.service.js): `backend/src/services/inventory.service.js`
- [POS and invoices](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/order.service.js): `backend/src/services/order.service.js`
- [Purchases and suppliers](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/purchaseOrder.service.js): `backend/src/services/purchaseOrder.service.js`

### Finance and insights

- [Payments and ledger](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/payment.service.js): `backend/src/services/payment.service.js`
- [Dashboard and reports](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/report.service.js): `backend/src/services/report.service.js`

### Integrations

- [Shopify synchronization](https://github.com/chandru-webdev/jewellry-shop---billing-sysyem/blob/main/backend/src/services/shopify.service.js): `backend/src/services/shopify.service.js`

### Other components

- **Staff user**
- **ERP database**
- **Shopify**

## Connections

- Staff user → React application: uses
- React application → ERP screens: routes to (evidence: `frontend/src/App.jsx`)
- React application → Session and permissions: provides session (evidence: `frontend/src/main.jsx`)
- Session and permissions → API client: requests identity (evidence: `frontend/src/context/AuthContext.jsx`)
- ERP screens → API client: calls
- API client → Express application: sends API requests
- Express application → API routes: mounts (evidence: `backend/src/app.js`)
- API routes → HTTP controllers: dispatches (evidence: `backend/src/routes/shopify.routes.js`)
- HTTP controllers → Business services: delegates (evidence: `backend/src/controllers/shopify.controller.js`)
- Business services → Prisma client: uses (evidence: `backend/src/services/auth.service.js`)
- Prisma client → ERP database: queries (evidence: `backend/src/prisma/client.js`)
- Business services → Products and categories: implements
- Business services → Silver pricing: implements
- Business services → Inventory ledger: implements
- Business services → POS and invoices: implements
- Business services → Purchases and suppliers: implements
- Business services → Payments and ledger: implements
- Business services → Dashboard and reports: implements
- HTTP controllers → Shopify synchronization: invokes (evidence: `backend/src/controllers/shopify.controller.js`)
- Shopify synchronization → Shopify: synchronizes
