# smart-matrixgroup/smart-pvt-ltd architecture

> Architecture diagram of the GitHub repository smart-matrixgroup/smart-pvt-ltd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/smart-matrixgroup/smart-pvt-ltd
- Repository: https://github.com/smart-matrixgroup/smart-pvt-ltd

## Overview

SMART Pvt Ltd combines a public corporate and service-discovery website with quote intake, Firebase-backed client and staff portals, and an internal ERP/admin system. The main customer journey is browsing services, submitting an enquiry, and staff/admin handling it; clients and staff also use separate authenticated portals. The tree and README establish several capabilities whose detailed implementations were not sampled, so those are shown at subsystem level. Edges are limited to documented routing, sampled references, or README statements.

Main entry points: [`src/App.jsx`](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/App.jsx) (Corporate Website), [`src/context/AuthContext.jsx`](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/context/AuthContext.jsx) (Authentication & Roles), [`src/pages`](https://github.com/smart-matrixgroup/smart-pvt-ltd/tree/main/src/pages) (Service Pages), [`src/config/firebase.js`](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/config/firebase.js) (Firebase Clients)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Website"]
  node_website["Corporate Website<br/>[App.jsx]"]
  node_service_catalog["Services &amp; Content<br/>[services.js]"]
  node_service_pages["Service Pages"]
  node_quote_intake["Quote Intake"]
  node_company_profile["Company Profile<br/>[company.js]"]
  node_seo["SEO Metadata<br/>[SEO.jsx]"]
end

subgraph group_identity["Portals &amp; Identity"]
  node_firebase_config["Firebase Clients<br/>[firebase.js]"]
  node_auth["Authentication &amp; Roles<br/>[AuthContext.jsx]"]
  node_firebase_auth["Firebase Auth"]
  node_firestore[("Firestore")]
  node_client_portal["Client Portal"]
  node_staff_portal["Staff Portal<br/>[StaffPortalApp.jsx]"]
end

subgraph group_operations["ERP Operations"]
  node_admin_panel["Admin Panel<br/>[AdminPanelPage.jsx]"]
  node_erp_app["ERP Workspace<br/>[ERPApp.jsx]"]
  node_erp_pages["ERP Modules"]
  node_erp_ui["ERP UI Components<br/>[ERPui.jsx]"]
  node_staff_work["Staff Work Views"]
end

subgraph group_services["Backend Services"]
  node_boss_api["Manager API<br/>[bossManagerApi.js]"]
  node_cloud_functions["Cloud Functions<br/>[index.js]"]
  node_whatsapp_bot["WhatsApp Bot<br/>[index.js]"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_website
node_website -->|"routes to"| node_service_pages
node_service_pages -->|"uses content"| node_service_catalog
node_service_pages -->|"sets metadata"| node_seo
node_website -->|"offers enquiry"| node_quote_intake
node_quote_intake -.->|"submits leads"| node_firestore
node_website -.->|"uses profile"| node_company_profile
node_website -->|"routes to"| node_client_portal
node_website -->|"routes to"| node_staff_portal
node_website -->|"routes to"| node_admin_panel
node_website -->|"routes to"| node_erp_app
node_auth -->|"uses clients"| node_firebase_config
node_auth -->|"signs in"| node_firebase_auth
node_auth -->|"checks roles"| node_firestore
node_firebase_config -->|"initializes"| node_firestore
node_firebase_config -->|"initializes"| node_firebase_auth
node_client_portal -->|"reads portal data"| node_firestore
node_staff_portal -->|"renders sections"| node_staff_work
node_staff_work -->|"reads assignments"| node_firestore
node_erp_app -.->|"hosts modules"| node_erp_pages
node_erp_pages -->|"uses components"| node_erp_ui
node_erp_pages -->|"manages records"| node_firestore
node_boss_api -->|"queries records"| node_firestore
node_cloud_functions -->|"imports"| node_boss_api
node_cloud_functions -.->|"optional messaging"| node_whatsapp_bot

click node_website "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/App.jsx"
click node_service_catalog "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/config/services.js"
click node_service_pages "https://github.com/smart-matrixgroup/smart-pvt-ltd/tree/main/src/pages"
click node_quote_intake "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/components/QuoteRequestForm.jsx"
click node_company_profile "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/config/company.js"
click node_seo "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/components/SEO.jsx"
click node_firebase_config "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/config/firebase.js"
click node_auth "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/context/AuthContext.jsx"
click node_client_portal "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/pages/ClientDashboardPage.jsx"
click node_staff_portal "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/staff/StaffPortalApp.jsx"
click node_admin_panel "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/pages/AdminPanelPage.jsx"
click node_erp_app "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/erp/ERPApp.jsx"
click node_erp_pages "https://github.com/smart-matrixgroup/smart-pvt-ltd/tree/main/src/erp/pages"
click node_erp_ui "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/erp/components/ERPui.jsx"
click node_staff_work "https://github.com/smart-matrixgroup/smart-pvt-ltd/tree/main/src/staff/sections"
click node_boss_api "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/functions/bossManagerApi.js"
click node_cloud_functions "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/functions/index.js"
click node_whatsapp_bot "https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/whatsapp-bot/index.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_website,node_service_catalog,node_service_pages,node_quote_intake,node_company_profile,node_seo toneBlue
class node_firebase_config,node_auth,node_firebase_auth,node_firestore,node_client_portal,node_staff_portal toneAmber
class node_admin_panel,node_erp_app,node_erp_pages,node_erp_ui,node_staff_work toneMint
class node_boss_api,node_cloud_functions,node_whatsapp_bot toneRose
class node_visitor toneIndigo
```

## Components

### Public Website

- [Corporate Website](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/App.jsx): `src/App.jsx`
- [Services & Content](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/config/services.js): `src/config/services.js`
- [Service Pages](https://github.com/smart-matrixgroup/smart-pvt-ltd/tree/main/src/pages): `src/pages`
- [Quote Intake](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/components/QuoteRequestForm.jsx): `src/components/QuoteRequestForm.jsx`
- [Company Profile](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/config/company.js): `src/config/company.js`
- [SEO Metadata](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/components/SEO.jsx): `src/components/SEO.jsx`

### Portals & Identity

- [Firebase Clients](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/config/firebase.js): `src/config/firebase.js`
- [Authentication & Roles](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- **Firebase Auth**
- **Firestore**
- [Client Portal](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/pages/ClientDashboardPage.jsx): `src/pages/ClientDashboardPage.jsx`
- [Staff Portal](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/staff/StaffPortalApp.jsx): `src/staff/StaffPortalApp.jsx`

### ERP Operations

- [Admin Panel](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/pages/AdminPanelPage.jsx): `src/pages/AdminPanelPage.jsx`
- [ERP Workspace](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/erp/ERPApp.jsx): `src/erp/ERPApp.jsx`
- [ERP Modules](https://github.com/smart-matrixgroup/smart-pvt-ltd/tree/main/src/erp/pages): `src/erp/pages`
- [ERP UI Components](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/src/erp/components/ERPui.jsx): `src/erp/components/ERPui.jsx`
- [Staff Work Views](https://github.com/smart-matrixgroup/smart-pvt-ltd/tree/main/src/staff/sections): `src/staff/sections`

### Backend Services

- [Manager API](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/functions/bossManagerApi.js): `functions/bossManagerApi.js`
- [Cloud Functions](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/functions/index.js): `functions/index.js`
- [WhatsApp Bot](https://github.com/smart-matrixgroup/smart-pvt-ltd/blob/main/whatsapp-bot/index.js): `whatsapp-bot/index.js`

### Other components

- **Visitor**

## Connections

- Visitor → Corporate Website: browses (evidence: `src/App.jsx`)
- Corporate Website → Service Pages: routes to (evidence: `src/App.jsx`)
- Service Pages → Services & Content: uses content (evidence: `src/pages/ServiceDetailPage.jsx`)
- Service Pages → SEO Metadata: sets metadata (evidence: `src/pages/ServiceDetailPage.jsx`)
- Corporate Website → Quote Intake: offers enquiry (evidence: `src/App.jsx`)
- Quote Intake → Firestore: submits leads (evidence: `README.md`)
- Corporate Website → Company Profile: uses profile
- Corporate Website → Client Portal: routes to (evidence: `src/App.jsx`)
- Corporate Website → Staff Portal: routes to (evidence: `src/App.jsx`)
- Corporate Website → Admin Panel: routes to (evidence: `src/App.jsx`)
- Corporate Website → ERP Workspace: routes to (evidence: `src/App.jsx`)
- Authentication & Roles → Firebase Clients: uses clients (evidence: `src/context/AuthContext.jsx`)
- Authentication & Roles → Firebase Auth: signs in (evidence: `src/context/AuthContext.jsx`)
- Authentication & Roles → Firestore: checks roles (evidence: `src/context/AuthContext.jsx`)
- Firebase Clients → Firestore: initializes (evidence: `src/config/firebase.js`)
- Firebase Clients → Firebase Auth: initializes (evidence: `src/config/firebase.js`)
- Client Portal → Firestore: reads portal data (evidence: `src/pages/ClientDashboardPage.jsx`)
- Staff Portal → Staff Work Views: renders sections (evidence: `src/staff/StaffPortalApp.jsx`)
- Staff Work Views → Firestore: reads assignments (evidence: `src/staff/sections/StaffClientProjects.jsx`)
- ERP Workspace → ERP Modules: hosts modules
- ERP Modules → ERP UI Components: uses components (evidence: `src/erp/pages/ERPClients.jsx`)
- ERP Modules → Firestore: manages records (evidence: `src/erp/pages/ERPClients.jsx`)
- Manager API → Firestore: queries records (evidence: `functions/bossManagerApi.js`)
- Cloud Functions → Manager API: imports (evidence: `functions/index.js`)
- Cloud Functions → WhatsApp Bot: optional messaging
