A full-stack real-time messaging application built with the MERN stack (MongoDB, Express, React, Node.js), Socket.io for real-time communication, and JWT for secure authentication. The app also uses TailwindCSS for styling and Daisy UI for UI components. It includes global state management using Zustand and robust error handling on both the client and server.
- Authentication & Authorization with JWT (JSON Web Tokens)
- Real-time messaging using Socket.io
- Online user status (tracks users who are online)
- Global state management with Zustand
- Responsive UI styled with TailwindCSS and Daisy UI
- Error handling on both server and client
- Deployment instructions to deploy like a pro for free
- Frontend:
- React
- TailwindCSS
- Daisy UI
- Zustand (for global state management)
- Backend:
- Node.js
- Express.js
- MongoDB
- Socket.io
- Authentication:
- JWT (JSON Web Tokens)
- Real-time Features:
- Socket.io
- Error Handling:
- Custom error handling (both server and client)
git clone https://github.com/arc-ch/chat-app.git
cd chat-appcd backend
npm installcd frontend
npm install- Create
.envfiles in both thefrontendandbackenddirectories. - Add necessary variables like:
- MongoDB URI (
MONGO_URI) - JWT secret key (
JWT_SECRET) - Socket.io server URL (
SOCKET_SERVER_URL)
- MongoDB URI (
-
Start the Backend (Server):
cd backend npm start -
Start the Frontend (Client):
cd frontend npm start
Open your browser and go to http://localhost:3000 to see the app in action.
- POST /auth/signup: Register a new user
- POST /auth/login: Login and receive a JWT token
- GET /users/me: Get the logged-in user's data
- GET /users/online: Get the list of online users
- GET /messages: Get all messages in the active chat room
- POST /messages: Send a new message to the active chat room
- Push your code to a GitHub repository.
- Deploy the frontend using Vercel by importing your GitHub project.
- Push your server code to GitHub.
- Deploy the backend using Heroku:
- Link your GitHub repository.
- Set up environment variables like
MONGO_URI,JWT_SECRET, etc. - Deploy and access the app!
Feel free to fork the repository, make improvements, and open pull requests. If you have any ideas, issues, or suggestions, please open an issue, and I'll get back to you as soon as possible.
This project is licensed under the MIT License.

