# caiovpinheiro/frontend_crm1 architecture

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

- Interactive diagram: https://gitdiagram.com/caiovpinheiro/frontend_crm1
- Repository: https://github.com/caiovpinheiro/frontend_crm1

## Overview

CRM EduIT is a frontend for sales and customer-service teams; its REST API and persistence run in a separate backend. Users enter through the authenticated app, work across pipeline, inbox, automation, campaign, and AI-agent screens, and receive CRM results from the backend. The automation editor also supports flow authoring and local simulation. The README documents the frontend/backend boundary and editor capabilities; sampled source confirms pipeline search/realtime and simulation internals. Other product areas are represented from the route tree, without asserting unsampled call relationships.

Main entry points: [`src/lib/api.ts`](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/api.ts) (Backend API client), [`src/app/(app)/automations/[id]/client-page.tsx`](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/automations/%5Bid%5D/client-page.tsx) (Automation editor), [`src/components/pipeline/kanban-board.tsx`](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/components/pipeline/kanban-board.tsx) (Sales pipeline), [`src/lib/flow-sim-engine.ts`](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/flow-sim-engine.ts) (Flow simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_auth["Sign-in<br/>[client-page.tsx]"]
  node_app_shell["App shell<br/>[layout.tsx]"]
  node_settings["CRM settings<br/>[client-page.tsx]"]
end

subgraph group_crm["CRM workspaces"]
  node_pipeline["Sales pipeline<br/>[kanban-board.tsx]"]
  node_pipeline_search["Pipeline search"]
  node_pipeline_realtime["Pipeline realtime"]
  node_inbox["Conversations inbox<br/>[_v2-client.tsx]"]
  node_contacts["Contacts and companies<br/>[client-page.tsx]"]
  node_activities["Activities<br/>[client-page.tsx]"]
  node_analytics["Analytics<br/>[client-page.tsx]"]
end

subgraph group_engagement["Customer engagement"]
  node_automation_editor["Automation editor<br/>[client-page.tsx]"]
  node_automation_components["Flow canvas components<br/>[flow-editor.tsx]"]
  node_flow_sim["Flow simulator<br/>[flow-sim-engine.ts]"]
  node_workflow_model["Workflow model"]
  node_flow_steps["Step adapter"]
  node_campaigns["Campaigns<br/>[client-page.tsx]"]
  node_ai_agents["AI agents<br/>[client-page.tsx]"]
end

subgraph group_platform["Shared frontend services"]
  node_api_client["Backend API client<br/>[api.ts]"]
  node_sse["SSE hook<br/>[use-sse.ts]"]
end

node_user(("CRM user"))
node_backend[("Separate CRM backend")]

node_user -->|"signs in"| node_auth
node_user -->|"uses CRM"| node_app_shell
node_app_shell -.->|"opens workspace"| node_pipeline
node_pipeline -.->|"searches deals"| node_pipeline_search
node_pipeline -.->|"refreshes board"| node_pipeline_realtime
node_pipeline_search -->|"fetches deals"| node_api_client
node_pipeline_realtime -->|"subscribes events"| node_sse
node_automation_editor -.->|"renders canvas"| node_automation_components
node_automation_editor -->|"loads and saves flows"| node_backend
node_automation_editor -.->|"simulates flow"| node_flow_sim
node_flow_sim -->|"uses step labels"| node_workflow_model
node_flow_sim -->|"resolves step types"| node_flow_steps
node_api_client -->|"sends HTTP requests"| node_backend
node_sse -->|"receives events"| node_backend
node_inbox -.->|"uses API"| node_api_client
node_contacts -.->|"uses API"| node_api_client
node_activities -.->|"uses API"| node_api_client
node_analytics -.->|"uses API"| node_api_client
node_campaigns -.->|"uses API"| node_api_client
node_ai_agents -.->|"uses API"| node_api_client
node_settings -.->|"uses API"| node_api_client

click node_auth "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(auth)/login/client-page.tsx"
click node_app_shell "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/layout.tsx"
click node_pipeline "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/components/pipeline/kanban-board.tsx"
click node_pipeline_search "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/features/pipeline-v2/use-pipeline-omnisearch.ts"
click node_pipeline_realtime "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/features/pipeline-v2/hooks/use-pipeline-realtime.ts"
click node_inbox "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/inbox/_v2-client.tsx"
click node_contacts "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/contacts/%5Bid%5D/client-page.tsx"
click node_activities "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/activities/client-page.tsx"
click node_analytics "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/analytics/client-page.tsx"
click node_automation_editor "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/automations/%5Bid%5D/client-page.tsx"
click node_automation_components "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/components/automations/flow-editor.tsx"
click node_flow_sim "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/flow-sim-engine.ts"
click node_workflow_model "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/automation-workflow.ts"
click node_flow_steps "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/flow-step-adapter.ts"
click node_campaigns "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/campaigns/client-page.tsx"
click node_ai_agents "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/ai-agents-v2/%5Bid%5D/client-page.tsx"
click node_settings "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/settings/client-page.tsx"
click node_api_client "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/api.ts"
click node_sse "https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/hooks/use-sse.ts"

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_auth,node_app_shell,node_settings,node_user toneBlue
class node_pipeline,node_pipeline_search,node_pipeline_realtime,node_inbox,node_contacts,node_activities,node_analytics,node_backend toneAmber
class node_automation_editor,node_automation_components,node_flow_sim,node_workflow_model,node_flow_steps,node_campaigns,node_ai_agents toneMint
class node_api_client,node_sse toneRose
```

## Components

### Access and shell

- [Sign-in](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(auth)/login/client-page.tsx): `src/app/(auth)/login/client-page.tsx`
- [App shell](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/layout.tsx): `src/app/(app)/layout.tsx`
- [CRM settings](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/settings/client-page.tsx): `src/app/(app)/settings/client-page.tsx`

### CRM workspaces

- [Sales pipeline](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/components/pipeline/kanban-board.tsx): `src/components/pipeline/kanban-board.tsx`
- [Pipeline search](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/features/pipeline-v2/use-pipeline-omnisearch.ts): `src/features/pipeline-v2/use-pipeline-omnisearch.ts`
- [Pipeline realtime](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/features/pipeline-v2/hooks/use-pipeline-realtime.ts): `src/features/pipeline-v2/hooks/use-pipeline-realtime.ts`
- [Conversations inbox](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/inbox/_v2-client.tsx): `src/app/(app)/inbox/_v2-client.tsx`
- [Contacts and companies](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/contacts/%5Bid%5D/client-page.tsx): `src/app/(app)/contacts/[id]/client-page.tsx`
- [Activities](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/activities/client-page.tsx): `src/app/(app)/activities/client-page.tsx`
- [Analytics](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/analytics/client-page.tsx): `src/app/(app)/analytics/client-page.tsx`

### Customer engagement

- [Automation editor](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/automations/%5Bid%5D/client-page.tsx): `src/app/(app)/automations/[id]/client-page.tsx`
- [Flow canvas components](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/components/automations/flow-editor.tsx): `src/components/automations/flow-editor.tsx`
- [Flow simulator](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/flow-sim-engine.ts): `src/lib/flow-sim-engine.ts`
- [Workflow model](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/automation-workflow.ts): `src/lib/automation-workflow.ts`
- [Step adapter](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/flow-step-adapter.ts): `src/lib/flow-step-adapter.ts`
- [Campaigns](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/campaigns/client-page.tsx): `src/app/(app)/campaigns/client-page.tsx`
- [AI agents](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/app/(app)/ai-agents-v2/%5Bid%5D/client-page.tsx): `src/app/(app)/ai-agents-v2/[id]/client-page.tsx`

### Shared frontend services

- [Backend API client](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [SSE hook](https://github.com/caiovpinheiro/frontend_crm1/blob/main/src/hooks/use-sse.ts): `src/hooks/use-sse.ts`

### Other components

- **CRM user**
- **Separate CRM backend**

## Connections

- CRM user → Sign-in: signs in (evidence: `README.md`)
- CRM user → App shell: uses CRM (evidence: `README.md`)
- App shell → Sales pipeline: opens workspace
- Sales pipeline → Pipeline search: searches deals
- Sales pipeline → Pipeline realtime: refreshes board
- Pipeline search → Backend API client: fetches deals (evidence: `src/features/pipeline-v2/use-pipeline-omnisearch.ts`)
- Pipeline realtime → SSE hook: subscribes events (evidence: `src/features/pipeline-v2/hooks/use-pipeline-realtime.ts`)
- Automation editor → Flow canvas components: renders canvas
- Automation editor → Separate CRM backend: loads and saves flows (evidence: `README.md`)
- Automation editor → Flow simulator: simulates flow
- Flow simulator → Workflow model: uses step labels (evidence: `src/lib/flow-sim-engine.ts`)
- Flow simulator → Step adapter: resolves step types (evidence: `src/lib/flow-sim-engine.ts`)
- Backend API client → Separate CRM backend: sends HTTP requests (evidence: `README.md`)
- SSE hook → Separate CRM backend: receives events (evidence: `README.md`)
- Conversations inbox → Backend API client: uses API
- Contacts and companies → Backend API client: uses API
- Activities → Backend API client: uses API
- Analytics → Backend API client: uses API
- Campaigns → Backend API client: uses API
- AI agents → Backend API client: uses API
- CRM settings → Backend API client: uses API
