How ashutoshpaliwal26/virtual-office works
This is a browser-based virtual coworking platform: users authenticate, find or enter a workspace, then collaborate in an interactive 2D room with real-time presence and communication. The graph also preserves the documented messaging, video, and task-management capabilities. Source excerpts and the index establish the main route, API, database, and socket wiring; some workspace and frontend subsystems are represented by their exact directories because their implementation was not sampled.
Main entry points: Room.tsx Virtual room · index.ts Express and socket server · App.tsx App routes · SocketContext.tsx Socket provider
Components 27
Web application
- App routes
frontend/src/App.tsx - Login and signup
frontend/src/Pages/Auth - Workspace dashboard
frontend/src/Pages/Dashboard/Dashboard.tsx - HTTP API client
frontend/src/service/APIService.ts/APIService.ts
Workspace collaboration
- Space entry and setup
frontend/src/Pages/VirtualSpace - Virtual room
frontend/src/Pages/VirtualSpace/Room.tsx - 2D avatar world
frontend/src/components/Game/Game.tsx - Task manager
frontend/src/components/TaskManager/TaskManager.tsx - Chat interface
frontend/src/components/Chat/Chat.tsx
Backend services
- Express and socket server
backend/src/index.ts - Authentication routes
backend/src/routes/Auth.ts - Login and signup
backend/src/controller/Auth - JWT protection
backend/src/middleware/Protect.ts - User records
backend/src/model/User.ts - Workspace routes
backend/src/routes/WorkSpace.ts - Workspace operations
backend/src/controller/Space - Workspace records
backend/src/model/WorkingSpace.ts - Chat routes
backend/src/routes/Chat.ts - Chat creation
backend/src/controller/Chat/ChatController.ts - Chat records
backend/src/model/Chat.ts
Real-time communication
- Socket provider
frontend/src/context/SocketContext/SocketContext.tsx - WebRTC peer
frontend/src/service/Peer.ts - Presence and messaging sockets
backend/src/sockets - Video call signaling
backend/src/sockets/VideoCall.ts - Video participants
frontend/src/components/VideoComponents/VideoStrip.tsx
Other components
- Coworking user
- MongoDB
Connections 39
- Coworking user → App routes: uses
README.md - App routes → Login and signup: routes to
frontend/src/App.tsx - App routes → Workspace dashboard: routes to
frontend/src/App.tsx - App routes → Space entry and setup: routes to
frontend/src/App.tsx - App routes → Virtual room: routes to
frontend/src/App.tsx - App routes → Task manager: routes to
frontend/src/App.tsx - App routes → Socket provider: provides
frontend/src/App.tsx - Login and signup → HTTP API client: requests
frontend/src/Pages/Auth/Login.tsx - Workspace dashboard → HTTP API client: requests
frontend/src/Pages/Dashboard/Dashboard.tsx - Space entry and setup → HTTP API client: requests
frontend/src/Pages/VirtualSpace/Room.tsx - Virtual room → HTTP API client: checks access
frontend/src/Pages/VirtualSpace/Room.tsx - Virtual room → 2D avatar world: renders
frontend/src/Pages/VirtualSpace/Room.tsx - Virtual room → Socket provider: handles events
frontend/src/Pages/VirtualSpace/Room.tsx - Virtual room → WebRTC peer: negotiates media
frontend/src/Pages/VirtualSpace/Room.tsx - Virtual room → Video participants: shows participants
frontend/src/Pages/VirtualSpace/Room.tsx - Virtual room → Chat interface: renders
frontend/src/Pages/VirtualSpace/Room.tsx - HTTP API client → Express and socket server: HTTP requests
README.md - Socket provider → Express and socket server: connects
frontend/src/context/SocketContext/SocketContext.tsx - Express and socket server → Authentication routes: mounts
backend/src/index.ts - Express and socket server → Workspace routes: mounts
backend/src/index.ts - Express and socket server → Chat routes: mounts
backend/src/index.ts - Express and socket server → Presence and messaging sockets: registers
backend/src/index.ts - Express and socket server → Video call signaling: registers
backend/src/index.ts - Authentication routes → Login and signup: dispatches
backend/src/routes/Auth.ts - Authentication routes → JWT protection: guards
backend/src/routes/Auth.ts - Login and signup → User records: reads and writes
backend/src/controller/Auth/loginUser.ts - JWT protection → User records: checks identity
backend/src/middleware/Protect.ts - Workspace routes → Workspace operations: dispatches
backend/src/routes/WorkSpace.ts - Workspace operations → Workspace records: reads and writes
backend/src/controller/Space/enterToSpace.ts - Chat routes → Chat creation: dispatches
backend/src/routes/Chat.ts - Chat creation → Chat records: creates and queries
backend/src/controller/Chat/ChatController.ts - Express and socket server → MongoDB: connects
backend/src/index.ts - Login and signup → MongoDB: persists users
- Workspace operations → MongoDB: persists spaces
- Chat interface → Socket provider: real-time messaging
frontend/src/components/Chat/Chat.tsx - 2D avatar world → Socket provider: shares movement
frontend/src/components/Game/Game.tsx - Socket provider → Presence and messaging sockets: exchanges events
- Virtual room → Video call signaling: signals calls
frontend/src/Pages/VirtualSpace/Room.tsx - Task manager → Coworking user: supports collaboration