How mahideveloper1/chat-app works
Project type and purpose
• This is a full-stack real-time chat application.
• Frontend: React.js SPA using Context API for state and Socket.io-client for real-time events.
• Backend: Node.js/Express REST API and Socket.io server, persisting data in MongoDB.
File structure
• Top-level “client” and “server” directories split frontend and backend.
• client/src/components organized by feature (auth, chat, common)—an indication of a component-driven UI.
• client/src/context holds global state providers for authentication and chat sessions.
• server/controllers, server/routes, server/models, server/middleware suggest an MVC-style REST API.
• server/services and server/utils factor out socket-specific logic, caching, JWT and logging services.
• Configuration files: .env in both; Vite config for client builds; Express app entrypoints in server/app.js and server/server.js.
Key insights from README
• Real-time messaging via Socket.io integrated with RESTful endpoints for auth, chat and message persistence.
• Tech stack callouts: React + Tailwind + Socket.io-client; Node/Express + MongoDB/Mongoose + Socket.io.
• Authentication with JWT; typical CRUD API for users, chats, messages.