# csillagu/cold-seance architecture

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

- Interactive diagram: https://gitdiagram.com/csillagu/cold-seance
- Repository: https://github.com/csillagu/cold-seance

## Overview

cold-seance is a self-hosted project-planning tool with a React client and a TypeScript backend backed by PostgreSQL. The main workflow is: a team member plans and edits tasks in the browser; the REST API applies scheduling and permission rules and persists the plan; the client presents Kanban, Gantt, load, and variance views. GitHub synchronizes linked issues, while AI integrations can propose changes for human review. The excerpts establish key task, scheduling, webhook, and routing relationships; unsampled modules are included where README capabilities or the source index identify them, without assuming their internal call paths.

Main entry points: [`backend/src/service/tasks.ts`](https://github.com/csillagu/cold-seance/blob/main/backend/src/service/tasks.ts) (Task service), [`frontend/src/App.tsx`](https://github.com/csillagu/cold-seance/blob/main/frontend/src/App.tsx) (Planning interface), [`backend/src/api/api.ts`](https://github.com/csillagu/cold-seance/blob/main/backend/src/api/api.ts) (REST API), [`frontend/src/api.ts`](https://github.com/csillagu/cold-seance/blob/main/frontend/src/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_browser["Planning interface<br/>[App.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_planning_views["Planning views<br/>[Gantt.tsx]"]
  node_proposal_ui["Proposal review<br/>[ReviewControls.tsx]"]
end

subgraph group_backend["API and services"]
  node_rest_api["REST API<br/>[api.ts]"]
  node_task_routes["Task endpoints<br/>[tasks.ts]"]
  node_service_registry["Service registry<br/>[services.ts]"]
  node_roles["Project roles<br/>[project-roles.ts]"]
  node_audit["Audit log<br/>[audit.ts]"]
  node_database[("PostgreSQL<br/>[client.ts]")]
end

subgraph group_planning["Planning domain"]
  node_task_service["Task service<br/>[tasks.ts]"]
  node_scheduling["Plan scheduling<br/>[plan-scheduling.ts]"]
  node_assignments["Assignment rules<br/>[assignment.ts]"]
  node_red_flags["Conflict flags<br/>[red-flags.ts]"]
end

subgraph group_integrations["GitHub and AI"]
  node_github_webhooks["Webhook intake<br/>[webhooks.ts]"]
  node_change_handler["Issue change handler<br/>[change-handler.ts]"]
  node_issue_tasks["Issue-task linking"]
  node_mcp["MCP server<br/>[mcp.ts]"]
end

node_team(("Team member"))
node_github(("GitHub"))
node_ai(("AI assistant"))

node_team -->|"plans in"| node_browser
node_browser -->|"opens views"| node_planning_views
node_browser -->|"requests data"| node_api_client
node_api_client -->|"calls REST"| node_rest_api
node_rest_api -->|"routes tasks"| node_task_routes
node_task_routes -->|"uses services"| node_service_registry
node_service_registry -->|"registers service"| node_task_service
node_task_service -->|"checks assignments"| node_assignments
node_task_service -->|"reschedules plan"| node_scheduling
node_task_service -->|"refreshes flags"| node_red_flags
node_task_service -->|"reads and writes"| node_database
node_task_service -->|"records changes"| node_audit
node_roles -->|"reads roles"| node_database
node_github -.->|"sends events"| node_github_webhooks
node_github_webhooks -->|"dispatches events"| node_change_handler
node_change_handler -->|"creates linked tasks"| node_issue_tasks
node_ai -->|"connects through"| node_mcp
node_ai -->|"connects through"| node_rest_api
node_team -->|"reviews proposals"| node_proposal_ui

click node_browser "https://github.com/csillagu/cold-seance/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/csillagu/cold-seance/blob/main/frontend/src/api.ts"
click node_planning_views "https://github.com/csillagu/cold-seance/blob/main/frontend/src/gantt/Gantt.tsx"
click node_proposal_ui "https://github.com/csillagu/cold-seance/blob/main/frontend/src/proposals/ReviewControls.tsx"
click node_rest_api "https://github.com/csillagu/cold-seance/blob/main/backend/src/api/api.ts"
click node_task_routes "https://github.com/csillagu/cold-seance/blob/main/backend/src/api/tasks.ts"
click node_service_registry "https://github.com/csillagu/cold-seance/blob/main/backend/src/service/services.ts"
click node_task_service "https://github.com/csillagu/cold-seance/blob/main/backend/src/service/tasks.ts"
click node_scheduling "https://github.com/csillagu/cold-seance/blob/main/backend/src/service/plan-scheduling.ts"
click node_assignments "https://github.com/csillagu/cold-seance/blob/main/backend/src/service/assignment.ts"
click node_red_flags "https://github.com/csillagu/cold-seance/blob/main/backend/src/service/red-flags.ts"
click node_roles "https://github.com/csillagu/cold-seance/blob/main/backend/src/service/project-roles.ts"
click node_audit "https://github.com/csillagu/cold-seance/blob/main/backend/src/service/audit.ts"
click node_database "https://github.com/csillagu/cold-seance/blob/main/backend/src/db/client.ts"
click node_github_webhooks "https://github.com/csillagu/cold-seance/blob/main/backend/src/github/webhooks.ts"
click node_change_handler "https://github.com/csillagu/cold-seance/blob/main/backend/src/github/change-handler.ts"
click node_issue_tasks "https://github.com/csillagu/cold-seance/blob/main/backend/src/service/github-issue-tasks.ts"
click node_mcp "https://github.com/csillagu/cold-seance/blob/main/backend/src/mcp/mcp.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_browser,node_api_client,node_planning_views,node_proposal_ui toneBlue
class node_rest_api,node_task_routes,node_service_registry,node_roles,node_audit,node_database toneAmber
class node_task_service,node_scheduling,node_assignments,node_red_flags toneMint
class node_github_webhooks,node_change_handler,node_issue_tasks,node_mcp toneRose
class node_team,node_github,node_ai toneIndigo
```

## Components

### Web client

- [Planning interface](https://github.com/csillagu/cold-seance/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/csillagu/cold-seance/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [Planning views](https://github.com/csillagu/cold-seance/blob/main/frontend/src/gantt/Gantt.tsx): `frontend/src/gantt/Gantt.tsx`
- [Proposal review](https://github.com/csillagu/cold-seance/blob/main/frontend/src/proposals/ReviewControls.tsx): `frontend/src/proposals/ReviewControls.tsx`

### API and services

- [REST API](https://github.com/csillagu/cold-seance/blob/main/backend/src/api/api.ts): `backend/src/api/api.ts`
- [Task endpoints](https://github.com/csillagu/cold-seance/blob/main/backend/src/api/tasks.ts): `backend/src/api/tasks.ts`
- [Service registry](https://github.com/csillagu/cold-seance/blob/main/backend/src/service/services.ts): `backend/src/service/services.ts`
- [Project roles](https://github.com/csillagu/cold-seance/blob/main/backend/src/service/project-roles.ts): `backend/src/service/project-roles.ts`
- [Audit log](https://github.com/csillagu/cold-seance/blob/main/backend/src/service/audit.ts): `backend/src/service/audit.ts`
- [PostgreSQL](https://github.com/csillagu/cold-seance/blob/main/backend/src/db/client.ts): `backend/src/db/client.ts`

### Planning domain

- [Task service](https://github.com/csillagu/cold-seance/blob/main/backend/src/service/tasks.ts): `backend/src/service/tasks.ts`
- [Plan scheduling](https://github.com/csillagu/cold-seance/blob/main/backend/src/service/plan-scheduling.ts): `backend/src/service/plan-scheduling.ts`
- [Assignment rules](https://github.com/csillagu/cold-seance/blob/main/backend/src/service/assignment.ts): `backend/src/service/assignment.ts`
- [Conflict flags](https://github.com/csillagu/cold-seance/blob/main/backend/src/service/red-flags.ts): `backend/src/service/red-flags.ts`

### GitHub and AI

- [Webhook intake](https://github.com/csillagu/cold-seance/blob/main/backend/src/github/webhooks.ts): `backend/src/github/webhooks.ts`
- [Issue change handler](https://github.com/csillagu/cold-seance/blob/main/backend/src/github/change-handler.ts): `backend/src/github/change-handler.ts`
- [Issue-task linking](https://github.com/csillagu/cold-seance/blob/main/backend/src/service/github-issue-tasks.ts): `backend/src/service/github-issue-tasks.ts`
- [MCP server](https://github.com/csillagu/cold-seance/blob/main/backend/src/mcp/mcp.ts): `backend/src/mcp/mcp.ts`

### Other components

- **Team member**
- **GitHub**
- **AI assistant**

## Connections

- Team member → Planning interface: plans in (evidence: `README.md`)
- Planning interface → Planning views: opens views (evidence: `frontend/src/App.tsx`)
- Planning interface → API client: requests data (evidence: `README.md`)
- API client → REST API: calls REST (evidence: `README.md`)
- REST API → Task endpoints: routes tasks (evidence: `backend/src/api/api.ts`)
- Task endpoints → Service registry: uses services (evidence: `backend/src/api/api.ts`)
- Service registry → Task service: registers service (evidence: `backend/src/service/services.ts`)
- Task service → Assignment rules: checks assignments (evidence: `backend/src/service/tasks.ts`)
- Task service → Plan scheduling: reschedules plan (evidence: `backend/src/service/tasks.ts`)
- Task service → Conflict flags: refreshes flags (evidence: `backend/src/service/tasks.ts`)
- Task service → PostgreSQL: reads and writes (evidence: `backend/src/service/tasks.ts`)
- Task service → Audit log: records changes (evidence: `backend/src/service/tasks.ts`)
- Project roles → PostgreSQL: reads roles (evidence: `backend/src/service/project-roles.ts`)
- GitHub → Webhook intake: sends events (evidence: `README.md`)
- Webhook intake → Issue change handler: dispatches events (evidence: `backend/src/github/webhooks.ts`)
- Issue change handler → Issue-task linking: creates linked tasks (evidence: `backend/src/github/change-handler.ts`)
- AI assistant → MCP server: connects through (evidence: `README.md`)
- AI assistant → REST API: connects through (evidence: `README.md`)
- Team member → Proposal review: reviews proposals (evidence: `README.md`)
