# bbi-shadow/multi-agent-sales-system architecture

> Architecture diagram of the GitHub repository bbi-shadow/multi-agent-sales-system, 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/bbi-shadow/multi-agent-sales-system
- Repository: https://github.com/bbi-shadow/multi-agent-sales-system

## Overview

SalesMind AI is an MVP sales-system foundation: a dashboard presents an initial sales-operations view, while the backend exposes health checks and lead creation/lookup backed by MongoDB. The lead path runs from API entry through the controller and service to persistence; the dashboard currently renders static cards and process text, not live lead data. README documents n8n access and prepared workflow/media locations, but says AI workflows are not implemented, so those are shown as separate infrastructure rather than an active sales pipeline. Evidence is limited to the README and indexed excerpts; deployment wiring is not inferred.

Main entry points: [`apps/backend/src/app.module.ts`](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/app.module.ts) (Application modules), [`apps/backend/src/modules/leads/leads.module.ts`](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/leads.module.ts) (Lead module), [`apps/backend/src/modules/leads/leads.controller.ts`](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/leads.controller.ts) (Lead endpoints), [`apps/backend/src/modules/leads/leads.service.ts`](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/leads.service.ts) (Lead operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_dashboard["Sales dashboard<br/>[page.tsx]"]
end

subgraph group_backend["Backend API"]
  node_api_entry["API bootstrap<br/>[main.ts]"]
  node_app_module["Application modules<br/>[app.module.ts]"]
  node_health["Health endpoint"]
  node_health_module["Health module<br/>[health.module.ts]"]
  node_lead_controller["Lead endpoints"]
  node_lead_dto["Lead validation DTO<br/>[create-lead.dto.ts]"]
  node_lead_service["Lead operations<br/>[leads.service.ts]"]
  node_lead_module["Lead module<br/>[leads.module.ts]"]
  node_lead_schema["Lead model<br/>[lead.schema.ts]"]
end

subgraph group_platform["Data and automation"]
  node_mongodb[("MongoDB")]
  node_n8n["n8n automation"]
  node_workflow_assets["Workflow and media folders"]
end

node_operator(("Sales operator"))

node_operator -->|"views"| node_dashboard
node_api_entry -->|"starts"| node_app_module
node_app_module -->|"registers"| node_health_module
node_app_module -->|"registers"| node_lead_module
node_health_module -->|"registers"| node_health
node_lead_controller -->|"calls"| node_lead_service
node_lead_controller -->|"accepts"| node_lead_dto
node_lead_service -->|"reads and writes"| node_mongodb
node_lead_module -->|"registers"| node_lead_controller
node_lead_module -->|"provides"| node_lead_service
node_lead_module -->|"registers model"| node_lead_schema
node_app_module -->|"configures connection"| node_mongodb
node_operator -.->|"can access"| node_n8n
node_n8n -.->|"workflow location"| node_workflow_assets

click node_dashboard "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/frontend/src/app/page.tsx"
click node_api_entry "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/main.ts"
click node_app_module "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/app.module.ts"
click node_health "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/health/health.controller.ts"
click node_health_module "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/health/health.module.ts"
click node_lead_controller "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/leads.controller.ts"
click node_lead_dto "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/dto/create-lead.dto.ts"
click node_lead_service "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/leads.service.ts"
click node_lead_module "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/leads.module.ts"
click node_lead_schema "https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/schemas/lead.schema.ts"
click node_workflow_assets "https://github.com/bbi-shadow/multi-agent-sales-system/tree/main/automation/n8n-workflows"

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_dashboard toneBlue
class node_api_entry,node_app_module,node_health,node_health_module,node_lead_controller,node_lead_dto,node_lead_service,node_lead_module,node_lead_schema toneAmber
class node_mongodb,node_n8n,node_workflow_assets toneMint
class node_operator toneIndigo
```

## Components

### Dashboard

- [Sales dashboard](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/frontend/src/app/page.tsx): `apps/frontend/src/app/page.tsx`

### Backend API

- [API bootstrap](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/main.ts): `apps/backend/src/main.ts`
- [Application modules](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/app.module.ts): `apps/backend/src/app.module.ts`
- [Health endpoint](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/health/health.controller.ts): `apps/backend/src/health/health.controller.ts`
- [Health module](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/health/health.module.ts): `apps/backend/src/health/health.module.ts`
- [Lead endpoints](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/leads.controller.ts): `apps/backend/src/modules/leads/leads.controller.ts`
- [Lead validation DTO](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/dto/create-lead.dto.ts): `apps/backend/src/modules/leads/dto/create-lead.dto.ts`
- [Lead operations](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/leads.service.ts): `apps/backend/src/modules/leads/leads.service.ts`
- [Lead module](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/leads.module.ts): `apps/backend/src/modules/leads/leads.module.ts`
- [Lead model](https://github.com/bbi-shadow/multi-agent-sales-system/blob/main/apps/backend/src/modules/leads/schemas/lead.schema.ts): `apps/backend/src/modules/leads/schemas/lead.schema.ts`

### Data and automation

- **MongoDB**
- **n8n automation**
- [Workflow and media folders](https://github.com/bbi-shadow/multi-agent-sales-system/tree/main/automation/n8n-workflows): `automation/n8n-workflows`

### Other components

- **Sales operator**

## Connections

- Sales operator → Sales dashboard: views (evidence: `apps/frontend/src/app/page.tsx`)
- API bootstrap → Application modules: starts (evidence: `apps/backend/src/main.ts`)
- Application modules → Health module: registers (evidence: `apps/backend/src/app.module.ts`)
- Application modules → Lead module: registers (evidence: `apps/backend/src/app.module.ts`)
- Health module → Health endpoint: registers (evidence: `apps/backend/src/health/health.module.ts`)
- Lead endpoints → Lead operations: calls (evidence: `apps/backend/src/modules/leads/leads.controller.ts`)
- Lead endpoints → Lead validation DTO: accepts (evidence: `apps/backend/src/modules/leads/leads.controller.ts`)
- Lead operations → MongoDB: reads and writes (evidence: `apps/backend/src/modules/leads/leads.service.ts`)
- Lead module → Lead endpoints: registers (evidence: `apps/backend/src/modules/leads/leads.module.ts`)
- Lead module → Lead operations: provides (evidence: `apps/backend/src/modules/leads/leads.module.ts`)
- Lead module → Lead model: registers model (evidence: `apps/backend/src/modules/leads/leads.module.ts`)
- Application modules → MongoDB: configures connection (evidence: `apps/backend/src/app.module.ts`)
- Sales operator → n8n automation: can access (evidence: `README.md`)
- n8n automation → Workflow and media folders: workflow location (evidence: `README.md`)
