How itsgbishal/real-time-chat-application works
Chatify is a web chat application with account access, one-to-one messaging, group chats, profile and group images, and live presence/message updates. The user workflow is to sign in, select a contact or group, then exchange text or images; backend controllers persist and retrieve chat data and use sockets for live delivery. The README documents running separate frontend and backend processes but gives no further feature architecture. Some UI and route implementations were not excerpted, so uncertain HTTP links are shown as unverified.
Main entry points: message.controller.js Message operations · group.controller.js Group operations · App.jsx App routing · useChatStore.js Chat state and actions
Components 26
Web client
- App routing
frontend/src/App.jsx - Login and signup
frontend/src/pages/LoginPage.jsx - Chat workspace
frontend/src/pages/ChatPage.jsx - Chat views and input
frontend/src/components - Group views and modal
frontend/src/components
Accounts
- Auth state
frontend/src/store/useAuthStore.js - Auth routes
backend/src/routes/auth.route.js - Auth operations
backend/src/controllers/auth.controller.js - User records
backend/src/models/User.js - Welcome email
backend/src/emails/emailHandlers.js
Messaging
- Chat state and actions
frontend/src/store/useChatStore.js - Message views and input
frontend/src/components/MessageInput.jsx - Message routes
backend/src/routes/message.route.js - Message operations
backend/src/controllers/message.controller.js - Message records
backend/src/models/Message.js - Message encryption
backend/src/lib/encryption.js
Group chats
- Group routes
backend/src/routes/group.route.js - Group operations
backend/src/controllers/group.controller.js - Group records
backend/src/models/Group.js
Runtime services
- Socket runtime
backend/src/lib/socket.js - Socket authentication
backend/src/middleware/socket.auth.middleware.js - Image hosting
backend/src/lib/cloudinary.js - Email provider
backend/src/lib/resend.js - HTTP server
backend/src/server.js
Other components
- Chat user
- MongoDB
Connections 34
- Chat user → App routing: uses
frontend/src/App.jsx - App routing → Auth state: checks session
frontend/src/App.jsx - App routing → Login and signup: routes to
frontend/src/App.jsx - App routing → Chat workspace: routes to
frontend/src/App.jsx - Login and signup → Auth state: calls auth actions
frontend/src/pages/LoginPage.jsx - Chat workspace → Chat views and input: renders
frontend/src/pages/ChatPage.jsx - Chat workspace → Group views and modal: renders
frontend/src/pages/ChatPage.jsx - Chat views and input → Chat state and actions: uses actions
frontend/src/components/CreateGroupModal.jsx - Group views and modal → Chat state and actions: uses actions
frontend/src/components/GroupChatContainer.jsx - Auth state → Auth routes: HTTP requests
- Chat state and actions → Message routes: HTTP requests
- Chat state and actions → Group routes: HTTP requests
- Auth routes → Auth operations: routes to
backend/src/routes/auth.route.js - Auth operations → User records: reads and writes
backend/src/controllers/auth.controller.js - Auth operations → Welcome email: sends welcome
backend/src/controllers/auth.controller.js - Welcome email → Email provider: sends through
backend/src/emails/emailHandlers.js - Message routes → Message operations: routes to
backend/src/routes/message.route.js - Message operations → Message records: reads and writes
backend/src/controllers/message.controller.js - Message operations → User records: looks up users
backend/src/controllers/message.controller.js - Message operations → Message encryption: encrypts and decrypts
backend/src/controllers/message.controller.js - Message operations → Image hosting: uploads images
backend/src/controllers/message.controller.js - Message operations → Socket runtime: dispatches events
backend/src/controllers/message.controller.js - Group routes → Group operations: routes to
backend/src/routes/group.route.js - Group operations → Group records: reads and writes
backend/src/controllers/group.controller.js - Group operations → User records: looks up members
backend/src/controllers/group.controller.js - Group operations → Image hosting: uploads images
backend/src/controllers/group.controller.js - Group operations → Socket runtime: dispatches events
backend/src/controllers/group.controller.js - Socket runtime → Socket authentication: authenticates connections
backend/src/lib/socket.js - HTTP server → Auth routes: mounts routes
backend/src/server.js - HTTP server → Message routes: mounts routes
backend/src/server.js - HTTP server → Group routes: mounts routes
backend/src/server.js - User records → MongoDB: persists records
- Message records → MongoDB: persists records
- Group records → MongoDB: persists records