# shashwattrigunayat/aetherstudio architecture

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

## Overview

AetherCode is a full-stack collaborative IDE. Users authenticate, open a workspace, edit and synchronize files, collaborate in real time, and use terminal, debugging, execution, and AI tools. The graph keeps those distinct product capabilities alongside the account and workspace data layers. The README documents several integrations whose implementation was not sampled; those links are cited to the README, while source-level links rely on excerpts or SOURCE INDEX references.

Main entry points: [`backend/sockets/handlers.js`](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/sockets/handlers.js) (Socket event handlers), [`frontend/src/lib/api.js`](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/lib/api.js) (HTTP API client), [`backend/models/Workspace.js`](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/models/Workspace.js) (Workspace records), [`frontend/src/App.jsx`](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/App.jsx) (Web app routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["IDE experience"]
  node_app["Web app routes<br/>[App.jsx]"]
  node_auth_ui["Account state<br/>[useAuth.js]"]
  node_dashboard["Workspace dashboard<br/>[DashboardPage.jsx]"]
  node_workspace_ui["IDE workspace<br/>[WorkspacePage.jsx]"]
  node_editor["Editor and files<br/>[EditorArea.jsx]"]
  node_terminal_ui["Terminal state<br/>[useTerminal.js]"]
  node_ai_ui["AI assistant<br/>[ChatPanel.jsx]"]
  node_api["HTTP API client<br/>[api.js]"]
  node_workspace_state["Workspace state<br/>[useWorkspace.js]"]
end

subgraph group_backend["Application services"]
  node_auth_routes["Authentication routes<br/>[auth.js]"]
  node_workspace_routes["Workspace routes<br/>[workspace.js]"]
  node_ai_routes["AI routes<br/>[ai.js]"]
  node_execution_routes["Execution routes<br/>[execution.js]"]
  node_terminal_service["PTY terminal service<br/>[terminalService.js]"]
  node_debug_service["Debug service<br/>[debugService.js]"]
  node_execution["Sandboxed execution"]
  node_ai_service["Gemini AI service<br/>[aiService.js]"]
end

subgraph group_realtime["Collaboration runtime"]
  node_socket_handlers["Socket event handlers<br/>[handlers.js]"]
  node_yjs["Yjs synchronization<br/>[yjs-binding.js]"]
  node_webrtc["WebRTC signaling"]
end

subgraph group_data["Persistence and sync"]
  node_workspace_model[("Workspace records<br/>[Workspace.js]")]
  node_workspace_sync["Workspace disk sync"]
  node_file_watcher["Filesystem watcher"]
  node_user_model[("User records<br/>[User.js]")]
end

subgraph group_integrations["External tools"]
  node_database[("MongoDB")]
  node_redis[("Redis")]
  node_docker["Docker sandbox"]
  node_gemini["Google Gemini"]
end

node_user(("Developer"))
node_webrtc_peer(("Peer browser"))

node_user -->|"uses"| node_app
node_app -.->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_workspace_ui
node_auth_ui -->|"calls"| node_api
node_workspace_ui -.->|"uses"| node_workspace_state
node_workspace_state -->|"calls"| node_api
node_workspace_state -->|"coordinates"| node_terminal_ui
node_workspace_ui -.->|"renders"| node_editor
node_api -.->|"requests"| node_auth_routes
node_api -.->|"requests"| node_workspace_routes
node_api -.->|"requests"| node_ai_routes
node_api -.->|"requests"| node_execution_routes
node_auth_routes -->|"queries"| node_user_model
node_auth_routes -.->|"persists users"| node_database
node_workspace_routes -->|"queries"| node_workspace_model
node_workspace_routes -->|"syncs files"| node_workspace_sync
node_workspace_routes -->|"manages watching"| node_file_watcher
node_workspace_model -.->|"stores records"| node_database
node_socket_handlers -->|"loads workspace"| node_workspace_model
node_socket_handlers -->|"syncs to disk"| node_workspace_sync
node_socket_handlers -->|"starts watcher"| node_file_watcher
node_socket_handlers -->|"initializes"| node_yjs
node_socket_handlers -->|"initializes"| node_webrtc
node_socket_handlers -->|"dispatches terminal"| node_terminal_service
node_socket_handlers -->|"dispatches debugging"| node_debug_service
node_editor -.->|"syncs edits"| node_yjs
node_yjs -.->|"stores CRDT state"| node_workspace_model
node_webrtc -.->|"relays signaling"| node_webrtc_peer
node_terminal_ui -.->|"uses PTY"| node_terminal_service
node_execution_routes -->|"runs code"| node_execution
node_execution -.->|"executes sandboxed"| node_docker
node_ai_routes -->|"delegates"| node_ai_service
node_ai_service -.->|"requests assistance"| node_gemini
node_workspace_sync -.->|"supports sync"| node_file_watcher
node_file_watcher -->|"updates from disk"| node_workspace_model
node_workspace_sync -.->|"syncs files"| node_workspace_model
node_socket_handlers -.->|"scales sockets"| node_redis

click node_app "https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/App.jsx"
click node_auth_ui "https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/stores/useAuth.js"
click node_dashboard "https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_workspace_ui "https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/pages/WorkspacePage.jsx"
click node_editor "https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/components/Editor/EditorArea.jsx"
click node_terminal_ui "https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/stores/useTerminal.js"
click node_ai_ui "https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/components/AI/ChatPanel.jsx"
click node_api "https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/lib/api.js"
click node_workspace_state "https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/stores/useWorkspace.js"
click node_auth_routes "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/routes/auth.js"
click node_workspace_routes "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/routes/workspace.js"
click node_ai_routes "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/routes/ai.js"
click node_execution_routes "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/routes/execution.js"
click node_socket_handlers "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/sockets/handlers.js"
click node_yjs "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/sockets/yjs-binding.js"
click node_webrtc "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/sockets/webrtc-signaling.js"
click node_terminal_service "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/terminalService.js"
click node_debug_service "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/debugService.js"
click node_execution "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/executionService.js"
click node_ai_service "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/aiService.js"
click node_workspace_model "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/models/Workspace.js"
click node_workspace_sync "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/workspaceFileSync.js"
click node_file_watcher "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/fileWatcherService.js"
click node_user_model "https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/models/User.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_auth_ui,node_dashboard,node_workspace_ui,node_editor,node_terminal_ui,node_ai_ui,node_api,node_workspace_state,node_webrtc_peer toneBlue
class node_auth_routes,node_workspace_routes,node_ai_routes,node_execution_routes,node_terminal_service,node_debug_service,node_execution,node_ai_service toneAmber
class node_socket_handlers,node_yjs,node_webrtc toneMint
class node_workspace_model,node_workspace_sync,node_file_watcher,node_user_model toneRose
class node_database,node_redis,node_docker,node_gemini,node_user toneIndigo
```

## Components

### IDE experience

- [Web app routes](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Account state](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/stores/useAuth.js): `frontend/src/stores/useAuth.js`
- [Workspace dashboard](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [IDE workspace](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/pages/WorkspacePage.jsx): `frontend/src/pages/WorkspacePage.jsx`
- [Editor and files](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/components/Editor/EditorArea.jsx): `frontend/src/components/Editor/EditorArea.jsx`
- [Terminal state](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/stores/useTerminal.js): `frontend/src/stores/useTerminal.js`
- [AI assistant](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/components/AI/ChatPanel.jsx): `frontend/src/components/AI/ChatPanel.jsx`
- [HTTP API client](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`
- [Workspace state](https://github.com/shashwattrigunayat/aetherstudio/blob/main/frontend/src/stores/useWorkspace.js): `frontend/src/stores/useWorkspace.js`

### Application services

- [Authentication routes](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Workspace routes](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/routes/workspace.js): `backend/routes/workspace.js`
- [AI routes](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/routes/ai.js): `backend/routes/ai.js`
- [Execution routes](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/routes/execution.js): `backend/routes/execution.js`
- [PTY terminal service](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/terminalService.js): `backend/services/terminalService.js`
- [Debug service](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/debugService.js): `backend/services/debugService.js`
- [Sandboxed execution](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/executionService.js): `backend/services/executionService.js`
- [Gemini AI service](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/aiService.js): `backend/services/aiService.js`

### Collaboration runtime

- [Socket event handlers](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/sockets/handlers.js): `backend/sockets/handlers.js`
- [Yjs synchronization](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/sockets/yjs-binding.js): `backend/sockets/yjs-binding.js`
- [WebRTC signaling](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/sockets/webrtc-signaling.js): `backend/sockets/webrtc-signaling.js`

### Persistence and sync

- [Workspace records](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/models/Workspace.js): `backend/models/Workspace.js`
- [Workspace disk sync](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/workspaceFileSync.js): `backend/services/workspaceFileSync.js`
- [Filesystem watcher](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/services/fileWatcherService.js): `backend/services/fileWatcherService.js`
- [User records](https://github.com/shashwattrigunayat/aetherstudio/blob/main/backend/models/User.js): `backend/models/User.js`

### External tools

- **MongoDB**
- **Redis**
- **Docker sandbox**
- **Google Gemini**

### Other components

- **Developer**
- **Peer browser**

## Connections

- Developer → Web app routes: uses (evidence: `frontend/src/App.jsx`)
- Web app routes → Account state: routes to
- Web app routes → Workspace dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → IDE workspace: routes to (evidence: `frontend/src/App.jsx`)
- Account state → HTTP API client: calls (evidence: `frontend/src/stores/useAuth.js`)
- IDE workspace → Workspace state: uses
- Workspace state → HTTP API client: calls (evidence: `frontend/src/stores/useWorkspace.js`)
- Workspace state → Terminal state: coordinates (evidence: `frontend/src/stores/useWorkspace.js`)
- IDE workspace → Editor and files: renders
- HTTP API client → Authentication routes: requests
- HTTP API client → Workspace routes: requests
- HTTP API client → AI routes: requests
- HTTP API client → Execution routes: requests
- Authentication routes → User records: queries (evidence: `backend/routes/auth.js`)
- Authentication routes → MongoDB: persists users
- Workspace routes → Workspace records: queries (evidence: `backend/routes/workspace.js`)
- Workspace routes → Workspace disk sync: syncs files (evidence: `backend/routes/workspace.js`)
- Workspace routes → Filesystem watcher: manages watching (evidence: `backend/routes/workspace.js`)
- Workspace records → MongoDB: stores records
- Socket event handlers → Workspace records: loads workspace (evidence: `backend/sockets/handlers.js`)
- Socket event handlers → Workspace disk sync: syncs to disk (evidence: `backend/sockets/handlers.js`)
- Socket event handlers → Filesystem watcher: starts watcher (evidence: `backend/sockets/handlers.js`)
- Socket event handlers → Yjs synchronization: initializes (evidence: `backend/sockets/handlers.js`)
- Socket event handlers → WebRTC signaling: initializes (evidence: `backend/sockets/handlers.js`)
- Socket event handlers → PTY terminal service: dispatches terminal (evidence: `backend/sockets/handlers.js`)
- Socket event handlers → Debug service: dispatches debugging (evidence: `backend/sockets/handlers.js`)
- Editor and files → Yjs synchronization: syncs edits
- Yjs synchronization → Workspace records: stores CRDT state
- WebRTC signaling → Peer browser: relays signaling
- Terminal state → PTY terminal service: uses PTY
- Execution routes → Sandboxed execution: runs code (evidence: `backend/routes/execution.js`)
- Sandboxed execution → Docker sandbox: executes sandboxed
- AI routes → Gemini AI service: delegates (evidence: `backend/routes/ai.js`)
- Gemini AI service → Google Gemini: requests assistance
- Workspace disk sync → Filesystem watcher: supports sync (evidence: `backend/services/fileWatcherService.js`)
- Filesystem watcher → Workspace records: updates from disk (evidence: `backend/services/fileWatcherService.js`)
- Workspace disk sync → Workspace records: syncs files
- Socket event handlers → Redis: scales sockets
