# atharv-k-979/devmesh architecture

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

- Interactive diagram: https://gitdiagram.com/atharv-k-979/devmesh
- Repository: https://github.com/atharv-k-979/devmesh

## Overview

DevMesh is a realtime collaborative development environment. Users enter through the client, authenticate, and open a room to edit a multi-file workspace; the editor coordinates CRDT synchronization, room events, and feature panels. The API supplies room, media, AI, recording, execution, snippet, and snapshot capabilities, while the collaboration server provides Yjs synchronization. The README documents several integrations beyond the sampled implementation; edges for those use documented relationships, and unsampled wiring is not inferred.

Main entry points: [`apps/client/src/pages/EditorPage.jsx`](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/pages/EditorPage.jsx) (Room editor), [`apps/api/src/app.module.js`](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/app.module.js) (API gateway), [`apps/client/src/App.jsx`](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/App.jsx) (Client routes), [`apps/api/src/livekit.controller.js`](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/livekit.controller.js) (Media tokens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["Client routes<br/>[App.jsx]"]
  node_home["Room entry<br/>[Home.jsx]"]
  node_authstore["Auth state<br/>[authStore.js]"]
  node_editor["Room editor<br/>[EditorPage.jsx]"]
  node_workspace["Workspace state<br/>[workspaceStore.js]"]
  node_codeeditor["Code editor<br/>[Editor.jsx]"]
  node_filepreview["Import preview<br/>[FilePreview.jsx]"]
  node_whiteboardpage["Whiteboard page<br/>[WhiteboardPage.jsx]"]
end

subgraph group_collab["Collaboration runtime"]
  node_collabserver["CRDT sync server<br/>[index.js]"]
end

subgraph group_api["API services"]
  node_apiapp["API gateway<br/>[app.module.js]"]
  node_roomgateway["Room events<br/>[room.gateway.js]"]
  node_authapi["Authentication<br/>[auth.controller.js]"]
  node_media["Media tokens"]
  node_ai["AI assistance<br/>[ai.controller.js]"]
  node_recordings[("Session recordings")]
  node_persistence["Document snapshots"]
  node_runner["Code execution"]
  node_snippets["Code snippets"]
end

subgraph group_features["Room features"]
  node_ui["Room panels"]
end

subgraph group_shared["Shared contracts"]
  node_sharedtypes["Protocol contracts<br/>[index.js]"]
end

node_user(("Developer"))
node_livekit["LiveKit media"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_editor
node_app -->|"routes to"| node_whiteboardpage
node_home -->|"uses auth"| node_authstore
node_authstore -->|"requests login"| node_authapi
node_editor -->|"syncs documents"| node_collabserver
node_editor -->|"exchanges room events"| node_roomgateway
node_editor -->|"uses workspace state"| node_workspace
node_editor -->|"renders editor"| node_codeeditor
node_editor -->|"renders preview"| node_filepreview
node_editor -->|"renders feature panels"| node_ui
node_whiteboardpage -->|"renders whiteboard"| node_ui
node_editor -->|"requests completion"| node_ai
node_editor -->|"records events"| node_recordings
node_editor -->|"requests execution"| node_runner
node_editor -->|"loads snippets"| node_snippets
node_editor -.->|"requests media token"| node_media
node_media -->|"authorizes room access"| node_livekit
node_editor -.->|"stores snapshots"| node_persistence
node_apiapp -->|"registers gateway"| node_roomgateway
node_apiapp -->|"registers controller"| node_authapi
node_apiapp -->|"registers controller"| node_media
node_apiapp -->|"registers controller"| node_recordings
node_apiapp -->|"registers controller"| node_persistence
node_apiapp -->|"registers controller"| node_ai
node_apiapp -->|"registers controller"| node_runner
node_apiapp -->|"registers controller"| node_snippets
node_editor -->|"uses contracts"| node_sharedtypes
node_collabserver -.->|"uses protocol types"| node_sharedtypes

click node_app "https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/App.jsx"
click node_home "https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/pages/Home.jsx"
click node_authstore "https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/store/authStore.js"
click node_editor "https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/pages/EditorPage.jsx"
click node_workspace "https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/store/workspaceStore.js"
click node_codeeditor "https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/components/Editor.jsx"
click node_filepreview "https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/components/FilePreview.jsx"
click node_whiteboardpage "https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/pages/WhiteboardPage.jsx"
click node_collabserver "https://github.com/atharv-k-979/devmesh/blob/main/apps/collab/src/index.js"
click node_apiapp "https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/app.module.js"
click node_roomgateway "https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/room.gateway.js"
click node_authapi "https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/auth.controller.js"
click node_media "https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/livekit.controller.js"
click node_ai "https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/ai.controller.js"
click node_recordings "https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/recordings.controller.js"
click node_persistence "https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/persistence.controller.js"
click node_runner "https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/runner.controller.js"
click node_snippets "https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/snippets.controller.js"
click node_ui "https://github.com/atharv-k-979/devmesh/tree/main/packages/ui/src"
click node_sharedtypes "https://github.com/atharv-k-979/devmesh/blob/main/packages/shared-types/src/index.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_home,node_authstore,node_editor,node_workspace,node_codeeditor,node_filepreview,node_whiteboardpage toneBlue
class node_collabserver toneAmber
class node_apiapp,node_roomgateway,node_authapi,node_media,node_ai,node_recordings,node_persistence,node_runner,node_snippets toneMint
class node_ui toneRose
class node_sharedtypes,node_user,node_livekit toneIndigo
```

## Components

### Client experience

- [Client routes](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/App.jsx): `apps/client/src/App.jsx`
- [Room entry](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/pages/Home.jsx): `apps/client/src/pages/Home.jsx`
- [Auth state](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/store/authStore.js): `apps/client/src/store/authStore.js`
- [Room editor](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/pages/EditorPage.jsx): `apps/client/src/pages/EditorPage.jsx`
- [Workspace state](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/store/workspaceStore.js): `apps/client/src/store/workspaceStore.js`
- [Code editor](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/components/Editor.jsx): `apps/client/src/components/Editor.jsx`
- [Import preview](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/components/FilePreview.jsx): `apps/client/src/components/FilePreview.jsx`
- [Whiteboard page](https://github.com/atharv-k-979/devmesh/blob/main/apps/client/src/pages/WhiteboardPage.jsx): `apps/client/src/pages/WhiteboardPage.jsx`

### Collaboration runtime

- [CRDT sync server](https://github.com/atharv-k-979/devmesh/blob/main/apps/collab/src/index.js): `apps/collab/src/index.js`

### API services

- [API gateway](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/app.module.js): `apps/api/src/app.module.js`
- [Room events](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/room.gateway.js): `apps/api/src/room.gateway.js`
- [Authentication](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/auth.controller.js): `apps/api/src/auth.controller.js`
- [Media tokens](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/livekit.controller.js): `apps/api/src/livekit.controller.js`
- [AI assistance](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/ai.controller.js): `apps/api/src/ai.controller.js`
- [Session recordings](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/recordings.controller.js): `apps/api/src/recordings.controller.js`
- [Document snapshots](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/persistence.controller.js): `apps/api/src/persistence.controller.js`
- [Code execution](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/runner.controller.js): `apps/api/src/runner.controller.js`
- [Code snippets](https://github.com/atharv-k-979/devmesh/blob/main/apps/api/src/snippets.controller.js): `apps/api/src/snippets.controller.js`

### Room features

- [Room panels](https://github.com/atharv-k-979/devmesh/tree/main/packages/ui/src): `packages/ui/src`

### Shared contracts

- [Protocol contracts](https://github.com/atharv-k-979/devmesh/blob/main/packages/shared-types/src/index.js): `packages/shared-types/src/index.js`

### Other components

- **Developer**
- **LiveKit media**

## Connections

- Developer → Client routes: opens (evidence: `apps/client/src/App.jsx`)
- Client routes → Room entry: routes to (evidence: `apps/client/src/App.jsx`)
- Client routes → Room editor: routes to (evidence: `apps/client/src/App.jsx`)
- Client routes → Whiteboard page: routes to (evidence: `apps/client/src/App.jsx`)
- Room entry → Auth state: uses auth (evidence: `apps/client/src/pages/Home.jsx`)
- Auth state → Authentication: requests login (evidence: `apps/client/src/store/authStore.js`)
- Room editor → CRDT sync server: syncs documents (evidence: `apps/client/src/pages/EditorPage.jsx`)
- Room editor → Room events: exchanges room events (evidence: `README.md`)
- Room editor → Workspace state: uses workspace state (evidence: `apps/client/src/pages/EditorPage.jsx`)
- Room editor → Code editor: renders editor (evidence: `apps/client/src/pages/EditorPage.jsx`)
- Room editor → Import preview: renders preview (evidence: `apps/client/src/pages/EditorPage.jsx`)
- Room editor → Room panels: renders feature panels (evidence: `apps/client/src/pages/EditorPage.jsx`)
- Whiteboard page → Room panels: renders whiteboard (evidence: `apps/client/src/pages/WhiteboardPage.jsx`)
- Room editor → AI assistance: requests completion (evidence: `apps/client/src/pages/EditorPage.jsx`)
- Room editor → Session recordings: records events (evidence: `apps/client/src/pages/EditorPage.jsx`)
- Room editor → Code execution: requests execution (evidence: `README.md`)
- Room editor → Code snippets: loads snippets (evidence: `README.md`)
- Room editor → Media tokens: requests media token
- Media tokens → LiveKit media: authorizes room access (evidence: `apps/api/src/livekit.controller.js`)
- Room editor → Document snapshots: stores snapshots
- API gateway → Room events: registers gateway (evidence: `apps/api/src/app.module.js`)
- API gateway → Authentication: registers controller (evidence: `apps/api/src/app.module.js`)
- API gateway → Media tokens: registers controller (evidence: `apps/api/src/app.module.js`)
- API gateway → Session recordings: registers controller (evidence: `apps/api/src/app.module.js`)
- API gateway → Document snapshots: registers controller (evidence: `apps/api/src/app.module.js`)
- API gateway → AI assistance: registers controller (evidence: `apps/api/src/app.module.js`)
- API gateway → Code execution: registers controller (evidence: `apps/api/src/app.module.js`)
- API gateway → Code snippets: registers controller (evidence: `apps/api/src/app.module.js`)
- Room editor → Protocol contracts: uses contracts (evidence: `apps/client/src/pages/EditorPage.jsx`)
- CRDT sync server → Protocol contracts: uses protocol types
