A simple real-time chat application with user registration, login, online status, and a shared chat room.
- Frontend: React, Socket.IO Client, Axios
- Backend: Node.js, Express, Socket.IO, MongoDB (Mongoose), JWT, bcryptjs, CORS
- Database: MongoDB
minichat/
├── backend/
│ ├── models/
│ ├── routes/
│ ├── middleware/
│ └── server.js
├── frontend/
│ └── src/
│ ├── components/
│ └── services/
├── .gitignore
└── README.md
- Node.js (v16+ recommended)
- npm
- MongoDB (running locally on default port 27017)
git clone <your-repo-url>
cd minichat
Make sure MongoDB is running. On Windows, open a new terminal and run:
mongod
cd backend
npm install
node server.js
The backend will run on http://localhost:5000
Open a new terminal:
cd frontend
npm install
npm start
The frontend will run on http://localhost:3000
Go to http://localhost:3000 in your browser.
- User registration and login (username & password)
- JWT authentication
- Shared chat room for all users
- Online users list
- Real-time messaging (Socket.IO)
- Messages and users stored in MongoDB
- For development, both frontend and backend run locally.
- You can open multiple browser windows to test real-time chat and online status.
Enjoy chatting!