# mediboyinavamsimohanareddy/p2p-crdt-ide architecture

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

- Interactive diagram: https://gitdiagram.com/mediboyinavamsimohanareddy/p2p-crdt-ide
- Repository: https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide

## Overview

DecentraIDE is an offline-first desktop IDE for peer-to-peer collaborative coding. Developers edit locally; collaboration coordinates Yjs document updates, secures peer frames, and dispatches them over available transports, while local operation logging supports offline work. The product also includes semantic conflict resolution, an AI copilot, and a minimal Spring signaling service for peer discovery and WebRTC setup. The graph combines documented capabilities with sampled source references; several UI, merge, AI, and backend relationships are documented or implied but their implementations were not sampled.

Main entry points: [`frontend/src/core/sync/CollaborationManager.ts`](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/sync/CollaborationManager.ts) (Collaboration Manager), [`frontend/src/core/transport/TransportManager.ts`](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/transport/TransportManager.ts) (Transport Manager), [`frontend/src/core/merge/SemanticConflictResolver.ts`](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/merge/SemanticConflictResolver.ts) (Semantic Resolver), [`frontend/src/AppShell.tsx`](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/AppShell.tsx) (IDE Interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editing["IDE and Editing"]
  node_ide_ui["IDE Interface<br/>[AppShell.tsx]"]
  node_editor["Editor and File Hooks<br/>[useEditorTabs.ts]"]
end

subgraph group_collaboration["Collaboration Core"]
  node_crdt["Yjs CRDT<br/>[CrdtEngine.ts]"]
  node_crdt_bindings["Editor Bindings"]
  node_collaboration_manager["Collaboration Manager"]
  node_oplog["Offline Operation Log<br/>[OpLogManager.ts]"]
  node_persistence[("Local Persistence")]
  node_transport_manager["Transport Manager"]
  node_webrtc["WebRTC Transport<br/>[WebRtcTransport.ts]"]
  node_lan_transport["LAN Transport<br/>[LanTransport.ts]"]
  node_bluetooth["Bluetooth Transport"]
  node_peer_store[("Room Peer Store<br/>[RoomPeerStore.ts]")]
  node_session_status[("Session Status")]
end

subgraph group_security["Security"]
  node_security_manager["Identity and Crypto<br/>[SecurityManager.ts]"]
  node_security_pipeline["Frame Verification"]
  node_security_monitor["Security Monitor"]
end

subgraph group_merge_ai["Merge and AI"]
  node_conflict_detector["Overlap Detection"]
  node_semantic_resolver["Semantic Resolver"]
  node_java_parser["Java AST Parser<br/>[JavaAstParser.ts]"]
  node_verification["Merge Verification"]
  node_ai_copilot["AI Copilot<br/>[AIProvider.ts]"]
end

subgraph group_server["Signaling Server"]
  node_signaling["WebRTC Signaling"]
  node_room_api["Room API"]
  node_identity_api["Identity API"]
  node_project_api["Project API"]
  node_lan_resolver["LAN Address Resolver"]
end

node_developer(("Developer"))
node_peer(("Remote Peer"))

node_developer -->|"edits in"| node_ide_ui
node_ide_ui -.->|"opens files"| node_editor
node_editor -.->|"binds edits"| node_crdt_bindings
node_crdt_bindings -.->|"synchronizes text"| node_crdt
node_collaboration_manager -->|"manages document"| node_crdt
node_collaboration_manager -->|"registers transports"| node_transport_manager
node_collaboration_manager -->|"verifies frames"| node_security_pipeline
node_collaboration_manager -->|"creates identity and keys"| node_security_manager
node_collaboration_manager -->|"queues offline updates"| node_oplog
node_oplog -->|"appends operations"| node_persistence
node_transport_manager -->|"tracks connected peers"| node_peer_store
node_collaboration_manager -->|"updates session state"| node_session_status
node_transport_manager -->|"selects transport"| node_webrtc
node_transport_manager -->|"selects transport"| node_lan_transport
node_transport_manager -->|"selects transport"| node_bluetooth
node_peer -.->|"exchanges updates"| node_webrtc
node_security_pipeline -->|"checks signatures and decrypts"| node_security_manager
node_security_monitor -.->|"shows security events"| node_collaboration_manager
node_collaboration_manager -->|"detects overlapping changes"| node_conflict_detector
node_conflict_detector -.->|"resolves conflicts"| node_semantic_resolver
node_semantic_resolver -.->|"analyzes syntax"| node_java_parser
node_semantic_resolver -.->|"verifies merge"| node_verification
node_semantic_resolver -.->|"requests assistance"| node_ai_copilot
node_peer -->|"exchanges signaling"| node_signaling
node_peer -->|"creates or joins room"| node_room_api
node_peer -->|"requests identity"| node_identity_api
node_peer -->|"requests project"| node_project_api
node_room_api -->|"resolves LAN addresses"| node_lan_resolver

click node_ide_ui "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/AppShell.tsx"
click node_editor "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/hooks/useEditorTabs.ts"
click node_crdt "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/crdt/CrdtEngine.ts"
click node_crdt_bindings "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/crdt/CrdtMonacoBinding.ts"
click node_collaboration_manager "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/sync/CollaborationManager.ts"
click node_oplog "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/crdt/OpLogManager.ts"
click node_persistence "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/services/LocalPersistenceManager.ts"
click node_transport_manager "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/transport/TransportManager.ts"
click node_webrtc "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/transport/WebRtcTransport.ts"
click node_lan_transport "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/transport/LanTransport.ts"
click node_bluetooth "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/transport/WebBluetoothTransport.ts"
click node_peer_store "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/sync/RoomPeerStore.ts"
click node_session_status "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/sync/SessionStatusStore.ts"
click node_security_manager "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/security/SecurityManager.ts"
click node_security_pipeline "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/security/SecurityPipeline.ts"
click node_security_monitor "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/components/SecurityMonitorView.tsx"
click node_conflict_detector "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/merge/OverlapConflictDetector.ts"
click node_semantic_resolver "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/merge/SemanticConflictResolver.ts"
click node_java_parser "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/ast/JavaAstParser.ts"
click node_verification "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/merge/VerificationRunner.ts"
click node_ai_copilot "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/ai/AIProvider.ts"
click node_signaling "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/signaling/SignalingHandler.java"
click node_room_api "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/room/RoomController.java"
click node_identity_api "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/identity/IdentityController.java"
click node_project_api "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/project/ProjectController.java"
click node_lan_resolver "https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/runtime/LanAddressResolver.java"

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_ide_ui,node_editor toneBlue
class node_crdt,node_crdt_bindings,node_collaboration_manager,node_oplog,node_persistence,node_transport_manager,node_webrtc,node_lan_transport,node_bluetooth,node_peer_store,node_session_status toneAmber
class node_security_manager,node_security_pipeline,node_security_monitor toneMint
class node_conflict_detector,node_semantic_resolver,node_java_parser,node_verification,node_ai_copilot toneRose
class node_signaling,node_room_api,node_identity_api,node_project_api,node_lan_resolver,node_developer,node_peer toneIndigo
```

## Components

### IDE and Editing

- [IDE Interface](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/AppShell.tsx): `frontend/src/AppShell.tsx`
- [Editor and File Hooks](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/hooks/useEditorTabs.ts): `frontend/src/hooks/useEditorTabs.ts`

### Collaboration Core

- [Yjs CRDT](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/crdt/CrdtEngine.ts): `frontend/src/core/crdt/CrdtEngine.ts`
- [Editor Bindings](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/crdt/CrdtMonacoBinding.ts): `frontend/src/core/crdt/CrdtMonacoBinding.ts`
- [Collaboration Manager](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/sync/CollaborationManager.ts): `frontend/src/core/sync/CollaborationManager.ts`
- [Offline Operation Log](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/crdt/OpLogManager.ts): `frontend/src/core/crdt/OpLogManager.ts`
- [Local Persistence](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/services/LocalPersistenceManager.ts): `frontend/src/services/LocalPersistenceManager.ts`
- [Transport Manager](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/transport/TransportManager.ts): `frontend/src/core/transport/TransportManager.ts`
- [WebRTC Transport](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/transport/WebRtcTransport.ts): `frontend/src/core/transport/WebRtcTransport.ts`
- [LAN Transport](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/transport/LanTransport.ts): `frontend/src/core/transport/LanTransport.ts`
- [Bluetooth Transport](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/transport/WebBluetoothTransport.ts): `frontend/src/core/transport/WebBluetoothTransport.ts`
- [Room Peer Store](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/sync/RoomPeerStore.ts): `frontend/src/core/sync/RoomPeerStore.ts`
- [Session Status](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/sync/SessionStatusStore.ts): `frontend/src/core/sync/SessionStatusStore.ts`

### Security

- [Identity and Crypto](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/security/SecurityManager.ts): `frontend/src/core/security/SecurityManager.ts`
- [Frame Verification](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/security/SecurityPipeline.ts): `frontend/src/core/security/SecurityPipeline.ts`
- [Security Monitor](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/components/SecurityMonitorView.tsx): `frontend/src/components/SecurityMonitorView.tsx`

### Merge and AI

- [Overlap Detection](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/merge/OverlapConflictDetector.ts): `frontend/src/core/merge/OverlapConflictDetector.ts`
- [Semantic Resolver](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/merge/SemanticConflictResolver.ts): `frontend/src/core/merge/SemanticConflictResolver.ts`
- [Java AST Parser](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/ast/JavaAstParser.ts): `frontend/src/core/ast/JavaAstParser.ts`
- [Merge Verification](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/merge/VerificationRunner.ts): `frontend/src/core/merge/VerificationRunner.ts`
- [AI Copilot](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/frontend/src/core/ai/AIProvider.ts): `frontend/src/core/ai/AIProvider.ts`

### Signaling Server

- [WebRTC Signaling](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/signaling/SignalingHandler.java): `backend/src/main/java/org/decentraide/server/signaling/SignalingHandler.java`
- [Room API](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/room/RoomController.java): `backend/src/main/java/org/decentraide/server/room/RoomController.java`
- [Identity API](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/identity/IdentityController.java): `backend/src/main/java/org/decentraide/server/identity/IdentityController.java`
- [Project API](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/project/ProjectController.java): `backend/src/main/java/org/decentraide/server/project/ProjectController.java`
- [LAN Address Resolver](https://github.com/mediboyinavamsimohanareddy/p2p-crdt-ide/blob/main/backend/src/main/java/org/decentraide/server/runtime/LanAddressResolver.java): `backend/src/main/java/org/decentraide/server/runtime/LanAddressResolver.java`

### Other components

- **Developer**
- **Remote Peer**

## Connections

- Developer → IDE Interface: edits in (evidence: `README.md`)
- IDE Interface → Editor and File Hooks: opens files
- Editor and File Hooks → Editor Bindings: binds edits
- Editor Bindings → Yjs CRDT: synchronizes text (evidence: `README.md`)
- Collaboration Manager → Yjs CRDT: manages document (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Collaboration Manager → Transport Manager: registers transports (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Collaboration Manager → Frame Verification: verifies frames (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Collaboration Manager → Identity and Crypto: creates identity and keys (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Collaboration Manager → Offline Operation Log: queues offline updates (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Offline Operation Log → Local Persistence: appends operations (evidence: `frontend/src/core/crdt/OpLogManager.ts`)
- Transport Manager → Room Peer Store: tracks connected peers (evidence: `frontend/src/core/transport/TransportManager.ts`)
- Collaboration Manager → Session Status: updates session state (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Transport Manager → WebRTC Transport: selects transport (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Transport Manager → LAN Transport: selects transport (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Transport Manager → Bluetooth Transport: selects transport (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Remote Peer → WebRTC Transport: exchanges updates (evidence: `README.md`)
- Frame Verification → Identity and Crypto: checks signatures and decrypts (evidence: `frontend/src/core/security/SecurityPipeline.ts`)
- Security Monitor → Collaboration Manager: shows security events
- Collaboration Manager → Overlap Detection: detects overlapping changes (evidence: `frontend/src/core/sync/CollaborationManager.ts`)
- Overlap Detection → Semantic Resolver: resolves conflicts (evidence: `README.md`)
- Semantic Resolver → Java AST Parser: analyzes syntax (evidence: `README.md`)
- Semantic Resolver → Merge Verification: verifies merge (evidence: `README.md`)
- Semantic Resolver → AI Copilot: requests assistance (evidence: `README.md`)
- Remote Peer → WebRTC Signaling: exchanges signaling (evidence: `README.md`)
- Remote Peer → Room API: creates or joins room (evidence: `README.md`)
- Remote Peer → Identity API: requests identity (evidence: `README.md`)
- Remote Peer → Project API: requests project (evidence: `README.md`)
- Room API → LAN Address Resolver: resolves LAN addresses (evidence: `backend/src/main/java/org/decentraide/server/room/RoomController.java`)
