# hedaas-code/projectoc architecture

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

- Interactive diagram: https://gitdiagram.com/hedaas-code/projectoc
- Repository: https://github.com/hedaas-code/projectoc

## Overview

ProjectOC is a self-hosted worldbuilding workbench that turns canvas drafts into reviewed, traceable canon. The main user flow runs from the Vue workbench and collaborative canvas through AI dialogue and proposals, then explicit review and commit; committed content is represented in Git and projected into a graph. Separate workspaces support branch/merge exploration, timeline editing and history, and maintenance. The source index and README support the documented boundaries, but many API and UI implementations were not sampled, so those connections are cited to the README or omitted where uncertain.

Main entry points: [`frontend/src/App.vue`](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/App.vue) (Vue workbench), [`backend/apps/core/views.py`](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/views.py) (Django REST API), [`frontend/src/services/api.ts`](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/services/api.ts) (REST client), [`backend/apps/canvas/services/commit.py`](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/canvas/services/commit.py) (Reviewed canvas commit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workbench["Workbench"]
  node_app["Vue workbench<br/>[App.vue]"]
  node_workbench_store["Workspace state<br/>[workbench.ts]"]
  node_api_client["REST client<br/>[api.ts]"]
  node_canvas_ui["Inspiration canvas<br/>[CanvasSurface.vue]"]
  node_dialogue_ui["AI dialogue<br/>[DialoguePanel.vue]"]
  node_proposal_ui["Proposal review<br/>[ProposalPanel.vue]"]
  node_graph_ui["Graph workspace<br/>[GraphPanel.vue]"]
  node_timeline_ui["Timeline workspace<br/>[TimelinePanel.vue]"]
  node_history_ui["History and merge<br/>[HistoryPanel.vue]"]
  node_maintenance_ui["Maintenance status"]
end

subgraph group_authoring["Authoring"]
  node_django_api["Django REST API<br/>[views.py]"]
  node_accounts["Accounts and permissions<br/>[views.py]"]
  node_ai_services["AI dialogue and memory<br/>[dialogue.py]"]
  node_agent_analysis["Auditable analysis<br/>[analysis.py]"]
end

subgraph group_canon["Canon and history"]
  node_canvas_commit["Reviewed canvas commit<br/>[commit.py]"]
  node_branching["Branch overlays<br/>[branching.py]"]
  node_consistency["Canon consistency<br/>[consistency.py]"]
  node_timeline_data[("Timeline and temporal data<br/>[models.py]")]
  node_git_history[("World-content Git history<br/>[git_sync.py]")]
end

subgraph group_platform["Sync and projections"]
  node_postgres[("PostgreSQL canon store")]
  node_outbox["Durable outbox worker<br/>[outbox_worker.py]"]
  node_graph_projection[("Neo4j projection")]
  node_sync_server["Canvas sync service<br/>[server.js]"]
  node_sync_room["TLDraw rooms<br/>[tldraw-room.js]"]
  node_redis_lease[("Room leases<br/>[room-lease.js]")]
end

node_creator(("Creator"))
node_tldraw_client(("TLDraw client"))

node_creator -->|"uses"| node_app
node_app -->|"loads state"| node_workbench_store
node_app -->|"shows canvas"| node_canvas_ui
node_app -->|"shows dialogue"| node_dialogue_ui
node_app -->|"shows proposals"| node_proposal_ui
node_app -->|"shows graph"| node_graph_ui
node_app -->|"shows timeline"| node_timeline_ui
node_app -->|"shows history"| node_history_ui
node_app -.->|"shows status"| node_maintenance_ui
node_workbench_store -->|"requests data"| node_api_client
node_dialogue_ui -->|"streams dialogue"| node_api_client
node_timeline_ui -->|"loads timeline"| node_api_client
node_graph_ui -->|"loads graph"| node_api_client
node_api_client -->|"calls REST"| node_django_api
node_creator -->|"edits canvas"| node_tldraw_client
node_tldraw_client -->|"syncs room"| node_sync_server
node_sync_server -->|"manages rooms"| node_sync_room
node_sync_server -->|"leases rooms"| node_redis_lease
node_sync_server -->|"persists snapshots"| node_django_api
node_django_api -.->|"enforces access"| node_accounts
node_django_api -.->|"serves dialogue"| node_ai_services
node_ai_services -.->|"analyzes context"| node_agent_analysis
node_agent_analysis -->|"reads canon"| node_postgres
node_django_api -.->|"handles review commit"| node_canvas_commit
node_canvas_commit -->|"resolves branch"| node_branching
node_canvas_commit -->|"records content"| node_git_history
node_canvas_commit -->|"writes canon"| node_postgres
node_branching -->|"resolves overlays"| node_postgres
node_django_api -.->|"checks canon"| node_consistency
node_django_api -.->|"serves timeline"| node_timeline_data
node_timeline_ui -.->|"edits time systems"| node_timeline_data
node_postgres -->|"queues jobs"| node_outbox
node_outbox -->|"writes commits"| node_git_history
node_outbox -->|"projects graph"| node_graph_projection
node_postgres -->|"supplies canon"| node_graph_projection

click node_app "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/App.vue"
click node_workbench_store "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/stores/workbench.ts"
click node_api_client "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/services/api.ts"
click node_canvas_ui "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/CanvasSurface.vue"
click node_dialogue_ui "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/DialoguePanel.vue"
click node_proposal_ui "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/ProposalPanel.vue"
click node_graph_ui "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/GraphPanel.vue"
click node_timeline_ui "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/TimelinePanel.vue"
click node_history_ui "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/HistoryPanel.vue"
click node_maintenance_ui "https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/MaintenanceStatusPanel.vue"
click node_django_api "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/views.py"
click node_accounts "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/accounts/views.py"
click node_ai_services "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/ai_agent/services/dialogue.py"
click node_agent_analysis "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/ai_agent/services/analysis.py"
click node_canvas_commit "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/canvas/services/commit.py"
click node_branching "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/services/branching.py"
click node_consistency "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/services/consistency.py"
click node_timeline_data "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/models.py"
click node_git_history "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/version_control/services/git_sync.py"
click node_outbox "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/services/outbox_worker.py"
click node_graph_projection "https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/services/neo4j_projection.py"
click node_sync_server "https://github.com/hedaas-code/projectoc/blob/main/sync-service/src/server.js"
click node_sync_room "https://github.com/hedaas-code/projectoc/blob/main/sync-service/src/tldraw-room.js"
click node_redis_lease "https://github.com/hedaas-code/projectoc/blob/main/sync-service/src/room-lease.js"

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_workbench_store,node_api_client,node_canvas_ui,node_dialogue_ui,node_proposal_ui,node_graph_ui,node_timeline_ui,node_history_ui,node_maintenance_ui,node_tldraw_client toneBlue
class node_django_api,node_accounts,node_ai_services,node_agent_analysis toneAmber
class node_canvas_commit,node_branching,node_consistency,node_timeline_data,node_git_history toneMint
class node_postgres,node_outbox,node_graph_projection,node_sync_server,node_sync_room,node_redis_lease toneRose
class node_creator toneIndigo
```

## Components

### Workbench

- [Vue workbench](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Workspace state](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/stores/workbench.ts): `frontend/src/stores/workbench.ts`
- [REST client](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Inspiration canvas](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/CanvasSurface.vue): `frontend/src/components/CanvasSurface.vue`
- [AI dialogue](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/DialoguePanel.vue): `frontend/src/components/DialoguePanel.vue`
- [Proposal review](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/ProposalPanel.vue): `frontend/src/components/ProposalPanel.vue`
- [Graph workspace](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/GraphPanel.vue): `frontend/src/components/GraphPanel.vue`
- [Timeline workspace](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/TimelinePanel.vue): `frontend/src/components/TimelinePanel.vue`
- [History and merge](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/HistoryPanel.vue): `frontend/src/components/HistoryPanel.vue`
- [Maintenance status](https://github.com/hedaas-code/projectoc/blob/main/frontend/src/components/MaintenanceStatusPanel.vue): `frontend/src/components/MaintenanceStatusPanel.vue`

### Authoring

- [Django REST API](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/views.py): `backend/apps/core/views.py`
- [Accounts and permissions](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/accounts/views.py): `backend/apps/accounts/views.py`
- [AI dialogue and memory](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/ai_agent/services/dialogue.py): `backend/apps/ai_agent/services/dialogue.py`
- [Auditable analysis](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/ai_agent/services/analysis.py): `backend/apps/ai_agent/services/analysis.py`

### Canon and history

- [Reviewed canvas commit](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/canvas/services/commit.py): `backend/apps/canvas/services/commit.py`
- [Branch overlays](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/services/branching.py): `backend/apps/core/services/branching.py`
- [Canon consistency](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/services/consistency.py): `backend/apps/core/services/consistency.py`
- [Timeline and temporal data](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/models.py): `backend/apps/core/models.py`
- [World-content Git history](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/version_control/services/git_sync.py): `backend/apps/version_control/services/git_sync.py`

### Sync and projections

- **PostgreSQL canon store**
- [Durable outbox worker](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/services/outbox_worker.py): `backend/apps/core/services/outbox_worker.py`
- [Neo4j projection](https://github.com/hedaas-code/projectoc/blob/main/backend/apps/core/services/neo4j_projection.py): `backend/apps/core/services/neo4j_projection.py`
- [Canvas sync service](https://github.com/hedaas-code/projectoc/blob/main/sync-service/src/server.js): `sync-service/src/server.js`
- [TLDraw rooms](https://github.com/hedaas-code/projectoc/blob/main/sync-service/src/tldraw-room.js): `sync-service/src/tldraw-room.js`
- [Room leases](https://github.com/hedaas-code/projectoc/blob/main/sync-service/src/room-lease.js): `sync-service/src/room-lease.js`

### Other components

- **Creator**
- **TLDraw client**

## Connections

- Creator → Vue workbench: uses
- Vue workbench → Workspace state: loads state (evidence: `frontend/src/App.vue`)
- Vue workbench → Inspiration canvas: shows canvas (evidence: `frontend/src/App.vue`)
- Vue workbench → AI dialogue: shows dialogue (evidence: `frontend/src/App.vue`)
- Vue workbench → Proposal review: shows proposals (evidence: `frontend/src/App.vue`)
- Vue workbench → Graph workspace: shows graph (evidence: `frontend/src/App.vue`)
- Vue workbench → Timeline workspace: shows timeline (evidence: `frontend/src/App.vue`)
- Vue workbench → History and merge: shows history (evidence: `frontend/src/App.vue`)
- Vue workbench → Maintenance status: shows status
- Workspace state → REST client: requests data (evidence: `frontend/src/stores/workbench.ts`)
- AI dialogue → REST client: streams dialogue (evidence: `frontend/src/components/DialoguePanel.vue`)
- Timeline workspace → REST client: loads timeline (evidence: `frontend/src/components/TimelinePanel.vue`)
- Graph workspace → REST client: loads graph (evidence: `frontend/src/components/GraphPanel.vue`)
- REST client → Django REST API: calls REST
- Creator → TLDraw client: edits canvas
- TLDraw client → Canvas sync service: syncs room
- Canvas sync service → TLDraw rooms: manages rooms (evidence: `sync-service/src/server.js`)
- Canvas sync service → Room leases: leases rooms (evidence: `sync-service/src/server.js`)
- Canvas sync service → Django REST API: persists snapshots (evidence: `sync-service/src/server.js`)
- Django REST API → Accounts and permissions: enforces access
- Django REST API → AI dialogue and memory: serves dialogue
- AI dialogue and memory → Auditable analysis: analyzes context
- Auditable analysis → PostgreSQL canon store: reads canon (evidence: `backend/apps/ai_agent/services/analysis.py`)
- Django REST API → Reviewed canvas commit: handles review commit
- Reviewed canvas commit → Branch overlays: resolves branch (evidence: `backend/apps/canvas/services/commit.py`)
- Reviewed canvas commit → World-content Git history: records content (evidence: `backend/apps/canvas/services/commit.py`)
- Reviewed canvas commit → PostgreSQL canon store: writes canon (evidence: `backend/apps/canvas/services/commit.py`)
- Branch overlays → PostgreSQL canon store: resolves overlays (evidence: `backend/apps/core/services/branching.py`)
- Django REST API → Canon consistency: checks canon
- Django REST API → Timeline and temporal data: serves timeline
- Timeline workspace → Timeline and temporal data: edits time systems
- PostgreSQL canon store → Durable outbox worker: queues jobs (evidence: `backend/apps/core/services/outbox_worker.py`)
- Durable outbox worker → World-content Git history: writes commits (evidence: `backend/apps/core/services/outbox_worker.py`)
- Durable outbox worker → Neo4j projection: projects graph (evidence: `backend/apps/core/services/outbox_worker.py`)
- PostgreSQL canon store → Neo4j projection: supplies canon
