# shipshitdev/shiplead architecture

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

## Overview

Shiplead is a local-first, self-hosted CRM and agentic SDR cockpit. Operators manage projects, brands, offers, companies, contacts, leads, pipeline, tasks, and inbox work through the desktop app or CLI; the API coordinates CRM operations and persists workspace state in SQLite. Enrichment, reply triage, and sequence advancement are distinct automation stages, with channel adapters available for copilot workflows. The README also documents a web surface. Some UI-to-API wiring and unsampled API capabilities are described only at a high level, so those links are marked unverified or omitted.

Main entry points: [`apps/api/src/app.ts`](https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/app.ts) (API orchestration), [`packages/db/src/index.ts`](https://github.com/shipshitdev/shiplead/blob/master/packages/db/src/index.ts) (SQLite store), [`apps/api/src/server.ts`](https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/server.ts) (HTTP server), [`apps/cli/src/index.ts`](https://github.com/shipshitdev/shiplead/blob/master/apps/cli/src/index.ts) (CLI commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and runtime"]
  node_http_server["HTTP server<br/>[server.ts]"]
  node_api_routes["API orchestration<br/>[app.ts]"]
  node_desktop_service["Local API manager<br/>[api-service.ts]"]
end

subgraph group_sales["CRM workflows"]
  node_crm_operations["CRM operations<br/>[app.ts]"]
  node_lead_enrichment["Lead enrichment<br/>[index.ts]"]
  node_inbox_triage["Reply triage<br/>[app.ts]"]
  node_sequence_cadence["Sequence cadence<br/>[index.ts]"]
end

subgraph group_automation["Agent automation"]
  node_agent_helpers["SDR agents<br/>[index.ts]"]
  node_channel_adapters["Channel copilot<br/>[index.ts]"]
end

subgraph group_storage["Local data"]
  node_sqlite_store[("SQLite store<br/>[index.ts]")]
  node_db_schema["Database schema<br/>[schema.ts]"]
  node_demo_workspace["Demo workspace data<br/>[demo-data.ts]"]
  node_shared_contracts["Types and schemas<br/>[schemas.ts]"]
end

subgraph group_clients["Operator surfaces"]
  node_desktop_renderer["Desktop cockpit<br/>[App.tsx]"]
  node_desktop_entry["Desktop renderer entry<br/>[main.tsx]"]
  node_desktop_main["Desktop main process<br/>[index.ts]"]
  node_cli["CLI commands<br/>[index.ts]"]
  node_web_home["Web landing page<br/>[page.tsx]"]
  node_web_hero["Product landing content<br/>[Hero.tsx]"]
end

node_operator(("Sales operator"))
node_cli_user(("CLI user"))
node_visitor(("Web visitor"))

node_http_server -->|"routes requests"| node_api_routes
node_http_server -->|"opens store"| node_sqlite_store
node_api_routes -->|"reads and writes"| node_sqlite_store
node_api_routes -->|"enriches lead"| node_lead_enrichment
node_api_routes -->|"triages replies"| node_inbox_triage
node_api_routes -->|"advances cadence"| node_sequence_cadence
node_api_routes -->|"requests agent work"| node_agent_helpers
node_api_routes -.->|"uses adapters"| node_channel_adapters
node_sqlite_store -->|"runs migrations"| node_db_schema
node_sqlite_store -.->|"seeds workspace"| node_demo_workspace
node_cli_user -->|"runs commands"| node_cli
node_cli -->|"starts server"| node_http_server
node_cli -->|"runs local operations"| node_sqlite_store
node_operator -.->|"works in cockpit"| node_desktop_renderer
node_desktop_entry -->|"renders"| node_desktop_renderer
node_desktop_main -->|"uses API manager"| node_desktop_service
node_desktop_service -.->|"boots local API"| node_http_server
node_desktop_renderer -.->|"uses CRM API"| node_api_routes
node_visitor -.->|"opens landing page"| node_web_home
node_web_home -->|"renders hero"| node_web_hero
node_agent_helpers -->|"uses shared types"| node_shared_contracts
node_api_routes -.->|"validates inputs"| node_shared_contracts

click node_http_server "https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/server.ts"
click node_api_routes "https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/app.ts"
click node_desktop_service "https://github.com/shipshitdev/shiplead/blob/master/apps/desktop/src/main/api-service.ts"
click node_crm_operations "https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/app.ts"
click node_lead_enrichment "https://github.com/shipshitdev/shiplead/blob/master/packages/enrichment/src/index.ts"
click node_inbox_triage "https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/app.ts"
click node_sequence_cadence "https://github.com/shipshitdev/shiplead/blob/master/packages/sequences/src/index.ts"
click node_agent_helpers "https://github.com/shipshitdev/shiplead/blob/master/packages/agents/src/index.ts"
click node_channel_adapters "https://github.com/shipshitdev/shiplead/blob/master/packages/channels/src/index.ts"
click node_sqlite_store "https://github.com/shipshitdev/shiplead/blob/master/packages/db/src/index.ts"
click node_db_schema "https://github.com/shipshitdev/shiplead/blob/master/packages/db/src/schema.ts"
click node_demo_workspace "https://github.com/shipshitdev/shiplead/blob/master/packages/shared/src/demo-data.ts"
click node_shared_contracts "https://github.com/shipshitdev/shiplead/blob/master/packages/shared/src/schemas.ts"
click node_desktop_renderer "https://github.com/shipshitdev/shiplead/blob/master/apps/desktop/src/renderer/App.tsx"
click node_desktop_entry "https://github.com/shipshitdev/shiplead/blob/master/apps/desktop/src/renderer/main.tsx"
click node_desktop_main "https://github.com/shipshitdev/shiplead/blob/master/apps/desktop/src/main/index.ts"
click node_cli "https://github.com/shipshitdev/shiplead/blob/master/apps/cli/src/index.ts"
click node_web_home "https://github.com/shipshitdev/shiplead/blob/master/apps/web/app/page.tsx"
click node_web_hero "https://github.com/shipshitdev/shiplead/blob/master/apps/web/app/components/Hero.tsx"

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_http_server,node_api_routes,node_desktop_service,node_cli_user toneBlue
class node_crm_operations,node_lead_enrichment,node_inbox_triage,node_sequence_cadence toneAmber
class node_agent_helpers,node_channel_adapters toneMint
class node_sqlite_store,node_db_schema,node_demo_workspace,node_shared_contracts toneRose
class node_desktop_renderer,node_desktop_entry,node_desktop_main,node_cli,node_web_home,node_web_hero,node_operator,node_visitor toneIndigo
```

## Components

### API and runtime

- [HTTP server](https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/server.ts): `apps/api/src/server.ts`
- [API orchestration](https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Local API manager](https://github.com/shipshitdev/shiplead/blob/master/apps/desktop/src/main/api-service.ts): `apps/desktop/src/main/api-service.ts`

### CRM workflows

- [CRM operations](https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Lead enrichment](https://github.com/shipshitdev/shiplead/blob/master/packages/enrichment/src/index.ts): `packages/enrichment/src/index.ts`
- [Reply triage](https://github.com/shipshitdev/shiplead/blob/master/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Sequence cadence](https://github.com/shipshitdev/shiplead/blob/master/packages/sequences/src/index.ts): `packages/sequences/src/index.ts`

### Agent automation

- [SDR agents](https://github.com/shipshitdev/shiplead/blob/master/packages/agents/src/index.ts): `packages/agents/src/index.ts`
- [Channel copilot](https://github.com/shipshitdev/shiplead/blob/master/packages/channels/src/index.ts): `packages/channels/src/index.ts`

### Local data

- [SQLite store](https://github.com/shipshitdev/shiplead/blob/master/packages/db/src/index.ts): `packages/db/src/index.ts`
- [Database schema](https://github.com/shipshitdev/shiplead/blob/master/packages/db/src/schema.ts): `packages/db/src/schema.ts`
- [Demo workspace data](https://github.com/shipshitdev/shiplead/blob/master/packages/shared/src/demo-data.ts): `packages/shared/src/demo-data.ts`
- [Types and schemas](https://github.com/shipshitdev/shiplead/blob/master/packages/shared/src/schemas.ts): `packages/shared/src/schemas.ts`

### Operator surfaces

- [Desktop cockpit](https://github.com/shipshitdev/shiplead/blob/master/apps/desktop/src/renderer/App.tsx): `apps/desktop/src/renderer/App.tsx`
- [Desktop renderer entry](https://github.com/shipshitdev/shiplead/blob/master/apps/desktop/src/renderer/main.tsx): `apps/desktop/src/renderer/main.tsx`
- [Desktop main process](https://github.com/shipshitdev/shiplead/blob/master/apps/desktop/src/main/index.ts): `apps/desktop/src/main/index.ts`
- [CLI commands](https://github.com/shipshitdev/shiplead/blob/master/apps/cli/src/index.ts): `apps/cli/src/index.ts`
- [Web landing page](https://github.com/shipshitdev/shiplead/blob/master/apps/web/app/page.tsx): `apps/web/app/page.tsx`
- [Product landing content](https://github.com/shipshitdev/shiplead/blob/master/apps/web/app/components/Hero.tsx): `apps/web/app/components/Hero.tsx`

### Other components

- **Sales operator**
- **CLI user**
- **Web visitor**

## Connections

- HTTP server → API orchestration: routes requests (evidence: `apps/api/src/server.ts`)
- HTTP server → SQLite store: opens store (evidence: `apps/api/src/server.ts`)
- API orchestration → SQLite store: reads and writes (evidence: `apps/api/src/app.ts`)
- API orchestration → Lead enrichment: enriches lead (evidence: `apps/api/src/app.ts`)
- API orchestration → Reply triage: triages replies (evidence: `apps/api/src/app.ts`)
- API orchestration → Sequence cadence: advances cadence (evidence: `apps/api/src/app.ts`)
- API orchestration → SDR agents: requests agent work (evidence: `apps/api/src/app.ts`)
- API orchestration → Channel copilot: uses adapters
- SQLite store → Database schema: runs migrations (evidence: `packages/db/src/index.ts`)
- SQLite store → Demo workspace data: seeds workspace
- CLI user → CLI commands: runs commands (evidence: `apps/cli/src/index.ts`)
- CLI commands → HTTP server: starts server (evidence: `apps/cli/src/index.ts`)
- CLI commands → SQLite store: runs local operations (evidence: `apps/cli/src/index.ts`)
- Sales operator → Desktop cockpit: works in cockpit
- Desktop renderer entry → Desktop cockpit: renders (evidence: `apps/desktop/src/renderer/main.tsx`)
- Desktop main process → Local API manager: uses API manager (evidence: `apps/desktop/src/main/index.ts`)
- Local API manager → HTTP server: boots local API
- Desktop cockpit → API orchestration: uses CRM API
- Web visitor → Web landing page: opens landing page
- Web landing page → Product landing content: renders hero (evidence: `apps/web/app/page.tsx`)
- SDR agents → Types and schemas: uses shared types (evidence: `packages/agents/src/index.ts`)
- API orchestration → Types and schemas: validates inputs
