# vnc-automation/quote_calc_develop architecture

> Architecture diagram of the GitHub repository vnc-automation/quote_calc_develop, 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/vnc-automation/quote_calc_develop
- Repository: https://github.com/vnc-automation/quote_calc_develop

## Overview

VNC Group’s Quote Calculator is a client-facing, configuration-driven quote builder with authenticated client, team, and admin areas. The main journey collects client details, selects services, configures them, calculates and reviews an estimate, then saves or exports the quote. SQLite-backed pricing settings and subscriptions are managed through the admin area. The README and sampled imports support the calculator and pricing-layer links; several dashboard and API internals are unsampled, so those subsystems are represented at directory level and uncertain connections are omitted.

Main entry points: [`pages/index.js`](https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/index.js) (Quote workflow), [`services/pricingService.js`](https://github.com/vnc-automation/quote_calc_develop/blob/main/services/pricingService.js) (Pricing data service), [`pages/api/quotes`](https://github.com/vnc-automation/quote_calc_develop/tree/main/pages/api/quotes) (Saved quotes API), [`db/index.js`](https://github.com/vnc-automation/quote_calc_develop/blob/main/db/index.js) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_quote_flow["Quote workflow"]
  node_client_info["Client details<br/>[Step0ClientInfo.js]"]
  node_service_selection["Select services"]
  node_service_configuration["Configure services"]
  node_quote_page["Quote workflow<br/>[index.js]"]
  node_quote_review["Review quote"]
  node_pdf["PDF export<br/>[pdfGenerator.js]"]
end

subgraph group_pricing["Pricing configuration"]
  node_schema["Service schema<br/>[serviceSchema.js]"]
  node_seed_data["Pricing defaults<br/>[seedData.js]"]
  node_engine["Quote calculation<br/>[computeQuote.js]"]
  node_pricing_service["Pricing data service<br/>[pricingService.js]"]
end

subgraph group_platform["Accounts and quotes"]
  node_quote_api["Quote endpoint<br/>[quote.js]"]
  node_quotes_api["Saved quotes API"]
  node_database[("SQLite database<br/>[index.js]")]
  node_auth["Session authentication<br/>[auth.js]"]
  node_client_portal["Client portal<br/>[dashboard.js]"]
  node_team_portal["Team portal<br/>[team.js]"]
end

subgraph group_operations["Administration"]
  node_admin_page["Admin page<br/>[index.js]"]
  node_admin_panel["Admin controls<br/>[AdminPanel.js]"]
  node_admin_api["Admin API"]
end

node_client(("Client"))

node_client -->|"starts quote"| node_quote_page
node_quote_page -->|"renders details"| node_client_info
node_quote_page -->|"renders selection"| node_service_selection
node_quote_page -->|"renders configuration"| node_service_configuration
node_quote_page -->|"renders review"| node_quote_review
node_quote_page -->|"calculates quote"| node_engine
node_quote_page -.->|"requests pricing"| node_quote_api
node_quote_page -->|"saves quote"| node_quotes_api
node_quote_review -->|"exports PDF"| node_pdf
node_quote_api -->|"requests calculation"| node_pricing_service
node_quotes_api -->|"uses quote service"| node_pricing_service
node_quotes_api -->|"accesses records"| node_database
node_quotes_api -->|"checks access"| node_auth
node_pricing_service -->|"reads settings"| node_database
node_pricing_service -->|"calculates quote"| node_engine
node_pricing_service -->|"uses service definitions"| node_schema
node_database -->|"seeds defaults"| node_seed_data
node_admin_page -->|"renders controls"| node_admin_panel
node_admin_panel -.->|"manages settings"| node_admin_api
node_admin_api -->|"updates pricing"| node_pricing_service
node_client_portal -->|"exports quotes"| node_pdf
node_team_portal -->|"exports quotes"| node_pdf

click node_client_info "https://github.com/vnc-automation/quote_calc_develop/blob/main/components/Step0ClientInfo.js"
click node_service_selection "https://github.com/vnc-automation/quote_calc_develop/blob/main/components/Step1SelectServices.js"
click node_service_configuration "https://github.com/vnc-automation/quote_calc_develop/blob/main/components/Step2ConfigureServices.js"
click node_quote_page "https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/index.js"
click node_quote_review "https://github.com/vnc-automation/quote_calc_develop/blob/main/components/Step3ReviewQuote.js"
click node_pdf "https://github.com/vnc-automation/quote_calc_develop/blob/main/lib/pdfGenerator.js"
click node_schema "https://github.com/vnc-automation/quote_calc_develop/blob/main/config/serviceSchema.js"
click node_seed_data "https://github.com/vnc-automation/quote_calc_develop/blob/main/config/seedData.js"
click node_engine "https://github.com/vnc-automation/quote_calc_develop/blob/main/pricing-engine/computeQuote.js"
click node_pricing_service "https://github.com/vnc-automation/quote_calc_develop/blob/main/services/pricingService.js"
click node_quote_api "https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/api/quote.js"
click node_quotes_api "https://github.com/vnc-automation/quote_calc_develop/tree/main/pages/api/quotes"
click node_database "https://github.com/vnc-automation/quote_calc_develop/blob/main/db/index.js"
click node_auth "https://github.com/vnc-automation/quote_calc_develop/blob/main/lib/auth.js"
click node_client_portal "https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/dashboard.js"
click node_team_portal "https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/team.js"
click node_admin_page "https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/admin/index.js"
click node_admin_panel "https://github.com/vnc-automation/quote_calc_develop/blob/main/components/AdminPanel.js"
click node_admin_api "https://github.com/vnc-automation/quote_calc_develop/tree/main/pages/api/admin"

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_client_info,node_service_selection,node_service_configuration,node_quote_page,node_quote_review,node_pdf,node_client toneBlue
class node_schema,node_seed_data,node_engine,node_pricing_service toneAmber
class node_quote_api,node_quotes_api,node_database,node_auth,node_client_portal,node_team_portal toneMint
class node_admin_page,node_admin_panel,node_admin_api toneRose
```

## Components

### Quote workflow

- [Client details](https://github.com/vnc-automation/quote_calc_develop/blob/main/components/Step0ClientInfo.js): `components/Step0ClientInfo.js`
- [Select services](https://github.com/vnc-automation/quote_calc_develop/blob/main/components/Step1SelectServices.js): `components/Step1SelectServices.js`
- [Configure services](https://github.com/vnc-automation/quote_calc_develop/blob/main/components/Step2ConfigureServices.js): `components/Step2ConfigureServices.js`
- [Quote workflow](https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/index.js): `pages/index.js`
- [Review quote](https://github.com/vnc-automation/quote_calc_develop/blob/main/components/Step3ReviewQuote.js): `components/Step3ReviewQuote.js`
- [PDF export](https://github.com/vnc-automation/quote_calc_develop/blob/main/lib/pdfGenerator.js): `lib/pdfGenerator.js`

### Pricing configuration

- [Service schema](https://github.com/vnc-automation/quote_calc_develop/blob/main/config/serviceSchema.js): `config/serviceSchema.js`
- [Pricing defaults](https://github.com/vnc-automation/quote_calc_develop/blob/main/config/seedData.js): `config/seedData.js`
- [Quote calculation](https://github.com/vnc-automation/quote_calc_develop/blob/main/pricing-engine/computeQuote.js): `pricing-engine/computeQuote.js`
- [Pricing data service](https://github.com/vnc-automation/quote_calc_develop/blob/main/services/pricingService.js): `services/pricingService.js`

### Accounts and quotes

- [Quote endpoint](https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/api/quote.js): `pages/api/quote.js`
- [Saved quotes API](https://github.com/vnc-automation/quote_calc_develop/tree/main/pages/api/quotes): `pages/api/quotes`
- [SQLite database](https://github.com/vnc-automation/quote_calc_develop/blob/main/db/index.js): `db/index.js`
- [Session authentication](https://github.com/vnc-automation/quote_calc_develop/blob/main/lib/auth.js): `lib/auth.js`
- [Client portal](https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/dashboard.js): `pages/dashboard.js`
- [Team portal](https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/team.js): `pages/team.js`

### Administration

- [Admin page](https://github.com/vnc-automation/quote_calc_develop/blob/main/pages/admin/index.js): `pages/admin/index.js`
- [Admin controls](https://github.com/vnc-automation/quote_calc_develop/blob/main/components/AdminPanel.js): `components/AdminPanel.js`
- [Admin API](https://github.com/vnc-automation/quote_calc_develop/tree/main/pages/api/admin): `pages/api/admin`

### Other components

- **Client**

## Connections

- Client → Quote workflow: starts quote (evidence: `README.md`)
- Quote workflow → Client details: renders details (evidence: `pages/index.js`)
- Quote workflow → Select services: renders selection (evidence: `pages/index.js`)
- Quote workflow → Configure services: renders configuration (evidence: `pages/index.js`)
- Quote workflow → Review quote: renders review (evidence: `pages/index.js`)
- Quote workflow → Quote calculation: calculates quote (evidence: `pages/index.js`)
- Quote workflow → Quote endpoint: requests pricing (evidence: `README.md`)
- Quote workflow → Saved quotes API: saves quote (evidence: `pages/index.js`)
- Review quote → PDF export: exports PDF (evidence: `components/Step3ReviewQuote.js`)
- Quote endpoint → Pricing data service: requests calculation (evidence: `pages/api/quote.js`)
- Saved quotes API → Pricing data service: uses quote service (evidence: `pages/api/quotes/index.js`)
- Saved quotes API → SQLite database: accesses records (evidence: `pages/api/quotes/index.js`)
- Saved quotes API → Session authentication: checks access (evidence: `pages/api/quotes/index.js`)
- Pricing data service → SQLite database: reads settings (evidence: `services/pricingService.js`)
- Pricing data service → Quote calculation: calculates quote (evidence: `services/pricingService.js`)
- Pricing data service → Service schema: uses service definitions (evidence: `services/pricingService.js`)
- SQLite database → Pricing defaults: seeds defaults (evidence: `db/index.js`)
- Admin page → Admin controls: renders controls (evidence: `pages/admin/index.js`)
- Admin controls → Admin API: manages settings
- Admin API → Pricing data service: updates pricing (evidence: `pages/api/admin/services.js`)
- Client portal → PDF export: exports quotes (evidence: `pages/dashboard.js`)
- Team portal → PDF export: exports quotes (evidence: `pages/team.js`)
