How imrehankhan/undoubt works
UnDoubt is a real-time question-and-doubt platform organized around sign-in, creating or joining a room, and asking or managing questions there. The frontend also exposes home, profile, and access-denied views; backend routes support room, user, and statistics operations. Socket events provide live room updates, while MongoDB models hold room, doubt, user, and statistics data. Several frontend pages and helpers were not sampled, so their links to API and socket behavior are shown as unverified rather than asserted.
Main entry points: App.jsx App routing · routes.js Room and user routes · app.js HTTP and socket server · socketController.js Socket event handler
Components 26
Frontend experience
- App routing
frontend/src/App.jsx - Auth context
frontend/src/contexts/AuthContext.jsx - Firebase auth
frontend/src/config/firebase.js - Sign-in page
frontend/src/pages/LoginPage.jsx - Home page
frontend/src/pages/HomePage.jsx - Create room
frontend/src/pages/CreateRoomPage.jsx - Join room
frontend/src/pages/JoinRoomPage.jsx - User profile
frontend/src/pages/ProfilePage.jsx - Access denied
frontend/src/pages/AccessDeniedPage.jsx - Recent rooms
frontend/src/components/RecentRooms.jsx - User statistics
frontend/src/components/UserStats.jsx
Live room interaction
- Room session
frontend/src/pages/RoomPage.jsx - Room page backup
frontend/src/pages/RoomPage.backup.jsx - Doubt views
frontend/src/components/DoubtContainer.jsx - Virtualized doubts
frontend/src/components/VirtualizedDoubtList.jsx - Socket client
frontend/src/utils/socket.js - Socket event handler
backend/controllers/socketController.js
HTTP API
- API client
frontend/src/utils/api.js - HTTP and socket server
backend/app.js - Room and user routes
backend/routes/routes.js - API specification
backend/swagger.js
MongoDB data
- Room records
backend/models/Room.js - Doubt records
backend/models/Doubt.js - User records
backend/models/User.js - Statistics records
backend/models/Statistics.js
Other components
- Platform user
Connections 27
- Platform user → App routing: uses
frontend/src/App.jsx - App routing → Auth context: provides auth
frontend/src/App.jsx - App routing → Sign-in page: routes
frontend/src/App.jsx - App routing → Home page: routes
frontend/src/App.jsx - App routing → Create room: routes
frontend/src/App.jsx - App routing → Join room: routes
frontend/src/App.jsx - App routing → Room session: routes
frontend/src/App.jsx - App routing → User profile: routes
frontend/src/App.jsx - App routing → Access denied: routes
frontend/src/App.jsx - App routing → Firebase auth: logs out through
frontend/src/App.jsx - Platform user → Create room: requests
- Platform user → Join room: requests
- Platform user → Room session: asks or manages
- Room page backup → API client: calls
frontend/src/pages/RoomPage.backup.jsx - Room page backup → Socket client: uses
frontend/src/pages/RoomPage.backup.jsx - Recent rooms → API client: fetches through
frontend/src/components/RecentRooms.jsx - API client → HTTP and socket server: HTTP requests
- Socket client → HTTP and socket server: socket connection
- HTTP and socket server → Room and user routes: mounts routes
backend/app.js - HTTP and socket server → Socket event handler: dispatches connections
backend/app.js - HTTP and socket server → API specification: serves docs
backend/app.js - Room and user routes → Room records: reads and writes
backend/routes/routes.js - Room and user routes → Doubt records: reads and writes
backend/routes/routes.js - Room and user routes → User records: reads and writes
backend/routes/routes.js - Room and user routes → Statistics records: references
backend/routes/routes.js - Socket event handler → Doubt records: reads and updates
backend/controllers/socketController.js - Socket event handler → Platform user: broadcasts events
backend/controllers/socketController.js