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.