# glazia2025/glazia-quotation architecture

> Architecture diagram of the GitHub repository glazia2025/glazia-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/glazia2025/glazia-quotation
- Repository: https://github.com/glazia2025/glazia-quotation

## Overview

Glazia Quotation is a tenant-aware fenestration ERP, with quotation creation and product configuration as its clearest workflow: users build a quotation, configure window/door items, and save quotation data through the quotation service to the backend. The tree also exposes CRM, dashboard, and operational ERP areas for survey, production, inventory, orders, dispatch, installation, and invoicing. Auth state and the session guard support protected access. Connections for unsampled pages and operational modules are intentionally limited to their documented route presence; the README is empty and the excerpts do not establish their internal wiring.

Main entry points: [`modules/quotation/components/quotation-builder.tsx`](https://github.com/glazia2025/glazia-quotation/blob/main/modules/quotation/components/quotation-builder.tsx) (Quotation builder), [`app/(erp)/crm/leads/page.tsx`](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/crm/leads/page.tsx) (Lead management), [`components/providers/auth-guard.tsx`](https://github.com/glazia2025/glazia-quotation/blob/main/components/providers/auth-guard.tsx) (Auth guard), [`services/quotation-service.ts`](https://github.com/glazia2025/glazia-quotation/blob/main/services/quotation-service.ts) (Quotation service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_login["Login<br/>[page.tsx]"]
  node_guard["Auth guard<br/>[auth-guard.tsx]"]
  node_authstate[("Auth state<br/>[auth-store.ts]")]
  node_shell["ERP shell<br/>[layout.tsx]"]
end

subgraph group_sales["Sales workflow"]
  node_crm["Lead management<br/>[page.tsx]"]
  node_lead_detail["Lead detail<br/>[page.tsx]"]
  node_quotes["Quotation list<br/>[page.tsx]"]
  node_quote_new["New quotation<br/>[page.tsx]"]
  node_quote_builder["Quotation builder"]
  node_quote_detail["Quotation detail"]
  node_configurator["Item configurator"]
  node_design["Design geometry"]
  node_quote_store[("Builder state")]
end

subgraph group_operations["ERP operations"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_survey["Survey<br/>[page.tsx]"]
  node_production["Production<br/>[page.tsx]"]
  node_inventory["Inventory<br/>[page.tsx]"]
  node_orders["Orders<br/>[page.tsx]"]
  node_dispatch["Dispatch<br/>[page.tsx]"]
  node_installation["Installation<br/>[page.tsx]"]
  node_invoices["Invoices<br/>[page.tsx]"]
end

subgraph group_shared["Shared services"]
  node_crm_service["CRM service<br/>[crm-service.ts]"]
  node_quote_service["Quotation service"]
end

node_user(("ERP user"))
node_backend[("Quotation backend")]

node_user -->|"signs in"| node_login
node_user -->|"opens ERP"| node_shell
node_guard -->|"checks session"| node_authstate
node_guard -->|"validates session"| node_backend
node_shell -->|"protects access"| node_guard
node_user -->|"manages leads"| node_crm
node_crm -->|"opens lead"| node_lead_detail
node_crm -->|"loads leads"| node_crm_service
node_user -->|"manages quotes"| node_quotes
node_quotes -->|"starts quote"| node_quote_new
node_quote_new -->|"builds quote"| node_quote_builder
node_quote_builder -->|"configures item"| node_configurator
node_configurator -->|"uses geometry"| node_design
node_quote_builder -->|"updates state"| node_quote_store
node_quote_builder -->|"saves quote"| node_quote_service
node_quote_service -->|"reads and writes"| node_backend
node_quote_detail -->|"loads quote"| node_quote_service
node_user -->|"views metrics"| node_dashboard
node_user -->|"records survey"| node_survey
node_user -->|"manages production"| node_production
node_user -->|"checks inventory"| node_inventory
node_user -->|"manages orders"| node_orders
node_user -->|"manages dispatch"| node_dispatch
node_user -->|"tracks installation"| node_installation
node_user -->|"manages invoices"| node_invoices

click node_login "https://github.com/glazia2025/glazia-quotation/blob/main/app/(auth)/login/page.tsx"
click node_guard "https://github.com/glazia2025/glazia-quotation/blob/main/components/providers/auth-guard.tsx"
click node_authstate "https://github.com/glazia2025/glazia-quotation/blob/main/store/auth-store.ts"
click node_shell "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/layout.tsx"
click node_dashboard "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/dashboard/page.tsx"
click node_crm "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/crm/leads/page.tsx"
click node_lead_detail "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/crm/leads/%5Bid%5D/page.tsx"
click node_crm_service "https://github.com/glazia2025/glazia-quotation/blob/main/services/crm-service.ts"
click node_quotes "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/quotations/page.tsx"
click node_quote_new "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/quotations/new/page.tsx"
click node_quote_builder "https://github.com/glazia2025/glazia-quotation/blob/main/modules/quotation/components/quotation-builder.tsx"
click node_quote_detail "https://github.com/glazia2025/glazia-quotation/blob/main/modules/quotation/components/quotation-detail-page.tsx"
click node_configurator "https://github.com/glazia2025/glazia-quotation/blob/main/modules/product-configurator/components/window-door-configurator.tsx"
click node_design "https://github.com/glazia2025/glazia-quotation/blob/main/modules/product-configurator/utils/window-door-design.ts"
click node_quote_store "https://github.com/glazia2025/glazia-quotation/blob/main/modules/quotation/store/use-quotation-builder-store.ts"
click node_quote_service "https://github.com/glazia2025/glazia-quotation/blob/main/services/quotation-service.ts"
click node_survey "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/survey/page.tsx"
click node_production "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/production/page.tsx"
click node_inventory "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/inventory/page.tsx"
click node_orders "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/orders/page.tsx"
click node_dispatch "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/dispatch/page.tsx"
click node_installation "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/installation/page.tsx"
click node_invoices "https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/invoices/page.tsx"

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_login,node_guard,node_authstate,node_shell,node_user toneBlue
class node_crm,node_lead_detail,node_quotes,node_quote_new,node_quote_builder,node_quote_detail,node_configurator,node_design,node_quote_store,node_backend toneAmber
class node_dashboard,node_survey,node_production,node_inventory,node_orders,node_dispatch,node_installation,node_invoices toneMint
class node_crm_service,node_quote_service toneRose
```

## Components

### Access and shell

- [Login](https://github.com/glazia2025/glazia-quotation/blob/main/app/(auth)/login/page.tsx): `app/(auth)/login/page.tsx`
- [Auth guard](https://github.com/glazia2025/glazia-quotation/blob/main/components/providers/auth-guard.tsx): `components/providers/auth-guard.tsx`
- [Auth state](https://github.com/glazia2025/glazia-quotation/blob/main/store/auth-store.ts): `store/auth-store.ts`
- [ERP shell](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/layout.tsx): `app/(erp)/layout.tsx`

### Sales workflow

- [Lead management](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/crm/leads/page.tsx): `app/(erp)/crm/leads/page.tsx`
- [Lead detail](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/crm/leads/%5Bid%5D/page.tsx): `app/(erp)/crm/leads/[id]/page.tsx`
- [Quotation list](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/quotations/page.tsx): `app/(erp)/quotations/page.tsx`
- [New quotation](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/quotations/new/page.tsx): `app/(erp)/quotations/new/page.tsx`
- [Quotation builder](https://github.com/glazia2025/glazia-quotation/blob/main/modules/quotation/components/quotation-builder.tsx): `modules/quotation/components/quotation-builder.tsx`
- [Quotation detail](https://github.com/glazia2025/glazia-quotation/blob/main/modules/quotation/components/quotation-detail-page.tsx): `modules/quotation/components/quotation-detail-page.tsx`
- [Item configurator](https://github.com/glazia2025/glazia-quotation/blob/main/modules/product-configurator/components/window-door-configurator.tsx): `modules/product-configurator/components/window-door-configurator.tsx`
- [Design geometry](https://github.com/glazia2025/glazia-quotation/blob/main/modules/product-configurator/utils/window-door-design.ts): `modules/product-configurator/utils/window-door-design.ts`
- [Builder state](https://github.com/glazia2025/glazia-quotation/blob/main/modules/quotation/store/use-quotation-builder-store.ts): `modules/quotation/store/use-quotation-builder-store.ts`

### ERP operations

- [Dashboard](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/dashboard/page.tsx): `app/(erp)/dashboard/page.tsx`
- [Survey](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/survey/page.tsx): `app/(erp)/survey/page.tsx`
- [Production](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/production/page.tsx): `app/(erp)/production/page.tsx`
- [Inventory](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/inventory/page.tsx): `app/(erp)/inventory/page.tsx`
- [Orders](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/orders/page.tsx): `app/(erp)/orders/page.tsx`
- [Dispatch](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/dispatch/page.tsx): `app/(erp)/dispatch/page.tsx`
- [Installation](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/installation/page.tsx): `app/(erp)/installation/page.tsx`
- [Invoices](https://github.com/glazia2025/glazia-quotation/blob/main/app/(erp)/invoices/page.tsx): `app/(erp)/invoices/page.tsx`

### Shared services

- [CRM service](https://github.com/glazia2025/glazia-quotation/blob/main/services/crm-service.ts): `services/crm-service.ts`
- [Quotation service](https://github.com/glazia2025/glazia-quotation/blob/main/services/quotation-service.ts): `services/quotation-service.ts`

### Other components

- **ERP user**
- **Quotation backend**

## Connections

- ERP user → Login: signs in
- ERP user → ERP shell: opens ERP
- Auth guard → Auth state: checks session
- Auth guard → Quotation backend: validates session
- ERP shell → Auth guard: protects access
- ERP user → Lead management: manages leads
- Lead management → Lead detail: opens lead
- Lead management → CRM service: loads leads
- ERP user → Quotation list: manages quotes
- Quotation list → New quotation: starts quote
- New quotation → Quotation builder: builds quote
- Quotation builder → Item configurator: configures item
- Item configurator → Design geometry: uses geometry
- Quotation builder → Builder state: updates state
- Quotation builder → Quotation service: saves quote
- Quotation service → Quotation backend: reads and writes
- Quotation detail → Quotation service: loads quote
- ERP user → Dashboard: views metrics
- ERP user → Survey: records survey
- ERP user → Production: manages production
- ERP user → Inventory: checks inventory
- ERP user → Orders: manages orders
- ERP user → Dispatch: manages dispatch
- ERP user → Installation: tracks installation
- ERP user → Invoices: manages invoices
