# vishal343012/erp-project architecture

> Architecture diagram of the GitHub repository vishal343012/erp-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishal343012/erp-project
- Repository: https://github.com/vishal343012/erp-project

## Overview

This is a small Node/Express ERP proof of concept: a browser dashboard loads customer data, summary metrics, and database health, and can submit new customers. The server exposes those API operations and uses PostgreSQL for health checks and customer reads/writes; invoice and revenue figures are demo placeholders. The README describes a customers schema that does not match the insert/read fields shown in server.js, so persistence may require schema alignment. The graph reflects the sampled files and documented capabilities; it does not infer additional ERP modules.

Main entry points: [`public/app.js`](https://github.com/vishal343012/erp-project/blob/main/public/app.js) (Dashboard UI), [`server.js`](https://github.com/vishal343012/erp-project/blob/main/server.js) (Customer API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_ui["Dashboard UI<br/>[app.js]"]
end

subgraph group_api["API"]
  node_customer_api["Customer API<br/>[server.js]"]
  node_summary_api["Summary API<br/>[server.js]"]
  node_health_api["Health API<br/>[server.js]"]
end

subgraph group_persistence["Persistence"]
  node_postgres[("PostgreSQL")]
end

node_browser(("Browser user"))

node_browser -->|"uses"| node_dashboard_ui
node_dashboard_ui -->|"requests customers"| node_customer_api
node_dashboard_ui -->|"submits customer"| node_customer_api
node_dashboard_ui -->|"requests summary"| node_summary_api
node_dashboard_ui -->|"checks health"| node_health_api
node_customer_api -->|"reads and writes"| node_postgres
node_summary_api -->|"counts customers"| node_postgres
node_health_api -->|"tests connection"| node_postgres

click node_dashboard_ui "https://github.com/vishal343012/erp-project/blob/main/public/app.js"
click node_customer_api "https://github.com/vishal343012/erp-project/blob/main/server.js"
click node_summary_api "https://github.com/vishal343012/erp-project/blob/main/server.js"
click node_health_api "https://github.com/vishal343012/erp-project/blob/main/server.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_dashboard_ui,node_browser toneBlue
class node_customer_api,node_summary_api,node_health_api toneAmber
class node_postgres toneMint
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/vishal343012/erp-project/blob/main/public/app.js): `public/app.js`

### API

- [Customer API](https://github.com/vishal343012/erp-project/blob/main/server.js): `server.js`
- [Summary API](https://github.com/vishal343012/erp-project/blob/main/server.js): `server.js`
- [Health API](https://github.com/vishal343012/erp-project/blob/main/server.js): `server.js`

### Persistence

- **PostgreSQL**

### Other components

- **Browser user**

## Connections

- Browser user → Dashboard UI: uses (evidence: `public/app.js`)
- Dashboard UI → Customer API: requests customers (evidence: `public/app.js`)
- Dashboard UI → Customer API: submits customer (evidence: `public/app.js`)
- Dashboard UI → Summary API: requests summary (evidence: `public/app.js`)
- Dashboard UI → Health API: checks health (evidence: `public/app.js`)
- Customer API → PostgreSQL: reads and writes (evidence: `server.js`)
- Summary API → PostgreSQL: counts customers (evidence: `server.js`)
- Health API → PostgreSQL: tests connection (evidence: `server.js`)
