How sornalatha-2002/syntecxhub_chat-application works
ChatSphere is a MERN real-time chat application. Users sign up or log in, enter a protected dashboard, discover or create rooms, then exchange persisted messages and live chat events. The graph separates the React experience, HTTP/API handling, room and message domain logic, and persistence/realtime infrastructure. README documents file uploads, private rooms, typing, presence, and read receipts; sampled code confirms several of these, while unsampled feature internals are represented at their documented subsystem paths. Some links are omitted where sampled evidence does not establish the call.
Main entry points: Dashboard.jsx Chat dashboard · server.js Express server · messageRoutes.js Message routes · socketHandler.js Socket events
Components 28
React client
- App routing
client/src/App.jsx - Login and signup
client/src/pages - Auth state
client/src/context/AuthContext.jsx - Chat dashboard
client/src/pages/Dashboard.jsx - Room sidebar
client/src/components/Sidebar/Sidebar.jsx - Room creation
client/src/components/Room/CreateRoomModal.jsx - Chat interface
client/src/components/Chat - Socket client
client/src/context/SocketContext.jsx - Auth services
client/src/services/authService.js - Room services
client/src/services/roomService.js - Message services
client/src/services/messageService.js - HTTP adapter
client/src/services/api.js
HTTP API
- Express server
server/server.js - Auth routes
server/routes/authRoutes.js - Room routes
server/routes/roomRoutes.js - Message routes
server/routes/messageRoutes.js - JWT protection
server/middleware/authMiddleware.js - File uploads
server/middleware/uploadMiddleware.js
Chat domain
- Authentication
server/controllers/authController.js - Room management
server/controllers/roomController.js - Message handling
server/controllers/messageController.js - User profiles
server/controllers/userController.js
Runtime services
- Socket events
server/socket/socketHandler.js - User records
server/models/User.js - Room records
server/models/Room.js - Message records
server/models/Message.js
Other components
- Chat user
- MongoDB
Connections 38
- Chat user → App routing: opens
README.md - App routing → Login and signup: routes to
client/src/App.jsx - App routing → Chat dashboard: protects route
client/src/App.jsx - Login and signup → Auth state: uses auth
client/src/pages/Login.jsx - Auth state → Auth services: requests auth
client/src/context/AuthContext.jsx - Chat dashboard → Room sidebar: renders
client/src/pages/Dashboard.jsx - Chat dashboard → Chat interface: renders
client/src/pages/Dashboard.jsx - Chat dashboard → Room services: requests rooms
client/src/pages/Dashboard.jsx - Chat dashboard → Message services: requests messages
client/src/pages/Dashboard.jsx - Room sidebar → Room creation: opens
client/src/components/Sidebar/Sidebar.jsx - Room creation → Room services: creates room
client/src/components/Room/CreateRoomModal.jsx - Room creation → Socket client: announces room
client/src/components/Room/CreateRoomModal.jsx - Chat interface → Socket client: uses events
client/src/components/Chat/ChatInput.jsx - Auth services → HTTP adapter: uses HTTP
client/src/services/authService.js - Room services → HTTP adapter: uses HTTP
client/src/services/roomService.js - Message services → HTTP adapter: uses HTTP
client/src/services/messageService.js - HTTP adapter → Express server: calls API
README.md - Socket client → Socket events: exchanges events
README.md - Express server → Auth routes: mounts
server/server.js - Express server → Room routes: mounts
server/server.js - Express server → Message routes: mounts
server/server.js - Auth routes → Authentication: dispatches
server/routes/authRoutes.js - Room routes → Room management: dispatches
server/routes/roomRoutes.js - Message routes → Message handling: dispatches
server/routes/messageRoutes.js - Message routes → JWT protection: protects
server/routes/messageRoutes.js - Message routes → File uploads: uploads through
server/routes/messageRoutes.js - Authentication → User records: reads and writes
server/controllers/authController.js - Room management → Room records: reads and writes
server/controllers/roomController.js - Room management → Message records: deletes room messages
server/controllers/roomController.js - Message handling → Message records: reads and writes
server/controllers/messageController.js - Message handling → Room records: updates room activity
server/controllers/messageController.js - JWT protection → User records: resolves identity
server/middleware/authMiddleware.js - Socket events → User records: updates presence
server/socket/socketHandler.js - Socket events → Room records: joins and updates
server/socket/socketHandler.js - Socket events → Message records: persists chat
server/socket/socketHandler.js - User records → MongoDB: persists
README.md - Room records → MongoDB: persists
README.md - Message records → MongoDB: persists
README.md