# chenhg5/cc-connect architecture

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

- Interactive diagram: https://gitdiagram.com/chenhg5/cc-connect
- Repository: https://github.com/chenhg5/cc-connect

## Overview

cc-connect connects chat platforms and a web dashboard to local coding agents, routing user requests into project-specific sessions and returning agent output to the initiating channel. The main runtime also exposes management, scheduled automation, webhooks, and a browser-based control surface. The README excerpt confirms the local-project chat workflow and broad platform support; sampled source confirms startup wiring, the web API client, bridge socket, and webhook behavior. Platform and agent internals are represented by their source directories because their implementations were not sampled.

Main entry points: [`cmd/cc-connect/main.go`](https://github.com/chenhg5/cc-connect/blob/main/cmd/cc-connect/main.go) (CLI runtime), [`core/engine.go`](https://github.com/chenhg5/cc-connect/blob/main/core/engine.go) (Project engine), [`web/src/App.tsx`](https://github.com/chenhg5/cc-connect/blob/main/web/src/App.tsx) (Admin dashboard), [`platform`](https://github.com/chenhg5/cc-connect/tree/main/platform) (Chat adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Core runtime"]
  node_main["CLI runtime<br/>[main.go]"]
  node_config["Configuration<br/>[config.go]"]
  node_engine["Project engine<br/>[engine.go]"]
  node_registry["Plugin registry<br/>[registry.go]"]
  node_session["Session handling<br/>[session.go]"]
end

subgraph group_channels["Chat channels"]
  node_platforms["Chat adapters"]
  node_bridge["Web chat bridge<br/>[bridge.go]"]
end

subgraph group_agents["Coding agents"]
  node_agents["Agent integrations"]
end

subgraph group_automation["Automation"]
  node_webhook["Webhook intake<br/>[webhook.go]"]
  node_cron["Scheduled tasks<br/>[cron.go]"]
  node_daemon["Daemon manager<br/>[manager.go]"]
end

subgraph group_web["Web management"]
  node_webui["Admin dashboard<br/>[App.tsx]"]
  node_webclient["Web API client<br/>[client.ts]"]
  node_api["Management API<br/>[api.go]"]
end

node_user(("Chat user"))
node_admin(("Web admin"))
node_agentcli["Local agent CLIs"]
node_browser(("Browser"))
node_external["Chat services"]

node_user -->|"sends request"| node_external
node_external -->|"delivers message"| node_platforms
node_platforms -->|"forwards message"| node_engine
node_main -->|"loads settings"| node_config
node_main -->|"creates plugins"| node_registry
node_main -->|"creates engines"| node_engine
node_engine -->|"manages session"| node_session
node_engine -->|"dispatches work"| node_agents
node_agents -->|"runs locally"| node_agentcli
node_engine -->|"sends reply"| node_platforms
node_main -->|"starts and registers"| node_bridge
node_webui -->|"calls API"| node_webclient
node_webclient -->|"HTTP requests"| node_api
node_browser -->|"uses dashboard"| node_webui
node_webui -->|"connects by socket"| node_bridge
node_main -->|"starts and registers"| node_webhook
node_webhook -->|"dispatches prompt"| node_engine
node_main -->|"registers engines"| node_cron
node_cron -->|"runs scheduled work"| node_engine
node_main -->|"manages service"| node_daemon

click node_main "https://github.com/chenhg5/cc-connect/blob/main/cmd/cc-connect/main.go"
click node_config "https://github.com/chenhg5/cc-connect/blob/main/config/config.go"
click node_engine "https://github.com/chenhg5/cc-connect/blob/main/core/engine.go"
click node_registry "https://github.com/chenhg5/cc-connect/blob/main/core/registry.go"
click node_session "https://github.com/chenhg5/cc-connect/blob/main/core/session.go"
click node_agents "https://github.com/chenhg5/cc-connect/tree/main/agent"
click node_platforms "https://github.com/chenhg5/cc-connect/tree/main/platform"
click node_bridge "https://github.com/chenhg5/cc-connect/blob/main/core/bridge.go"
click node_webhook "https://github.com/chenhg5/cc-connect/blob/main/core/webhook.go"
click node_cron "https://github.com/chenhg5/cc-connect/blob/main/core/cron.go"
click node_daemon "https://github.com/chenhg5/cc-connect/blob/main/daemon/manager.go"
click node_webui "https://github.com/chenhg5/cc-connect/blob/main/web/src/App.tsx"
click node_webclient "https://github.com/chenhg5/cc-connect/blob/main/web/src/api/client.ts"
click node_api "https://github.com/chenhg5/cc-connect/blob/main/core/api.go"

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_main,node_config,node_engine,node_registry,node_session,node_user,node_browser toneBlue
class node_platforms,node_bridge toneAmber
class node_agents toneMint
class node_webhook,node_cron,node_daemon toneRose
class node_webui,node_webclient,node_api,node_admin,node_agentcli,node_external toneIndigo
```

## Components

### Core runtime

- [CLI runtime](https://github.com/chenhg5/cc-connect/blob/main/cmd/cc-connect/main.go): `cmd/cc-connect/main.go`
- [Configuration](https://github.com/chenhg5/cc-connect/blob/main/config/config.go): `config/config.go`
- [Project engine](https://github.com/chenhg5/cc-connect/blob/main/core/engine.go): `core/engine.go`
- [Plugin registry](https://github.com/chenhg5/cc-connect/blob/main/core/registry.go): `core/registry.go`
- [Session handling](https://github.com/chenhg5/cc-connect/blob/main/core/session.go): `core/session.go`

### Chat channels

- [Chat adapters](https://github.com/chenhg5/cc-connect/tree/main/platform): `platform`
- [Web chat bridge](https://github.com/chenhg5/cc-connect/blob/main/core/bridge.go): `core/bridge.go`

### Coding agents

- [Agent integrations](https://github.com/chenhg5/cc-connect/tree/main/agent): `agent`

### Automation

- [Webhook intake](https://github.com/chenhg5/cc-connect/blob/main/core/webhook.go): `core/webhook.go`
- [Scheduled tasks](https://github.com/chenhg5/cc-connect/blob/main/core/cron.go): `core/cron.go`
- [Daemon manager](https://github.com/chenhg5/cc-connect/blob/main/daemon/manager.go): `daemon/manager.go`

### Web management

- [Admin dashboard](https://github.com/chenhg5/cc-connect/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Web API client](https://github.com/chenhg5/cc-connect/blob/main/web/src/api/client.ts): `web/src/api/client.ts`
- [Management API](https://github.com/chenhg5/cc-connect/blob/main/core/api.go): `core/api.go`

### Other components

- **Chat user**
- **Web admin**
- **Local agent CLIs**
- **Browser**
- **Chat services**

## Connections

- Chat user → Chat services: sends request
- Chat services → Chat adapters: delivers message
- Chat adapters → Project engine: forwards message
- CLI runtime → Configuration: loads settings
- CLI runtime → Plugin registry: creates plugins
- CLI runtime → Project engine: creates engines
- Project engine → Session handling: manages session
- Project engine → Agent integrations: dispatches work
- Agent integrations → Local agent CLIs: runs locally
- Project engine → Chat adapters: sends reply
- CLI runtime → Web chat bridge: starts and registers
- Admin dashboard → Web API client: calls API
- Web API client → Management API: HTTP requests
- Browser → Admin dashboard: uses dashboard
- Admin dashboard → Web chat bridge: connects by socket
- CLI runtime → Webhook intake: starts and registers
- Webhook intake → Project engine: dispatches prompt
- CLI runtime → Scheduled tasks: registers engines
- Scheduled tasks → Project engine: runs scheduled work
- CLI runtime → Daemon manager: manages service
