How tranminhhieu20/chatify works
Chatify is a web chat application with account/profile management and one-to-one messaging. Users sign up or log in, then browse contacts or existing conversations, load message history, and send text or images; the client encrypts message text and decrypts received messages, while the backend persists messages and can dispatch them over Socket.IO. The tree and sampled source support the principal API and state-store links; message-route wiring and most page/component interactions are not sampled, so those connections are omitted.
Main entry points: message.controller.js Message handlers · server.js HTTP server · App.jsx App routing · auth.controller.js Auth handlers
Components 21
Client app
- App routing
frontend/src/App.jsx - Login and signup
frontend/src/pages - Chat screen
frontend/src/pages/ChatPage.jsx - HTTP client
frontend/src/lib/axios.js
Identity and profile
- Auth state
frontend/src/store/useAuthStore.js - Auth routes
backend/src/routes/auth.route.js - Auth handlers
backend/src/controllers/auth.controller.js - JWT protection
backend/src/middleware/auth.middleware.js - User records
backend/src/models/User.js
Chat messaging
- Chat state
frontend/src/store/useChatStore.js - Message crypto
frontend/src/lib/crypto.js - Message routes
backend/src/routes/message.route.js - Message handlers
backend/src/controllers/message.controller.js - Message records
backend/src/models/Message.js
Backend platform
- HTTP server
backend/src/server.js - Socket service
backend/src/lib/socket.js - Cloudinary media
- MongoDB
- Resend email
- Welcome email
backend/src/emails/emailHandlers.js
Other components
- Chat user
Connections 26
- Chat user → App routing: uses
- App routing → Auth state: checks session
- App routing → Login and signup: routes to
- App routing → Chat screen: routes to
- Login and signup → Auth state: submits credentials
- Chat screen → Chat state: uses chat state
- Auth state → HTTP client: calls API
- Chat state → HTTP client: calls API
- Chat state → Message crypto: encrypts and decrypts
- Auth state → Socket service: connects client
- HTTP server → Auth routes: mounts routes
- HTTP server → Message routes: mounts routes
- HTTP server → Socket service: listens on
- HTTP server → MongoDB: connects
- Auth routes → Auth handlers: dispatches
- Auth routes → JWT protection: protects routes
- JWT protection → User records: loads user
- Auth handlers → User records: reads and writes
- Auth handlers → Cloudinary media: uploads profile
- Auth handlers → Welcome email: sends welcome
- Welcome email → Resend email: sends email
- Message routes → Message handlers: dispatches
- Message handlers → Message records: reads and writes
- Message handlers → User records: reads users
- Message handlers → Cloudinary media: uploads images
- Message handlers → Socket service: emits messages