# suryachauhan6985-pixel/dealer-portal-quotation architecture

> Architecture diagram of the GitHub repository suryachauhan6985-pixel/dealer-portal-quotation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suryachauhan6985-pixel/dealer-portal-quotation
- Repository: https://github.com/suryachauhan6985-pixel/dealer-portal-quotation

## Overview

Sunvine is a role-based solar EPC dealer and admin quotation portal. Dealers create and review quotations, while staff manage leads and locate nearby solar vendors, and administrators maintain dealer, pricing, hardware, and quotation records. Rooftop layout/design and proposal PDF and WhatsApp sharing are visible product capabilities. The excerpts establish application routing, layout calculations, authentication storage, and quotation persistence; some screen-to-service wiring is unsampled, so uncertain connections are omitted.

Main entry points: [`src/App.jsx`](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/App.jsx) (Role-based app), [`src/components/DealerPortal/QuotationPreview.jsx`](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/DealerPortal/QuotationPreview.jsx) (Quote preview), [`src/components/Shared/SolarStructure3DViewer.jsx`](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Shared/SolarStructure3DViewer.jsx) (3D structure viewer), [`src/components/StaffPortal/StaffRadarMap.jsx`](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/StaffPortal/StaffRadarMap.jsx) (Solar vendor radar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Portal experience"]
  node_app["Role-based app<br/>[App.jsx]"]
  node_context["App state<br/>[AppContext.jsx]"]
  node_dealerlogin["Dealer login<br/>[DealerLogin.jsx]"]
  node_stafflogin["Staff login<br/>[StaffLogin.jsx]"]
  node_adminlogin["Admin login<br/>[AdminLogin.jsx]"]
end

subgraph group_quotation["Quotation workflow"]
  node_dealerquote["Create quotation"]
  node_myquotes["My quotations<br/>[MyQuotations.jsx]"]
  node_preview["Quote preview"]
  node_pdf["Proposal template<br/>[PDFTemplate.jsx]"]
  node_sharing["Quote sharing<br/>[quotationShare.js]"]
  node_layout["Solar layout engine"]
  node_roofdesigner["Rooftop designer"]
  node_roofvision["Roof image analysis"]
  node_viewer["3D structure viewer"]
end

subgraph group_operations["Business operations"]
  node_staffdash["Staff dashboard<br/>[StaffDashboard.jsx]"]
  node_newlead["New lead<br/>[StaffNewLead.jsx]"]
  node_radar["Solar vendor radar<br/>[StaffRadarMap.jsx]"]
  node_admindash["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_dealers["Dealer management"]
  node_pricing["Pricing master<br/>[PricingMaster.jsx]"]
  node_hardware["Hardware master<br/>[HardwareMaster.jsx]"]
  node_allquotes["All quotations<br/>[AllQuotations.jsx]"]
end

subgraph group_services["Services and data"]
  node_auth["Authentication service<br/>[authService.js]"]
  node_quoteservice["Quotation service"]
  node_supabase[("Supabase<br/>[supabase.js]")]
  node_radarservice["Radar integration"]
end

node_dealer(("Dealer"))
node_staff(("Staff"))
node_admin(("Administrator"))

node_dealer -->|"opens portal"| node_app
node_staff -->|"opens portal"| node_app
node_admin -->|"opens portal"| node_app
node_app -->|"reads role state"| node_context
node_app -->|"renders login"| node_dealerlogin
node_app -->|"renders login"| node_stafflogin
node_app -->|"renders login"| node_adminlogin
node_auth -->|"reads and writes"| node_supabase
node_app -->|"renders dealer view"| node_dealerquote
node_app -->|"renders dealer view"| node_myquotes
node_app -->|"renders quote view"| node_preview
node_preview -->|"renders proposal"| node_pdf
node_preview -->|"shares proposal"| node_sharing
node_viewer -->|"calculates structure"| node_layout
node_viewer -->|"reads roof geometry"| node_roofdesigner
node_quoteservice -->|"reads and writes quotes"| node_supabase
node_app -->|"renders staff view"| node_staffdash
node_app -->|"renders staff view"| node_newlead
node_app -->|"renders staff view"| node_radar
node_radar -->|"loads nearby vendors"| node_radarservice
node_radarservice -->|"returns vendor results"| node_staff
node_app -->|"renders admin view"| node_admindash
node_app -->|"renders admin view"| node_dealers
node_app -->|"renders admin view"| node_pricing
node_app -->|"renders admin view"| node_hardware
node_app -->|"renders admin view"| node_allquotes

click node_app "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/App.jsx"
click node_context "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/context/AppContext.jsx"
click node_dealerlogin "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Auth/DealerLogin.jsx"
click node_stafflogin "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Auth/StaffLogin.jsx"
click node_adminlogin "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Auth/AdminLogin.jsx"
click node_auth "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/services/authService.js"
click node_dealerquote "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/DealerPortal/CreateQuotation.jsx"
click node_myquotes "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/DealerPortal/MyQuotations.jsx"
click node_preview "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/DealerPortal/QuotationPreview.jsx"
click node_pdf "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/DealerPortal/PDFTemplate.jsx"
click node_sharing "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/utils/quotationShare.js"
click node_layout "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/utils/solarLayoutEngine.js"
click node_roofdesigner "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Shared/RooftopDesigner.jsx"
click node_roofvision "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/utils/aiRoofVisionEngine.js"
click node_viewer "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Shared/SolarStructure3DViewer.jsx"
click node_quoteservice "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/services/quotationService.js"
click node_supabase "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/lib/supabase.js"
click node_staffdash "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/StaffPortal/StaffDashboard.jsx"
click node_newlead "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/StaffPortal/StaffNewLead.jsx"
click node_radar "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/StaffPortal/StaffRadarMap.jsx"
click node_radarservice "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/services/n8nSolarRadarService.js"
click node_admindash "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/AdminDashboard.jsx"
click node_dealers "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/DealerManagement.jsx"
click node_pricing "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/PricingMaster.jsx"
click node_hardware "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/HardwareMaster.jsx"
click node_allquotes "https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/AllQuotations.jsx"

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_context,node_dealerlogin,node_stafflogin,node_adminlogin toneBlue
class node_dealerquote,node_myquotes,node_preview,node_pdf,node_sharing,node_layout,node_roofdesigner,node_roofvision,node_viewer toneAmber
class node_staffdash,node_newlead,node_radar,node_admindash,node_dealers,node_pricing,node_hardware,node_allquotes toneMint
class node_auth,node_quoteservice,node_supabase,node_radarservice toneRose
class node_dealer,node_staff,node_admin toneIndigo
```

## Components

### Portal experience

- [Role-based app](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/App.jsx): `src/App.jsx`
- [App state](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/context/AppContext.jsx): `src/context/AppContext.jsx`
- [Dealer login](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Auth/DealerLogin.jsx): `src/components/Auth/DealerLogin.jsx`
- [Staff login](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Auth/StaffLogin.jsx): `src/components/Auth/StaffLogin.jsx`
- [Admin login](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Auth/AdminLogin.jsx): `src/components/Auth/AdminLogin.jsx`

### Quotation workflow

- [Create quotation](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/DealerPortal/CreateQuotation.jsx): `src/components/DealerPortal/CreateQuotation.jsx`
- [My quotations](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/DealerPortal/MyQuotations.jsx): `src/components/DealerPortal/MyQuotations.jsx`
- [Quote preview](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/DealerPortal/QuotationPreview.jsx): `src/components/DealerPortal/QuotationPreview.jsx`
- [Proposal template](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/DealerPortal/PDFTemplate.jsx): `src/components/DealerPortal/PDFTemplate.jsx`
- [Quote sharing](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/utils/quotationShare.js): `src/utils/quotationShare.js`
- [Solar layout engine](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/utils/solarLayoutEngine.js): `src/utils/solarLayoutEngine.js`
- [Rooftop designer](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Shared/RooftopDesigner.jsx): `src/components/Shared/RooftopDesigner.jsx`
- [Roof image analysis](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/utils/aiRoofVisionEngine.js): `src/utils/aiRoofVisionEngine.js`
- [3D structure viewer](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/Shared/SolarStructure3DViewer.jsx): `src/components/Shared/SolarStructure3DViewer.jsx`

### Business operations

- [Staff dashboard](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/StaffPortal/StaffDashboard.jsx): `src/components/StaffPortal/StaffDashboard.jsx`
- [New lead](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/StaffPortal/StaffNewLead.jsx): `src/components/StaffPortal/StaffNewLead.jsx`
- [Solar vendor radar](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/StaffPortal/StaffRadarMap.jsx): `src/components/StaffPortal/StaffRadarMap.jsx`
- [Admin dashboard](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/AdminDashboard.jsx): `src/components/AdminPortal/AdminDashboard.jsx`
- [Dealer management](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/DealerManagement.jsx): `src/components/AdminPortal/DealerManagement.jsx`
- [Pricing master](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/PricingMaster.jsx): `src/components/AdminPortal/PricingMaster.jsx`
- [Hardware master](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/HardwareMaster.jsx): `src/components/AdminPortal/HardwareMaster.jsx`
- [All quotations](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/components/AdminPortal/AllQuotations.jsx): `src/components/AdminPortal/AllQuotations.jsx`

### Services and data

- [Authentication service](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/services/authService.js): `src/services/authService.js`
- [Quotation service](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/services/quotationService.js): `src/services/quotationService.js`
- [Supabase](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- [Radar integration](https://github.com/suryachauhan6985-pixel/dealer-portal-quotation/blob/main/src/services/n8nSolarRadarService.js): `src/services/n8nSolarRadarService.js`

### Other components

- **Dealer**
- **Staff**
- **Administrator**

## Connections

- Dealer → Role-based app: opens portal
- Staff → Role-based app: opens portal
- Administrator → Role-based app: opens portal
- Role-based app → App state: reads role state
- Role-based app → Dealer login: renders login
- Role-based app → Staff login: renders login
- Role-based app → Admin login: renders login
- Authentication service → Supabase: reads and writes
- Role-based app → Create quotation: renders dealer view
- Role-based app → My quotations: renders dealer view
- Role-based app → Quote preview: renders quote view
- Quote preview → Proposal template: renders proposal
- Quote preview → Quote sharing: shares proposal
- 3D structure viewer → Solar layout engine: calculates structure
- 3D structure viewer → Rooftop designer: reads roof geometry
- Quotation service → Supabase: reads and writes quotes
- Role-based app → Staff dashboard: renders staff view
- Role-based app → New lead: renders staff view
- Role-based app → Solar vendor radar: renders staff view
- Solar vendor radar → Radar integration: loads nearby vendors
- Radar integration → Staff: returns vendor results
- Role-based app → Admin dashboard: renders admin view
- Role-based app → Dealer management: renders admin view
- Role-based app → Pricing master: renders admin view
- Role-based app → Hardware master: renders admin view
- Role-based app → All quotations: renders admin view
