A simple full-stack chat application built using the MERN stack (MongoDB, Express, React, Node.js) with real-time messaging support via Socket.IO. Chatty allows users to send and receive individual (1-on-1) messages instantly in an open system for all authenticated users.
- 🔌 Real-time messaging with Socket.IO
- 🧠 Full-stack MERN architecture
- 📄 Simple user interface built with React
- React
- Socket.IO Client
- Axios
- Node.js
- Express
- MongoDB with Mongoose
- Socket.IO
git clone https://github.com/your-username/chatty.git
cd chattycd server
npm installCreate a .env file in the server directory with the following:
PORT=5000
MONGO_URI=your_mongo_db_connection_stringRun the backend:
npm run devcd ../client
npm installStart the frontend:
npm start- A Socket.IO server runs alongside the Express app.
- Clients connect via Socket.IO on page load.
- Each user can send a message to another user by name (or ID).
- Server emits the message back to both the sender and the receiver in real-time.
- Open two browser tabs or devices.
- Type your user name (e.g., "Alice" and "Bob").
- Start sending messages to each other.
- Messages show up in real time without needing a refresh.
chatty/
├── client/ # React frontend
│ └── src/
│ ├── components/
│ └── App.js
├── server/ # Express + Socket.IO backend
│ ├── models/
│ ├── routes/
│ └── server.js
├── README.mdMIT License © 2025 — \sidd190