# jmdec/hero architecture

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

- Interactive diagram: https://gitdiagram.com/jmdec/hero
- Repository: https://github.com/jmdec/hero

## Overview

This is a serviced-office website and customer portal, with public inquiry and quotation submission, account verification, chat, and administrative management. The clearest evidenced workflow is inquiry submission: the contact API routes inquiries to a backend and uses routing rules and mail delivery helpers for notifications. Quotation handling similarly forwards submissions and triggers document/email work. The tree also shows payment, contract, announcements, testimonials, and virtual-tour capabilities. Source evidence is partial, so links for unsampled pages and handlers are intentionally omitted.

Main entry points: [`src/lib/nodemailer.ts`](https://github.com/jmdec/hero/blob/main/src/lib/nodemailer.ts) (Quotation notifications), [`src/app/api/contact/route.ts`](https://github.com/jmdec/hero/blob/main/src/app/api/contact/route.ts) (Contact API), [`src/app/api/chat/[conversationId]/email-history/route.ts`](https://github.com/jmdec/hero/blob/main/src/app/api/chat/%5BconversationId%5D/email-history/route.ts) (Transcript email), [`src/app/api/quotations`](https://github.com/jmdec/hero/tree/main/src/app/api/quotations) (Quotation endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inquiries["Inquiries &amp; Chat"]
  node_contact_api["Contact API<br/>[route.ts]"]
  node_contact_routing["Inquiry routing"]
  node_chat_widget["Chat widget<br/>[Chatbot.tsx]"]
  node_chat_client["Chat API client<br/>[chatApi.ts]"]
  node_chat_api["Chat endpoints"]
  node_chat_transcript["Transcript email<br/>[route.ts]"]
end

subgraph group_sales["Sales &amp; Documents"]
  node_quotation_api["Quotation endpoints"]
  node_contract_view["VO contract view<br/>[VOContract.tsx]"]
  node_contract_document["VO contract document"]
  node_guideline_fields["Guideline fields<br/>[guidelineFields.ts]"]
  node_guideline_document["Guideline document"]
  node_guideline_pdf["Guideline PDF<br/>[guidelinePdf.ts]"]
  node_document_types["Document types<br/>[documentType.ts]"]
end

subgraph group_identity["Accounts"]
  node_auth_api["Authentication endpoints"]
  node_registration_api["Registration handler<br/>[route.ts]"]
end

subgraph group_site["Website Experience"]
  node_website_pages["Public pages"]
  node_admin_pages["Admin pages"]
  node_panorama["Panorama viewer<br/>[PanoramaViewer.tsx]"]
end

subgraph group_shared["Shared Services"]
  node_mailer["Mail delivery<br/>[mailer.ts]"]
  node_notification_service["Quotation notifications<br/>[nodemailer.ts]"]
end

node_visitor(("Website visitor"))
node_backend["Laravel API"]

node_visitor -->|"submits inquiry"| node_contact_api
node_contact_api -->|"forwards inquiry"| node_backend
node_contact_api -->|"resolves recipients"| node_contact_routing
node_contact_api -->|"sends notifications"| node_mailer
node_chat_widget -->|"uses client"| node_chat_client
node_chat_transcript -->|"fetches conversation"| node_backend
node_chat_transcript -->|"emails transcript"| node_mailer
node_quotation_api -->|"forwards quotations"| node_backend
node_quotation_api -->|"sends notifications"| node_notification_service
node_registration_api -->|"registers account"| node_backend
node_registration_api -->|"sends verification"| node_notification_service
node_contract_view -->|"renders document"| node_contract_document
node_guideline_document -->|"uses fields"| node_guideline_fields
node_guideline_pdf -->|"maps fields"| node_guideline_fields
node_notification_service -->|"maps contract"| node_contract_document
node_notification_service -->|"generates PDF"| node_guideline_pdf
node_notification_service -->|"selects type"| node_document_types

click node_contact_api "https://github.com/jmdec/hero/blob/main/src/app/api/contact/route.ts"
click node_contact_routing "https://github.com/jmdec/hero/blob/main/src/lib/contactInquiryRouting.ts"
click node_mailer "https://github.com/jmdec/hero/blob/main/src/lib/mailer.ts"
click node_chat_widget "https://github.com/jmdec/hero/blob/main/src/components/Chatbot.tsx"
click node_chat_client "https://github.com/jmdec/hero/blob/main/src/lib/chatApi.ts"
click node_chat_api "https://github.com/jmdec/hero/tree/main/src/app/api/chat"
click node_chat_transcript "https://github.com/jmdec/hero/blob/main/src/app/api/chat/%5BconversationId%5D/email-history/route.ts"
click node_quotation_api "https://github.com/jmdec/hero/tree/main/src/app/api/quotations"
click node_notification_service "https://github.com/jmdec/hero/blob/main/src/lib/nodemailer.ts"
click node_contract_view "https://github.com/jmdec/hero/blob/main/src/components/contracts/VOContract.tsx"
click node_contract_document "https://github.com/jmdec/hero/blob/main/src/components/contracts/VOContractDocument.tsx"
click node_guideline_fields "https://github.com/jmdec/hero/blob/main/src/lib/guidelineFields.ts"
click node_guideline_document "https://github.com/jmdec/hero/blob/main/src/components/guidelines/GuidelineDocument.tsx"
click node_guideline_pdf "https://github.com/jmdec/hero/blob/main/src/lib/guidelinePdf.ts"
click node_document_types "https://github.com/jmdec/hero/blob/main/src/lib/documentType.ts"
click node_auth_api "https://github.com/jmdec/hero/tree/main/src/app/api/auth"
click node_registration_api "https://github.com/jmdec/hero/blob/main/src/app/api/auth/register/route.ts"
click node_website_pages "https://github.com/jmdec/hero/tree/main/src/app"
click node_admin_pages "https://github.com/jmdec/hero/tree/main/src/app/admin"
click node_panorama "https://github.com/jmdec/hero/blob/main/src/components/PanoramaViewer.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_contact_api,node_contact_routing,node_chat_widget,node_chat_client,node_chat_api,node_chat_transcript toneBlue
class node_quotation_api,node_contract_view,node_contract_document,node_guideline_fields,node_guideline_document,node_guideline_pdf,node_document_types toneAmber
class node_auth_api,node_registration_api,node_backend toneMint
class node_website_pages,node_admin_pages,node_panorama toneRose
class node_mailer,node_notification_service,node_visitor toneIndigo
```

## Components

### Inquiries & Chat

- [Contact API](https://github.com/jmdec/hero/blob/main/src/app/api/contact/route.ts): `src/app/api/contact/route.ts`
- [Inquiry routing](https://github.com/jmdec/hero/blob/main/src/lib/contactInquiryRouting.ts): `src/lib/contactInquiryRouting.ts`
- [Chat widget](https://github.com/jmdec/hero/blob/main/src/components/Chatbot.tsx): `src/components/Chatbot.tsx`
- [Chat API client](https://github.com/jmdec/hero/blob/main/src/lib/chatApi.ts): `src/lib/chatApi.ts`
- [Chat endpoints](https://github.com/jmdec/hero/tree/main/src/app/api/chat): `src/app/api/chat`
- [Transcript email](https://github.com/jmdec/hero/blob/main/src/app/api/chat/%5BconversationId%5D/email-history/route.ts): `src/app/api/chat/[conversationId]/email-history/route.ts`

### Sales & Documents

- [Quotation endpoints](https://github.com/jmdec/hero/tree/main/src/app/api/quotations): `src/app/api/quotations`
- [VO contract view](https://github.com/jmdec/hero/blob/main/src/components/contracts/VOContract.tsx): `src/components/contracts/VOContract.tsx`
- [VO contract document](https://github.com/jmdec/hero/blob/main/src/components/contracts/VOContractDocument.tsx): `src/components/contracts/VOContractDocument.tsx`
- [Guideline fields](https://github.com/jmdec/hero/blob/main/src/lib/guidelineFields.ts): `src/lib/guidelineFields.ts`
- [Guideline document](https://github.com/jmdec/hero/blob/main/src/components/guidelines/GuidelineDocument.tsx): `src/components/guidelines/GuidelineDocument.tsx`
- [Guideline PDF](https://github.com/jmdec/hero/blob/main/src/lib/guidelinePdf.ts): `src/lib/guidelinePdf.ts`
- [Document types](https://github.com/jmdec/hero/blob/main/src/lib/documentType.ts): `src/lib/documentType.ts`

### Accounts

- [Authentication endpoints](https://github.com/jmdec/hero/tree/main/src/app/api/auth): `src/app/api/auth`
- [Registration handler](https://github.com/jmdec/hero/blob/main/src/app/api/auth/register/route.ts): `src/app/api/auth/register/route.ts`

### Website Experience

- [Public pages](https://github.com/jmdec/hero/tree/main/src/app): `src/app`
- [Admin pages](https://github.com/jmdec/hero/tree/main/src/app/admin): `src/app/admin`
- [Panorama viewer](https://github.com/jmdec/hero/blob/main/src/components/PanoramaViewer.tsx): `src/components/PanoramaViewer.tsx`

### Shared Services

- [Mail delivery](https://github.com/jmdec/hero/blob/main/src/lib/mailer.ts): `src/lib/mailer.ts`
- [Quotation notifications](https://github.com/jmdec/hero/blob/main/src/lib/nodemailer.ts): `src/lib/nodemailer.ts`

### Other components

- **Website visitor**
- **Laravel API**

## Connections

- Website visitor → Contact API: submits inquiry (evidence: `src/app/api/contact/route.ts`)
- Contact API → Laravel API: forwards inquiry (evidence: `src/app/api/contact/route.ts`)
- Contact API → Inquiry routing: resolves recipients (evidence: `src/app/api/contact/route.ts`)
- Contact API → Mail delivery: sends notifications (evidence: `src/app/api/contact/route.ts`)
- Chat widget → Chat API client: uses client (evidence: `src/components/Chatbot.tsx`)
- Transcript email → Laravel API: fetches conversation (evidence: `src/app/api/chat/[conversationId]/email-history/route.ts`)
- Transcript email → Mail delivery: emails transcript (evidence: `src/app/api/chat/[conversationId]/email-history/route.ts`)
- Quotation endpoints → Laravel API: forwards quotations (evidence: `src/app/api/quotations/route.ts`)
- Quotation endpoints → Quotation notifications: sends notifications (evidence: `src/app/api/quotations/route.ts`)
- Registration handler → Laravel API: registers account (evidence: `src/app/api/auth/register/route.ts`)
- Registration handler → Quotation notifications: sends verification (evidence: `src/app/api/auth/register/route.ts`)
- VO contract view → VO contract document: renders document (evidence: `src/components/contracts/VOContract.tsx`)
- Guideline document → Guideline fields: uses fields (evidence: `src/components/guidelines/GuidelineDocument.tsx`)
- Guideline PDF → Guideline fields: maps fields (evidence: `src/lib/guidelinePdf.ts`)
- Quotation notifications → VO contract document: maps contract (evidence: `src/lib/nodemailer.ts`)
- Quotation notifications → Guideline PDF: generates PDF (evidence: `src/lib/nodemailer.ts`)
- Quotation notifications → Document types: selects type (evidence: `src/lib/nodemailer.ts`)
