How aashay205/wecode works
WeCode’s main workflow is account access, room creation or joining, collaborative editing and discussion, then host-run code execution with shared output. The graph includes the documented collaboration, room controls, persistence and comment capabilities. Backend socket handling and several page implementations are unsampled, so their connections are limited to relationships documented in the README; source-level call ownership is shown where excerpts establish it.
Main entry points: EditorPage.tsx Room editor · socket.ts Socket client · index.ts Collaboration events · prisma.ts Prisma connection
Components 19
Frontend experience
- App routing
frontend/src/App.tsx - Home and auth
frontend/src/pages/Home.tsx - Room editor
frontend/src/pages/EditorPage.tsx - Room state
frontend/src/hooks/useRoom.ts - Code and language sync
frontend/src/hooks/useEditorSync.ts - Cursor sync
frontend/src/hooks/useCursors.ts - Comment state
frontend/src/hooks/useComments.ts - Comment interface
frontend/src/components/CommentPanel.tsx - Socket client
frontend/src/socket/socket.ts
Backend services
- HTTP application
backend/src/app.ts - Authentication routes
backend/src/routes/auth.ts - Auth and tokens
backend/src/services/auth.ts - Room creation
backend/src/routes/rooms.ts - Collaboration events
backend/src/socket/index.ts - Code execution
backend/src/services/codeExecution.ts - Prisma connection
backend/src/lib/prisma.ts
Persistent state
- PostgreSQL state
backend/prisma/schema.prisma
External services
- JDoodle API
Other components
- Participant
Connections 29
- Participant → App routing: opens app
README.md - App routing → Home and auth: routes to
frontend/src/App.tsx - App routing → Room editor: routes to
frontend/src/App.tsx - Participant → Home and auth: registers or logs in
README.md - Home and auth → HTTP application: authenticates via API
README.md - HTTP application → Authentication routes: mounts
backend/src/app.ts - HTTP application → Room creation: mounts
backend/src/app.ts - Authentication routes → Auth and tokens: calls
backend/src/routes/auth.ts - Auth and tokens → Prisma connection: reads and creates users
backend/src/services/auth.ts - Room creation → Auth and tokens: verifies token
backend/src/routes/rooms.ts - Room creation → Prisma connection: creates room
backend/src/routes/rooms.ts - Participant → Room state: creates or joins room
README.md - Room state → Socket client: joins room
README.md - Room editor → Room state: uses room state
README.md - Room editor → Code and language sync: uses editor sync
README.md - Room editor → Cursor sync: uses cursor sync
README.md - Room editor → Comment state: uses comments
README.md - Comment state → Comment interface: supplies discussions
README.md - Code and language sync → Socket client: emits and receives events
frontend/src/hooks/useEditorSync.ts - Cursor sync → Socket client: emits and receives events
frontend/src/hooks/useCursors.ts - Comment state → Socket client: emits and receives events
frontend/src/hooks/useComments.ts - Socket client → Collaboration events: collaborates over sockets
README.md - Collaboration events → Prisma connection: persists room state and discussions
README.md - Participant → Room editor: edits and discusses
README.md - Participant → Code execution: requests host execution
README.md - Collaboration events → Code execution: dispatches run request
README.md - Code execution → JDoodle API: runs code
README.md - Collaboration events → Socket client: broadcasts results
README.md - Prisma connection → PostgreSQL state: reads and writes
README.md