How burakorkmez/mern-chat-app works
Project type and purpose
• This is a full-stack real-time chat application built on the MERN stack (MongoDB, Express, React, Node) with JWT authentication, Socket.io for realtime messaging, TailwindCSS for styling, and Zustand for client state management.
• The README confirms features: user signup/login, protected routes, real-time messaging, online-user status, error handling, and deployment instructions.
File structure
• Top-level “backend” folder follows an MVC pattern:
• controllers/ (auth, user, message)
• models/ (User, Conversation, Message)
• routes/ (auth.routes.js, user.routes.js, message.routes.js)
• middleware (protectRoute for JWT enforcement)
• db/connectToMongoDB (DB connection)
• socket/socket.js (Socket.io setup)
• utils/generateToken.js
• server.js (Express app entrypoint)
• Top-level “frontend” folder is a Vite-powered React SPA:
• public/ & index.html
• src/components (sidebar, messages, skeletons)
• src/pages (Login, SignUp, Home)
• src/context (AuthContext, SocketContext)
• src/hooks (custom hooks for API calls & socket listening)
• src/zustand (global state management)
• config files (ESLint, PostCSS, Tailwind, Vite)
README for additional insights
• Confirms tech stack, JWT, Socket.io, Zustand, Tailwind, DaisyUI.
• Mentions deploying and environment variables (PORT, MONGO_DB_URI, JWT_SECRET, NODE_ENV).