How pratham2137/encryptchatapp works
Project type and purpose
• EncryptChatApp is a full-stack real-time chat application built on the MERN stack (MongoDB, Express, React, Node).
• It provides end-to-end encryption (ECDH for key exchange, AES-GCM for message encryption), user authentication (JWT), and real-time messaging via WebSockets.
File structure
Top Level
• client/ – React+TypeScript+Vite frontend
• server/ – Node.js+Express backend with MVC pattern
• docs/ – system-design documentation
client/
• src/components – UI split into Auth, Chats, Contacts, Groups, Settings, Navigation, Home, NotFound
• src/utils – AuthContext, ProtectedRoute, socket wrapper, loading overlay
• Tailwind CSS config, Vite config, TS configs
server/
• controllers/ – authenticationController, messageController, userController
• routes/ – authenticationRoutes, messageRoutes, userRoutes
• models/ – userModel, messageModel (Mongoose schemas)
• services/ – socket.js (WebSocket event handling)
• utils/ – generateTokens (JWT), other helpers
• middlewares/ – authTokenMiddleware (JWT verification)
• config/ – db.js (MongoDB connection)
• server.js – Express app initialization, WebSocket integration
README for additional insights
• Emphasizes modular, scalable architecture.
• Lists core features: E2E encryption, secure key exchange, real-time via WebSockets, self-destructing messages, typing indicators, message delivery status.
• Tech stack highlights Web Crypto API on client, Express & MongoDB on server, and WebSockets for real-time channels.