# clawnify/opendealflow architecture

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

- Interactive diagram: https://gitdiagram.com/clawnify/opendealflow
- Repository: https://github.com/clawnify/opendealflow

## Overview

OpenDealflow is a self-hosted venture CRM. Investors manage companies and people, track deals through configurable VC stages, and use relationship paths and activity history to inform follow-up. The browser app routes users to CRM views; shared client state calls the REST API, which handles persistence and domain operations. Import, custom attributes, and connected email/calendar/Slack workflows extend the core. Some server routes are unsampled, so those capabilities and their links are included only where documented in the README or visible in the excerpts.

Main entry points: [`src/client/app.tsx`](https://github.com/clawnify/opendealflow/blob/main/src/client/app.tsx) (Application shell), [`src/client/hooks/use-crm.ts`](https://github.com/clawnify/opendealflow/blob/main/src/client/hooks/use-crm.ts) (CRM state), [`src/server/index.ts`](https://github.com/clawnify/opendealflow/blob/main/src/server/index.ts) (REST API), [`src/server/integrations.ts`](https://github.com/clawnify/opendealflow/blob/main/src/server/integrations.ts) (Integration actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["CRM client"]
  node_app["Application shell<br/>[app.tsx]"]
  node_router["Path router<br/>[use-router.ts]"]
  node_state["CRM state<br/>[use-crm.ts]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_records["Dealflow workflows"]
  node_people["People and network<br/>[contact-detail.tsx]"]
  node_companies["Company records<br/>[companies-page.tsx]"]
  node_pipeline["Deal pipeline<br/>[deals-board.tsx]"]
  node_attributes_ui["Attribute settings"]
  node_import_ui["Bulk import<br/>[import-dialog.tsx]"]
end

subgraph group_server["API and data"]
  node_api["REST API<br/>[index.ts]"]
  node_database[("CRM database<br/>[db.ts]")]
end

subgraph group_extensions["Extensions"]
  node_custom_fields["Custom field registry<br/>[custom-fields.ts]"]
  node_integrations["Integration actions<br/>[integrations.ts]"]
end

node_investor(("Investor or agent"))
node_gmail["Gmail"]
node_calendar["Google Calendar"]
node_slack["Slack"]

node_investor -->|"uses"| node_app
node_app -->|"routes with"| node_router
node_app -->|"loads state"| node_state
node_app -->|"renders"| node_people
node_app -->|"renders"| node_companies
node_app -->|"renders"| node_pipeline
node_app -->|"renders"| node_attributes_ui
node_state -->|"calls"| node_api_client
node_people -.->|"uses"| node_state
node_companies -.->|"uses"| node_state
node_pipeline -.->|"uses"| node_state
node_attributes_ui -.->|"uses"| node_state
node_import_ui -.->|"imports records"| node_state
node_api_client -->|"requests"| node_api
node_api -->|"queries and writes"| node_database
node_api -->|"loads definitions"| node_custom_fields
node_api -.->|"dispatches actions"| node_integrations
node_custom_fields -->|"syncs columns"| node_database
node_integrations -->|"sends email"| node_gmail
node_integrations -->|"creates events"| node_calendar
node_integrations -->|"posts messages"| node_slack

click node_app "https://github.com/clawnify/opendealflow/blob/main/src/client/app.tsx"
click node_router "https://github.com/clawnify/opendealflow/blob/main/src/client/hooks/use-router.ts"
click node_state "https://github.com/clawnify/opendealflow/blob/main/src/client/hooks/use-crm.ts"
click node_api_client "https://github.com/clawnify/opendealflow/blob/main/src/client/api.ts"
click node_people "https://github.com/clawnify/opendealflow/blob/main/src/client/components/contacts/contact-detail.tsx"
click node_companies "https://github.com/clawnify/opendealflow/blob/main/src/client/components/companies/companies-page.tsx"
click node_pipeline "https://github.com/clawnify/opendealflow/blob/main/src/client/components/deals/deals-board.tsx"
click node_attributes_ui "https://github.com/clawnify/opendealflow/blob/main/src/client/components/properties/properties-page.tsx"
click node_import_ui "https://github.com/clawnify/opendealflow/blob/main/src/client/components/import-dialog.tsx"
click node_api "https://github.com/clawnify/opendealflow/blob/main/src/server/index.ts"
click node_database "https://github.com/clawnify/opendealflow/blob/main/src/server/db.ts"
click node_custom_fields "https://github.com/clawnify/opendealflow/blob/main/src/server/custom-fields.ts"
click node_integrations "https://github.com/clawnify/opendealflow/blob/main/src/server/integrations.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_app,node_router,node_state,node_api_client toneBlue
class node_people,node_companies,node_pipeline,node_attributes_ui,node_import_ui toneAmber
class node_api,node_database toneMint
class node_custom_fields,node_integrations toneRose
class node_investor,node_gmail,node_calendar,node_slack toneIndigo
```

## Components

### CRM client

- [Application shell](https://github.com/clawnify/opendealflow/blob/main/src/client/app.tsx): `src/client/app.tsx`
- [Path router](https://github.com/clawnify/opendealflow/blob/main/src/client/hooks/use-router.ts): `src/client/hooks/use-router.ts`
- [CRM state](https://github.com/clawnify/opendealflow/blob/main/src/client/hooks/use-crm.ts): `src/client/hooks/use-crm.ts`
- [API client](https://github.com/clawnify/opendealflow/blob/main/src/client/api.ts): `src/client/api.ts`

### Dealflow workflows

- [People and network](https://github.com/clawnify/opendealflow/blob/main/src/client/components/contacts/contact-detail.tsx): `src/client/components/contacts/contact-detail.tsx`
- [Company records](https://github.com/clawnify/opendealflow/blob/main/src/client/components/companies/companies-page.tsx): `src/client/components/companies/companies-page.tsx`
- [Deal pipeline](https://github.com/clawnify/opendealflow/blob/main/src/client/components/deals/deals-board.tsx): `src/client/components/deals/deals-board.tsx`
- [Attribute settings](https://github.com/clawnify/opendealflow/blob/main/src/client/components/properties/properties-page.tsx): `src/client/components/properties/properties-page.tsx`
- [Bulk import](https://github.com/clawnify/opendealflow/blob/main/src/client/components/import-dialog.tsx): `src/client/components/import-dialog.tsx`

### API and data

- [REST API](https://github.com/clawnify/opendealflow/blob/main/src/server/index.ts): `src/server/index.ts`
- [CRM database](https://github.com/clawnify/opendealflow/blob/main/src/server/db.ts): `src/server/db.ts`

### Extensions

- [Custom field registry](https://github.com/clawnify/opendealflow/blob/main/src/server/custom-fields.ts): `src/server/custom-fields.ts`
- [Integration actions](https://github.com/clawnify/opendealflow/blob/main/src/server/integrations.ts): `src/server/integrations.ts`

### Other components

- **Investor or agent**
- **Gmail**
- **Google Calendar**
- **Slack**

## Connections

- Investor or agent → Application shell: uses (evidence: `README.md`)
- Application shell → Path router: routes with (evidence: `src/client/app.tsx`)
- Application shell → CRM state: loads state (evidence: `src/client/app.tsx`)
- Application shell → People and network: renders (evidence: `src/client/app.tsx`)
- Application shell → Company records: renders (evidence: `src/client/app.tsx`)
- Application shell → Deal pipeline: renders (evidence: `src/client/app.tsx`)
- Application shell → Attribute settings: renders (evidence: `src/client/app.tsx`)
- CRM state → API client: calls (evidence: `src/client/hooks/use-crm.ts`)
- People and network → CRM state: uses
- Company records → CRM state: uses
- Deal pipeline → CRM state: uses
- Attribute settings → CRM state: uses
- Bulk import → CRM state: imports records
- API client → REST API: requests (evidence: `README.md`)
- REST API → CRM database: queries and writes (evidence: `src/server/index.ts`)
- REST API → Custom field registry: loads definitions (evidence: `src/server/index.ts`)
- REST API → Integration actions: dispatches actions (evidence: `src/server/index.ts`)
- Custom field registry → CRM database: syncs columns (evidence: `src/server/custom-fields.ts`)
- Integration actions → Gmail: sends email (evidence: `src/server/integrations.ts`)
- Integration actions → Google Calendar: creates events (evidence: `src/server/integrations.ts`)
- Integration actions → Slack: posts messages (evidence: `src/server/integrations.ts`)
