Skip to content

A full-featured real-time chat application built using the MERN stack with Socket.io for real-time communication.

License

Notifications You must be signed in to change notification settings

chauhan-varun/ichat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iChat - Real Time Chat Application

Live Demo

A full-featured real-time chat application built using the MERN stack (MongoDB, Express, React, Node.js) with Socket.io for real-time communication.

Features

  • 🌟 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

Project Structure

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

Prerequisites

  • Node.js (v14+ recommended)
  • MongoDB (local or Atlas)
  • npm or yarn

Installation

  1. Clone the repository
git clone https://github.com/chauhan-varun/ichat.git
cd ichat
  1. Install server dependencies
npm install
  1. Install client dependencies
cd frontend
npm install
cd ..
  1. 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

Running the Application

Development Mode

Run backend server

npm run server

Run frontend (in a separate terminal)

cd frontend
npm run dev

Production Mode

Build the app

npm run build

Start the app

npm start

Technologies Used

Backend

  • Node.js & Express.js - Server framework
  • MongoDB & Mongoose - Database and ODM
  • Socket.io - Real-time communication
  • JWT - Authentication
  • bcrypt.js - Password hashing

Frontend

  • React.js - UI library
  • Vite - Build tool
  • TailwindCSS & Daisy UI - Styling
  • Socket.io-client - Real-time communication
  • Zustand - State management

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the ISC License.

About

A full-featured real-time chat application built using the MERN stack with Socket.io for real-time communication.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published