# kenshincommits/aczencrm2 architecture

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

- Interactive diagram: https://gitdiagram.com/kenshincommits/aczencrm2
- Repository: https://github.com/kenshincommits/aczencrm2

## Overview

Fizzi combines a 3D storefront, a shared Express/MongoDB API, an AI voice-sales workflow, and an admin CRM. The main customer journey runs from browsing and behavioral events through lead scoring and pipeline updates, then through Fulky conversations and live CRM updates. The README documents these end-to-end links; source excerpts are incomplete, so the graph omits unverified internal call relationships and some feature-specific wiring.

Main entry points: [`src/app`](https://github.com/kenshincommits/aczencrm2/tree/main/src/app) (Storefront Pages), [`backend/src/webhooks/retellWebhook.ts`](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/webhooks/retellWebhook.ts) (Call Webhook), [`backend/src/app.ts`](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/app.ts) (REST API), [`admin/src/App.tsx`](https://github.com/kenshincommits/aczencrm2/blob/main/admin/src/App.tsx) (CRM Workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_store["Storefront Pages"]
  node_immersive["3D Experience"]
  node_content["Prismic Content<br/>[prismicio.ts]"]
  node_storeauth["Storefront Auth<br/>[auth.ts]"]
end

subgraph group_intelligence["Lead Intelligence"]
  node_processing["Event Processing"]
  node_scoring["Lead Scoring<br/>[scoringService.ts]"]
  node_intent["Intent Analysis<br/>[intentService.ts]"]
  node_pipeline["Pipeline Stages<br/>[pipelineService.ts]"]
  node_leads[("Lead Records<br/>[Lead.ts]")]
end

subgraph group_voice["Fulky Voice"]
  node_voicewidget["Voice Assistant"]
  node_voiceapi["Voice API<br/>[fulkyController.ts]"]
  node_retell["Retell AI<br/>[retellService.ts]"]
  node_webhook["Call Webhook<br/>[retellWebhook.ts]"]
end

subgraph group_backend["Backend Platform"]
  node_eventapi["Event Intake<br/>[eventController.ts]"]
  node_api["REST API<br/>[app.ts]"]
  node_database[("MongoDB<br/>[database.ts]")]
  node_cartorders["Cart and Orders<br/>[cartController.ts]"]
  node_products["Product Catalog"]
  node_realtime["Live Updates<br/>[socketManager.ts]"]
end

subgraph group_crm["Admin CRM"]
  node_admin["CRM Workspace<br/>[App.tsx]"]
  node_crmstate["CRM Data State<br/>[store.tsx]"]
  node_crmapi["CRM API Client<br/>[api.ts]"]
  node_crmfeatures["CRM Features"]
end

node_shopper(("Shopper"))
node_adminactor(("CRM User"))

node_shopper -->|"browses"| node_store
node_store -->|"renders"| node_immersive
node_store -->|"queries content"| node_content
node_shopper -->|"signs in"| node_storeauth
node_store -->|"sends events"| node_eventapi
node_eventapi -->|"processes events"| node_processing
node_processing -->|"scores activity"| node_scoring
node_scoring -->|"calculates intent"| node_intent
node_intent -->|"advances stage"| node_pipeline
node_processing -->|"updates lead"| node_leads
node_pipeline -->|"updates stage"| node_leads
node_api -->|"connects"| node_database
node_shopper -->|"starts conversation"| node_voicewidget
node_voicewidget -->|"requests call"| node_voiceapi
node_voiceapi -->|"creates call"| node_retell
node_retell -->|"returns call access"| node_voicewidget
node_retell -->|"sends transcript"| node_webhook
node_webhook -->|"updates score"| node_scoring
node_webhook -->|"stores transcript"| node_database
node_webhook -->|"broadcasts update"| node_realtime
node_realtime -->|"updates live"| node_admin
node_adminactor -->|"uses workspace"| node_admin
node_admin -->|"loads workspace state"| node_crmstate
node_crmstate -->|"requests data"| node_crmapi
node_crmapi -->|"uses REST API"| node_api
node_admin -->|"routes to"| node_crmfeatures
node_api -.->|"serves commerce"| node_cartorders
node_api -.->|"serves catalog"| node_products

click node_store "https://github.com/kenshincommits/aczencrm2/tree/main/src/app"
click node_immersive "https://github.com/kenshincommits/aczencrm2/tree/main/src/slices"
click node_content "https://github.com/kenshincommits/aczencrm2/blob/main/src/prismicio.ts"
click node_storeauth "https://github.com/kenshincommits/aczencrm2/blob/main/src/lib/auth.ts"
click node_eventapi "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/controllers/eventController.ts"
click node_processing "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/services/eventProcessingService.ts"
click node_scoring "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/services/scoringService.ts"
click node_intent "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/services/intentService.ts"
click node_pipeline "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/services/pipelineService.ts"
click node_leads "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/models/Lead.ts"
click node_api "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/app.ts"
click node_database "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/config/database.ts"
click node_cartorders "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/controllers/cartController.ts"
click node_products "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/controllers/productController.ts"
click node_voicewidget "https://github.com/kenshincommits/aczencrm2/blob/main/src/components/FulkyVoiceAssistant.tsx"
click node_voiceapi "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/controllers/fulkyController.ts"
click node_retell "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/integrations/retell/retellService.ts"
click node_webhook "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/webhooks/retellWebhook.ts"
click node_realtime "https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/realtime/socketManager.ts"
click node_admin "https://github.com/kenshincommits/aczencrm2/blob/main/admin/src/App.tsx"
click node_crmstate "https://github.com/kenshincommits/aczencrm2/blob/main/admin/src/lib/store.tsx"
click node_crmapi "https://github.com/kenshincommits/aczencrm2/blob/main/admin/src/lib/api.ts"
click node_crmfeatures "https://github.com/kenshincommits/aczencrm2/tree/main/admin/src/pages"

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_store,node_immersive,node_content,node_storeauth,node_adminactor toneBlue
class node_processing,node_scoring,node_intent,node_pipeline,node_leads toneAmber
class node_voicewidget,node_voiceapi,node_retell,node_webhook toneMint
class node_eventapi,node_api,node_database,node_cartorders,node_products,node_realtime toneRose
class node_admin,node_crmstate,node_crmapi,node_crmfeatures,node_shopper toneIndigo
```

## Components

### Storefront

- [Storefront Pages](https://github.com/kenshincommits/aczencrm2/tree/main/src/app): `src/app`
- [3D Experience](https://github.com/kenshincommits/aczencrm2/tree/main/src/slices): `src/slices`
- [Prismic Content](https://github.com/kenshincommits/aczencrm2/blob/main/src/prismicio.ts): `src/prismicio.ts`
- [Storefront Auth](https://github.com/kenshincommits/aczencrm2/blob/main/src/lib/auth.ts): `src/lib/auth.ts`

### Lead Intelligence

- [Event Processing](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/services/eventProcessingService.ts): `backend/src/services/eventProcessingService.ts`
- [Lead Scoring](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/services/scoringService.ts): `backend/src/services/scoringService.ts`
- [Intent Analysis](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/services/intentService.ts): `backend/src/services/intentService.ts`
- [Pipeline Stages](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/services/pipelineService.ts): `backend/src/services/pipelineService.ts`
- [Lead Records](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/models/Lead.ts): `backend/src/models/Lead.ts`

### Fulky Voice

- [Voice Assistant](https://github.com/kenshincommits/aczencrm2/blob/main/src/components/FulkyVoiceAssistant.tsx): `src/components/FulkyVoiceAssistant.tsx`
- [Voice API](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/controllers/fulkyController.ts): `backend/src/controllers/fulkyController.ts`
- [Retell AI](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/integrations/retell/retellService.ts): `backend/src/integrations/retell/retellService.ts`
- [Call Webhook](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/webhooks/retellWebhook.ts): `backend/src/webhooks/retellWebhook.ts`

### Backend Platform

- [Event Intake](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/controllers/eventController.ts): `backend/src/controllers/eventController.ts`
- [REST API](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [MongoDB](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/config/database.ts): `backend/src/config/database.ts`
- [Cart and Orders](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/controllers/cartController.ts): `backend/src/controllers/cartController.ts`
- [Product Catalog](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/controllers/productController.ts): `backend/src/controllers/productController.ts`
- [Live Updates](https://github.com/kenshincommits/aczencrm2/blob/main/backend/src/realtime/socketManager.ts): `backend/src/realtime/socketManager.ts`

### Admin CRM

- [CRM Workspace](https://github.com/kenshincommits/aczencrm2/blob/main/admin/src/App.tsx): `admin/src/App.tsx`
- [CRM Data State](https://github.com/kenshincommits/aczencrm2/blob/main/admin/src/lib/store.tsx): `admin/src/lib/store.tsx`
- [CRM API Client](https://github.com/kenshincommits/aczencrm2/blob/main/admin/src/lib/api.ts): `admin/src/lib/api.ts`
- [CRM Features](https://github.com/kenshincommits/aczencrm2/tree/main/admin/src/pages): `admin/src/pages`

### Other components

- **Shopper**
- **CRM User**

## Connections

- Shopper → Storefront Pages: browses (evidence: `README.md`)
- Storefront Pages → 3D Experience: renders (evidence: `src/app/page.tsx`)
- Storefront Pages → Prismic Content: queries content (evidence: `src/app/page.tsx`)
- Shopper → Storefront Auth: signs in (evidence: `README.md`)
- Storefront Pages → Event Intake: sends events (evidence: `README.md`)
- Event Intake → Event Processing: processes events (evidence: `README.md`)
- Event Processing → Lead Scoring: scores activity (evidence: `README.md`)
- Lead Scoring → Intent Analysis: calculates intent (evidence: `README.md`)
- Intent Analysis → Pipeline Stages: advances stage (evidence: `README.md`)
- Event Processing → Lead Records: updates lead (evidence: `README.md`)
- Pipeline Stages → Lead Records: updates stage (evidence: `backend/src/services/pipelineService.ts`)
- REST API → MongoDB: connects (evidence: `README.md`)
- Shopper → Voice Assistant: starts conversation (evidence: `README.md`)
- Voice Assistant → Voice API: requests call (evidence: `README.md`)
- Voice API → Retell AI: creates call (evidence: `README.md`)
- Retell AI → Voice Assistant: returns call access (evidence: `README.md`)
- Retell AI → Call Webhook: sends transcript (evidence: `README.md`)
- Call Webhook → Lead Scoring: updates score (evidence: `README.md`)
- Call Webhook → MongoDB: stores transcript (evidence: `README.md`)
- Call Webhook → Live Updates: broadcasts update (evidence: `README.md`)
- Live Updates → CRM Workspace: updates live (evidence: `README.md`)
- CRM User → CRM Workspace: uses workspace (evidence: `README.md`)
- CRM Workspace → CRM Data State: loads workspace state (evidence: `admin/src/App.tsx`)
- CRM Data State → CRM API Client: requests data (evidence: `admin/src/lib/store.tsx`)
- CRM API Client → REST API: uses REST API (evidence: `README.md`)
- CRM Workspace → CRM Features: routes to (evidence: `admin/src/App.tsx`)
- REST API → Cart and Orders: serves commerce
- REST API → Product Catalog: serves catalog
