A full-featured real-time chat application built using the MERN stack (MongoDB, Express, React, Node.js) with Socket.io for real-time communication.
- π Modern Tech Stack: MERN (MongoDB, Express, React, Node.js) + Socket.io + TailwindCSS + Daisy UI
- π Secure Authentication: JWT-based authentication and authorization
- π¬ Real-time Messaging: Instant messaging with Socket.io
- π’ Online Status: Real-time user online/offline status indicators
- π± Responsive Design: Works seamlessly on desktop and mobile devices
- π State Management: Global state handling with Zustand
- π‘οΈ Error Handling: Comprehensive error handling on both client and server
- π User Search: Find and connect with other users
ichat/
βββ backend/ # Server-side code
β βββ controllers/ # Route controllers
β βββ db/ # Database connection
β βββ middleware/ # Express middleware
β βββ models/ # Mongoose models
β βββ routes/ # API routes
β βββ socket/ # Socket.io implementation
β βββ utils/ # Utility functions
βββ frontend/ # Client-side code
β βββ public/ # Static files
β βββ src/
β βββ assets/ # Images, sounds, etc.
β βββ components/ # React components
β βββ context/ # React context
β βββ hooks/ # Custom React hooks
β βββ pages/ # Page components
β βββ utils/ # Utility functions
β βββ zustand/ # State management
- Node.js (v14+ recommended)
- MongoDB (local or Atlas)
- npm or yarn
- Clone the repository
git clone https://github.com/chauhan-varun/ichat.git
cd ichat
- Install server dependencies
npm install
- Install client dependencies
cd frontend
npm install
cd ..
- Create a .env file in the root directory with the following variables
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
NODE_ENV=development
Run backend server
npm run server
Run frontend (in a separate terminal)
cd frontend
npm run dev
Build the app
npm run build
Start the app
npm start
- Node.js & Express.js - Server framework
- MongoDB & Mongoose - Database and ODM
- Socket.io - Real-time communication
- JWT - Authentication
- bcrypt.js - Password hashing
- React.js - UI library
- Vite - Build tool
- TailwindCSS & Daisy UI - Styling
- Socket.io-client - Real-time communication
- Zustand - State management
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the ISC License.