# qrev-ai/qrev architecture

> Architecture diagram of the GitHub repository qrev-ai/qrev, 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/qrev-ai/qrev
- Repository: https://github.com/qrev-ai/qrev

## Overview

QRev is an AI-centered sales platform: users work through a web client to manage agents, campaigns, CRM records, and integrations, with app-server APIs providing those business capabilities. The documented architecture also includes a separate AI server and MongoDB/ChromaDB/SQL data technologies. Sampled sources establish the client routing, campaign and agent API dispatch, and server setup; most domain persistence and AI request wiring was not sampled, so those links are omitted or marked unverified.

Main entry points: [`client/src/App.tsx`](https://github.com/qrev-ai/qrev/blob/main/client/src/App.tsx) (Web application), [`server/server.js`](https://github.com/qrev-ai/qrev/blob/main/server/server.js) (HTTP application), [`server/routes.js`](https://github.com/qrev-ai/qrev/blob/main/server/routes.js) (API route registry), [`ai/projects/chat/src/qai/chat`](https://github.com/qrev-ai/qrev/tree/main/ai/projects/chat/src/qai/chat) (Chat runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_client_app["Web application<br/>[App.tsx]"]
  node_client_layout["Workspace layout<br/>[Layout.tsx]"]
  node_client_agent["Agent chat<br/>[agentChat.tsx]"]
  node_client_campaign["Campaign workspace<br/>[index.tsx]"]
  node_client_crm["CRM workspace<br/>[index.tsx]"]
  node_client_apps["App integrations UI<br/>[DefaultApps.tsx]"]
  node_client_settings["Workspace settings<br/>[settings.tsx]"]
end

subgraph group_app["App server"]
  node_app_server["HTTP application<br/>[server.js]"]
  node_app_routes["API route registry<br/>[routes.js]"]
  node_mongo[("MongoDB")]
end

subgraph group_sales["Sales capabilities"]
  node_campaign_api["Campaign APIs<br/>[campaign.apis.js]"]
  node_campaign_routes["Campaign routes<br/>[campaign.routes.js]"]
  node_agent_api["Agent APIs<br/>[agents.apis.js]"]
  node_agent_routes["Agent routes<br/>[agent.routes.js]"]
  node_crm_api["CRM APIs"]
  node_integration_api["Integration APIs<br/>[zoom.apis.js]"]
end

subgraph group_ai["AI services"]
  node_ai_server["AI server"]
  node_chat_runtime["Chat runtime"]
  node_llm_frameworks["LLM frameworks"]
  node_chroma[("ChromaDB<br/>[chroma.py]")]
end

node_user(("Sales user"))

node_user -->|"uses"| node_client_app
node_client_app -->|"renders"| node_client_layout
node_client_app -->|"routes to"| node_client_agent
node_client_app -->|"routes to"| node_client_campaign
node_client_app -->|"routes to"| node_client_crm
node_client_app -->|"routes to"| node_client_apps
node_client_app -->|"routes to"| node_client_settings
node_client_agent -.->|"sends chat requests"| node_app_server
node_client_campaign -.->|"calls APIs"| node_app_server
node_client_crm -.->|"calls APIs"| node_app_server
node_client_apps -.->|"connects integrations"| node_app_server
node_app_server -->|"registers routes"| node_app_routes
node_app_routes -->|"mounts routes"| node_campaign_routes
node_app_routes -->|"mounts routes"| node_agent_routes
node_campaign_routes -->|"dispatches requests"| node_campaign_api
node_agent_routes -->|"dispatches requests"| node_agent_api
node_app_routes -->|"mounts routes"| node_crm_api
node_app_routes -->|"mounts routes"| node_integration_api
node_app_server -.->|"uses app database"| node_mongo
node_app_server -.->|"forwards AI work"| node_ai_server
node_ai_server -.->|"serves chat"| node_chat_runtime
node_chat_runtime -.->|"uses language models"| node_llm_frameworks
node_chat_runtime -.->|"retrieves vectors"| node_chroma

click node_client_app "https://github.com/qrev-ai/qrev/blob/main/client/src/App.tsx"
click node_client_layout "https://github.com/qrev-ai/qrev/blob/main/client/src/layout/Layout.tsx"
click node_client_agent "https://github.com/qrev-ai/qrev/blob/main/client/src/pages/agent/agentChat.tsx"
click node_client_campaign "https://github.com/qrev-ai/qrev/blob/main/client/src/pages/campaigns/index.tsx"
click node_client_crm "https://github.com/qrev-ai/qrev/blob/main/client/src/pages/crm/index.tsx"
click node_client_apps "https://github.com/qrev-ai/qrev/blob/main/client/src/pages/apps/DefaultApps.tsx"
click node_client_settings "https://github.com/qrev-ai/qrev/blob/main/client/src/pages/settings/settings.tsx"
click node_app_server "https://github.com/qrev-ai/qrev/blob/main/server/server.js"
click node_app_routes "https://github.com/qrev-ai/qrev/blob/main/server/routes.js"
click node_campaign_api "https://github.com/qrev-ai/qrev/blob/main/server/apis/campaign/campaign.apis.js"
click node_campaign_routes "https://github.com/qrev-ai/qrev/blob/main/server/routes/campaign/campaign.routes.js"
click node_agent_api "https://github.com/qrev-ai/qrev/blob/main/server/apis/agents/agents.apis.js"
click node_agent_routes "https://github.com/qrev-ai/qrev/blob/main/server/routes/agents/agent.routes.js"
click node_crm_api "https://github.com/qrev-ai/qrev/blob/main/server/apis/crm/opportunity.apis.js"
click node_integration_api "https://github.com/qrev-ai/qrev/blob/main/server/apis/integration/zoom.apis.js"
click node_ai_server "https://github.com/qrev-ai/qrev/tree/main/ai/projects/server/src/qai/server"
click node_chat_runtime "https://github.com/qrev-ai/qrev/tree/main/ai/projects/chat/src/qai/chat"
click node_llm_frameworks "https://github.com/qrev-ai/qrev/tree/main/ai/projects/ai/src/qai/ai/frameworks"
click node_chroma "https://github.com/qrev-ai/qrev/blob/main/ai/projects/chat/src/qai/chat/db/chroma/chroma.py"

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_client_app,node_client_layout,node_client_agent,node_client_campaign,node_client_crm,node_client_apps,node_client_settings,node_user toneBlue
class node_app_server,node_app_routes,node_mongo toneAmber
class node_campaign_api,node_campaign_routes,node_agent_api,node_agent_routes,node_crm_api,node_integration_api toneMint
class node_ai_server,node_chat_runtime,node_llm_frameworks,node_chroma toneRose
```

## Components

### Web client

- [Web application](https://github.com/qrev-ai/qrev/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Workspace layout](https://github.com/qrev-ai/qrev/blob/main/client/src/layout/Layout.tsx): `client/src/layout/Layout.tsx`
- [Agent chat](https://github.com/qrev-ai/qrev/blob/main/client/src/pages/agent/agentChat.tsx): `client/src/pages/agent/agentChat.tsx`
- [Campaign workspace](https://github.com/qrev-ai/qrev/blob/main/client/src/pages/campaigns/index.tsx): `client/src/pages/campaigns/index.tsx`
- [CRM workspace](https://github.com/qrev-ai/qrev/blob/main/client/src/pages/crm/index.tsx): `client/src/pages/crm/index.tsx`
- [App integrations UI](https://github.com/qrev-ai/qrev/blob/main/client/src/pages/apps/DefaultApps.tsx): `client/src/pages/apps/DefaultApps.tsx`
- [Workspace settings](https://github.com/qrev-ai/qrev/blob/main/client/src/pages/settings/settings.tsx): `client/src/pages/settings/settings.tsx`

### App server

- [HTTP application](https://github.com/qrev-ai/qrev/blob/main/server/server.js): `server/server.js`
- [API route registry](https://github.com/qrev-ai/qrev/blob/main/server/routes.js): `server/routes.js`
- **MongoDB**

### Sales capabilities

- [Campaign APIs](https://github.com/qrev-ai/qrev/blob/main/server/apis/campaign/campaign.apis.js): `server/apis/campaign/campaign.apis.js`
- [Campaign routes](https://github.com/qrev-ai/qrev/blob/main/server/routes/campaign/campaign.routes.js): `server/routes/campaign/campaign.routes.js`
- [Agent APIs](https://github.com/qrev-ai/qrev/blob/main/server/apis/agents/agents.apis.js): `server/apis/agents/agents.apis.js`
- [Agent routes](https://github.com/qrev-ai/qrev/blob/main/server/routes/agents/agent.routes.js): `server/routes/agents/agent.routes.js`
- [CRM APIs](https://github.com/qrev-ai/qrev/blob/main/server/apis/crm/opportunity.apis.js): `server/apis/crm/opportunity.apis.js`
- [Integration APIs](https://github.com/qrev-ai/qrev/blob/main/server/apis/integration/zoom.apis.js): `server/apis/integration/zoom.apis.js`

### AI services

- [AI server](https://github.com/qrev-ai/qrev/tree/main/ai/projects/server/src/qai/server): `ai/projects/server/src/qai/server`
- [Chat runtime](https://github.com/qrev-ai/qrev/tree/main/ai/projects/chat/src/qai/chat): `ai/projects/chat/src/qai/chat`
- [LLM frameworks](https://github.com/qrev-ai/qrev/tree/main/ai/projects/ai/src/qai/ai/frameworks): `ai/projects/ai/src/qai/ai/frameworks`
- [ChromaDB](https://github.com/qrev-ai/qrev/blob/main/ai/projects/chat/src/qai/chat/db/chroma/chroma.py): `ai/projects/chat/src/qai/chat/db/chroma/chroma.py`

### Other components

- **Sales user**

## Connections

- Sales user → Web application: uses
- Web application → Workspace layout: renders (evidence: `client/src/App.tsx`)
- Web application → Agent chat: routes to (evidence: `client/src/App.tsx`)
- Web application → Campaign workspace: routes to (evidence: `client/src/App.tsx`)
- Web application → CRM workspace: routes to (evidence: `client/src/App.tsx`)
- Web application → App integrations UI: routes to (evidence: `client/src/App.tsx`)
- Web application → Workspace settings: routes to (evidence: `client/src/App.tsx`)
- Agent chat → HTTP application: sends chat requests
- Campaign workspace → HTTP application: calls APIs
- CRM workspace → HTTP application: calls APIs
- App integrations UI → HTTP application: connects integrations
- HTTP application → API route registry: registers routes (evidence: `server/server.js`)
- API route registry → Campaign routes: mounts routes (evidence: `server/routes.js`)
- API route registry → Agent routes: mounts routes (evidence: `server/routes.js`)
- Campaign routes → Campaign APIs: dispatches requests (evidence: `server/routes/campaign/campaign.routes.js`)
- Agent routes → Agent APIs: dispatches requests (evidence: `server/routes/agents/agent.routes.js`)
- API route registry → CRM APIs: mounts routes
- API route registry → Integration APIs: mounts routes
- HTTP application → MongoDB: uses app database
- HTTP application → AI server: forwards AI work
- AI server → Chat runtime: serves chat
- Chat runtime → LLM frameworks: uses language models
- Chat runtime → ChromaDB: retrieves vectors
