An open API service indexing awesome lists of open source software.

https://github.com/ranak8811/chat-app-socket-io

This project is a fully functional real-time chat app that allows users to send instant messages, see online statuses, and manage authentication securely.
https://github.com/ranak8811/chat-app-socket-io

daisy-ui expressjs mongoose nodejs reactjs socket-io tailwindcss

Last synced: 3 months ago
JSON representation

This project is a fully functional real-time chat app that allows users to send instant messages, see online statuses, and manage authentication securely.

Awesome Lists containing this project

README

          

# โœจ Full Stack Realtime Chat App โœจ

A modern, full-stack realtime chat application built with the **MERN** stack, **Socket.io**, and styled using **TailwindCSS** and **DaisyUI**. It supports real-time messaging, authentication, global state management, and more!

---

## ๐ŸŒŸ Table of Contents

- [Introduction](#introduction)
- [Features](#features)
- [Tech Stack](#tech-stack)
- [Live Demo](#live-demo)
- [Installation](#installation)
- [Environment Variables](#environment-variables)
- [Usage](#usage)
- [Project Structure](#project-structure)
- [Examples](#examples)
- [Troubleshooting](#troubleshooting)
- [Contributors](#contributors)
- [License](#license)

---

## ๐Ÿงฉ Introduction

This project is a fully functional real-time chat app that allows users to send instant messages, see online statuses, and manage authentication securely. It leverages modern web technologies to deliver a seamless and dynamic chatting experience.

---

## ๐Ÿš€ Features

- JWT-based Authentication & Authorization
- Real-time messaging with **Socket.io**
- Online/Offline user status
- Global state management using **Zustand**
- Client and server-side error handling
- Responsive UI with **TailwindCSS** and **DaisyUI**
- Secure password hashing and storage
- Cloud-based media storage with **Cloudinary**
- Modern UX with toast notifications
- Production-ready build scripts

---

## ๐Ÿ› ๏ธ Tech Stack

**Frontend:**

- React
- Axios
- Zustand
- React Router DOM
- Socket.io Client
- React Hot Toast
- TailwindCSS
- DaisyUI
- Lucide React

**Backend:**

- Node.js
- Express.js
- MongoDB with Mongoose
- Socket.io
- JWT for authentication
- Bcrypt.js for password hashing
- Cloudinary for media uploads
- CORS, Dotenv, Cookie-parser

---

## ๐ŸŒ Live Demo

Check out the live app here:
โžก๏ธ [Realtime Chat App](https://chat-app-socket-io-dvzk.onrender.com)

---

## ๐Ÿ› ๏ธ Installation

1. **Clone the repository:**

```bash
git clone https://github.com/ranak8811/Chat-App-Socket-IO.git
cd Chat-App-Socket-IO
```

2. **Install backend dependencies:**

```bash
cd backend
npm install
```

3. **Install frontend dependencies:**

```bash
cd ../frontend
npm install
```

---

## โš™๏ธ Environment Variables

Create a `.env` file in the backend directory and add the following:

```plaintext
MONGODB_URI=your_mongodb_connection_string
PORT=5001
JWT_SECRET=your_jwt_secret_key

CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

NODE_ENV=development
```

---

## ๐Ÿ“ฆ Usage

**To run the app locally:**

1. Start the backend server:

```bash
cd backend
npm start
```

2. Start the frontend app:

```bash
cd frontend
npm start
```

**To build the frontend app:**

```bash
npm run build
```

---

## ๐Ÿ“ Project Structure

```plaintext
โ”œโ”€โ”€ backend
โ”‚ โ”œโ”€โ”€ controllers
โ”‚ โ”œโ”€โ”€ models
โ”‚ โ”œโ”€โ”€ routes
โ”‚ โ”œโ”€โ”€ middleware
โ”‚ โ”œโ”€โ”€ lib
โ”‚ โ””โ”€โ”€ index.js
โ”œโ”€โ”€ frontend
โ”‚ โ”œโ”€โ”€ src
โ”‚ โ”‚ โ”œโ”€โ”€ components
โ”‚ โ”‚ โ”œโ”€โ”€ hooks
โ”‚ โ”‚ โ”œโ”€โ”€ pages
โ”‚ โ”‚ โ”œโ”€โ”€ services
โ”‚ โ”‚ โ”œโ”€โ”€ store
โ”‚ โ”‚ โ”œโ”€โ”€ utils
โ”‚ โ”‚ โ””โ”€โ”€ App.jsx
โ”‚ โ””โ”€โ”€ tailwind.config.js
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ package.json
```

---

## ๐Ÿงช Examples

- **Register and Login**
- **Send and receive instant messages**
- **View online/offline user statuses**
- **Upload media to Cloudinary**
- **Global notifications using Toaster**

---

## ๐Ÿ›  Troubleshooting

- Ensure MongoDB Atlas is properly connected.
- Make sure your `.env` variables are correct.
- If WebSocket connection issues occur, check CORS settings and socket URL.
- Ensure that Cloudinary credentials are valid for image uploads.

---

## ๐Ÿ‘จโ€๐Ÿ’ป Contributors

- [**Md Anwar Hossain**](https://github.com/ranak8811)

---

## ๐Ÿ“œ License

This project is licensed under the **MIT License** - feel free to use it for personal and commercial purposes.