How nishit-luhadia30/chat-sphere works
ChatSphere is a browser-based chat product. Users register or log in, find or create private and group chats, then exchange text and uploaded files; the app also documents reactions, editing, deletion, profiles, and notifications. The frontend uses shared chat state and an API client; the Express backend protects routes and persists users, chats, and messages in MongoDB, with Cloudinary file storage and Socket.IO events. Some capabilities are documented but their implementation was not sampled, so those connections are shown only where supported.
Main entry points: server.js HTTP and socket server · fileRoutes.js File upload route · SingleChat.jsx Conversation view · api.js API client
Components 30
Web client
- App routing
client/src/App.jsx - Login and signup
client/src/pages/HomePage.jsx - Auth forms
client/src/components/Auth/Login.jsx - Chat workspace
client/src/pages/ChatPage.jsx - Chat state
client/src/context/ChatContext.jsx - API client
client/src/utils/api.js - Chat list
client/src/components/Chat/MyChats.jsx - Chat management UI
client/src/components/Chat/GroupChatModal.jsx - User search UI
client/src/components/Chat/SideDrawer.jsx
Identity and chats
- User profiles
client/src/components/Chat/UserProfileModal.jsx - User routes
server/routes/userRoutes.js - User accounts
server/controllers/userController.js - User records
server/models/userModel.js - Chat routes
server/routes/chatRoutes.js - Chat operations
server/controllers/chatController.js - Chat records
server/models/chatModel.js
Messaging and files
- Conversation view
client/src/components/Chat/SingleChat.jsx - Message rendering
client/src/components/Chat/ScrollableChat.jsx - Message interactions
client/src/components/Chat/MessageBubble.jsx - File upload UI
client/src/components/Chat/FileUpload.jsx - Message routes
server/routes/messageRoutes.js - Message operations
server/controllers/messageController.js - Message records
server/models/messageModel.js - File upload route
server/routes/fileRoutes.js - Upload middleware
server/middleware/upload.js - Cloudinary storage
server/config/cloudinary.js
Backend platform
- JWT protection
server/middleware/authMiddleware.js - HTTP and socket server
server/server.js - MongoDB connection
server/config/db.js
Other components
- Chat user
Connections 43
- Chat user → App routing: uses
README.md - App routing → Login and signup: routes to
client/src/App.jsx - App routing → Chat workspace: routes to
client/src/App.jsx - Login and signup → Auth forms: renders
client/src/pages/HomePage.jsx - Chat workspace → Chat state: reads state
client/src/pages/ChatPage.jsx - Chat workspace → Chat list: renders
client/src/pages/ChatPage.jsx - Chat workspace → Conversation view: renders
client/src/pages/ChatPage.jsx - Chat list → Chat state: updates state
client/src/components/Chat/MyChats.jsx - Chat list → Chat management UI: opens
client/src/components/Chat/MyChats.jsx - User search UI → Chat state: reads state
client/src/components/Chat/SideDrawer.jsx - Conversation view → Chat state: reads state
client/src/components/Chat/SingleChat.jsx - Conversation view → Message rendering: renders
client/src/components/Chat/SingleChat.jsx - Message rendering → Message interactions: renders
client/src/components/Chat/ScrollableChat.jsx - Message rendering → User profiles: opens
client/src/components/Chat/ScrollableChat.jsx - Conversation view → File upload UI: renders
client/src/components/Chat/SingleChat.jsx - Auth forms → API client: calls
client/src/components/Auth/Login.jsx - Chat list → API client: calls
client/src/components/Chat/MyChats.jsx - Conversation view → API client: calls
client/src/components/Chat/SingleChat.jsx - File upload UI → API client: calls
client/src/components/Chat/FileUpload.jsx - API client → HTTP and socket server: sends API requests
README.md - HTTP and socket server → User routes: mounts
server/server.js - HTTP and socket server → Chat routes: mounts
server/server.js - HTTP and socket server → Message routes: mounts
server/server.js - HTTP and socket server → File upload route: mounts
server/server.js - User routes → JWT protection: protects
server/routes/userRoutes.js - Chat routes → JWT protection: protects
server/routes/chatRoutes.js - Message routes → JWT protection: protects
server/routes/messageRoutes.js - File upload route → JWT protection: protects
server/routes/fileRoutes.js - User routes → User accounts: dispatches
server/routes/userRoutes.js - User accounts → User records: reads and writes
server/controllers/userController.js - Chat routes → Chat operations: dispatches
server/routes/chatRoutes.js - Chat operations → Chat records: reads and writes
server/controllers/chatController.js - Chat operations → User records: populates users
server/controllers/chatController.js - Message routes → Message operations: dispatches
server/routes/messageRoutes.js - Message operations → Message records: reads and writes
server/controllers/messageController.js - Message operations → Chat records: updates latest message
server/controllers/messageController.js - Message operations → User records: populates users
server/controllers/messageController.js - File upload route → Upload middleware: processes upload
server/routes/fileRoutes.js - File upload route → Cloudinary storage: uploads file
server/routes/fileRoutes.js - File upload route → Message records: creates message
server/routes/fileRoutes.js - File upload route → Chat records: updates latest message
server/routes/fileRoutes.js - HTTP and socket server → MongoDB connection: connects
server/server.js - Chat user → HTTP and socket server: exchanges live events
README.md