ChitChat is a production-ready, full-stack real-time chat application built with the MERN stack, Socket.io for live messaging, Zustand for lightweight state management, and Tailwind CSS for UI. It provides authenticated real-time messaging, user profiles, and a modern developer experience. π¬
chitchat2.mp4
- Real-time messaging with Socket.io
- User authentication (signup / login)
- Persistent chat history (MongoDB)
- User profiles with avatar support
- Responsive UI built with Tailwind CSS
- Client state managed with Zustand
- Optimized for development and production builds
| Layer | Technology |
|---|---|
| Frontend | React, Vite, Tailwind CSS, Zustand |
| Backend | Node.js, Express, Socket.io |
| Database | MongoDB (Mongoose) |
| Storage | Cloudinary (optional for avatars) |
| Auth | JWT (JSON Web Tokens) |
ChitChat follows a typical MERN architecture with a Socket.io layer for real-time events:
- Client (React + Zustand) connects to the server via HTTP for REST endpoints and a WebSocket connection (Socket.io) for live messaging.
- Server (Express) handles authentication, REST APIs for messages/users, and upgrades sockets for realtime events.
- MongoDB stores users and messages; optional Cloudinary stores user avatars.
Clone the repo and install dependencies for both server and client.
# Clone
git clone https://github.com/<your-username>/ChitChat.git
cd ChitChat
# Server
cd server
npm install
# Client
cd ../client
npm installRun in development (two terminals):
# Terminal 1 -> server
cd server
npm run dev
# Terminal 2 -> client
cd client
npm run devBuild for production:
# Server (example)
cd server
npm run build
# Client
cd client
npm run buildCreate .env files for server and client as described below.
| Variable | Description | Example |
|---|---|---|
PORT |
Server port | 5000 |
MONGO_URI |
MongoDB connection string | mongodb+srv://... |
JWT_SECRET |
Secret for signing JWTs | your_jwt_secret |
CLOUDINARY_URL |
Cloudinary config (optional) | cloudinary://... |
| Variable | Description | Example |
|---|---|---|
VITE_API_BASE |
API base URL | http://localhost:5000/api |
VITE_SOCKET_URL |
Socket server URL | http://localhost:5000 |
Keep secrets out of version control and use environment-specific configurations for production.
- Start the server and client as shown in Installation Guide.
- Open the client app in your browser (Vite will show URL, typically
http://localhost:5173). - Sign up or log in, create or join chats, and message in real time.
- Open multiple browser windows or different accounts to test live updates.
ChitChat/
ββ client/ # React client (Vite)
β ββ public/
β ββ src/
β ββ package.json
ββ server/ # Express + Socket.io server
β ββ src/
β ββ package.json
ββ screenshots/ # Example screenshots used in README
ββ README.md
POST /api/auth/signupβ create a new userPOST /api/auth/loginβ login and receive JWTGET /api/messages/:chatIdβ fetch messages for a chatPOST /api/messagesβ send a message (also emitted via Socket.io)
Socket.io topics (examples): connection, joinRoom, leaveRoom, newMessage, typing
- Fork the repository and create a feature branch:
git checkout -b feat/your-feature - Keep commits small and focused; follow conventional commit messages.
- Open a pull request describing the change and related issue.
- Run linters and tests before submitting a PR.
Consider opening issues for feature requests or bugs. Be respectful and follow a professional code of conduct.
This project is licensed under the MIT License β see the LICENSE file for details.
- Jatin β https://github.com/your-username
If you'd like, replace placeholders (links, examples) with real values and add screenshots to /screenshots/.
A modern chat application built with clean architecture and intuitive design.
- Real-time messaging
- User authentication
- Message history
- Responsive UI
git clone https://github.com/yourusername/ChitChat.git
cd ChitChat
npm installnpm startOpen your browser and navigate to http://localhost:3000
- Node.js
- Express
- React
- MongoDB
Pull requests are welcome. For major changes, please open an issue first.
MIT License - see LICENSE file for details
For questions or issues, please open a GitHub issue.
π Tech stack: MERN + Socket.io + TailwindCSS + Daisy UI π Authentication && Authorization with JWT πΎ Real-time messaging with Socket.io π Online user status π Global state management with Zustand π Error handling both on the server and on the client β At the end Deployment like a pro for FREE!


