ChitChat is a MERN stack application that allows users to connect, add friends, and chat in real time.
The backend is built with Node.js, Express, and MongoDB, while the frontend uses React.
- 🔑 User Authentication (Login/Register with JWT)
- 👥 Manage Connections (Add/Remove Friends)
- 🌐 View Networks (List of all registered users)
- 💬 Real-time Messaging (via Socket.io)
- 📂 Modular Code Structure (Controllers, Routes, Middleware, Models)
- 🎨 Modern UI built with React
Frontend
- React.js
- TailwindCSS (for styling)
Backend
- Node.js
- Express.js
- MongoDB + Mongoose
- JWT Authentication
- Socket.io (for real-time communication)
backend/
│── config/
│ └── db.js # Database connection
│
│── controllers/
│ └── userController.js # Connections & networks logic
│
│── middlewares/
│ └── auth.js # Authentication middleware
│
│── models/
│ ├── user.js # User schema
│ └── connections.js # Connections schema
│
│── routes/
│ ├── auth.route.js # Auth routes
│ └── user.route.js # User routes
│
│── index.js # Entry point
│── package.json
│
frontend/
│── src/
│ ├── components/
│ │ ├── AddFriend.jsx # Example React component
│ │ └── ...
│ ├── App.jsx
│ └── ...
│── package.json
git clone https://github.com/anilgummula/ChitChat/.git
cd ChitChatcd backend
npm installCreate a .env file inside backend/ with:
MONGO_URI=your-mongodb-uri
JWT_SECRET=your-secret-key
PORT=5000
Run the backend:
npx nodemoncd frontend
npm install
npm run devPOST /auth/register→ Register a new userPOST /auth/login→ Login user
GET /user/networks→ Get all users (requires authentication)POST /user/connections→ Add or get connections (requires authentication)
This project is licensed under the MIT License.