Skip to content

Jyoti520/Chatverse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Chatverse β€” Real-Time Chat Application

React Vite Node.js MongoDB Socket.IO JWT

A full-stack real-time messaging platform built on the MERN stack with Socket.IO β€” instant message delivery, JWT-secured sessions, and a clean responsive UI.


πŸ“‹ Table of Contents

  • 🌐 Live Demo
  • πŸ—οΈ Architecture
  • ✨ Features
  • πŸ› οΈ Tech Stack
  • ⚑ Quick Start
  • πŸ”§ Installation
  • πŸ“‚ Project Structure
  • πŸ” Environment Variables
  • πŸ“– Usage
  • πŸ”„ Real-Time Communication
  • πŸš€ Deployment
  • πŸ§ͺ Future Improvements

🌐 Live Demo

πŸ“Ί Live Link: Chatverse


πŸ—οΈ Architecture

graph TD

A[React + Vite Frontend]
A -->|REST API| B[Express Server]

A -->|Socket.IO| C[Socket.IO Server]
A -->|REST API| B[Express Server]

C --> B
B --> G[(MongoDB Atlas)]

B --> D[Authentication]
B --> E[Chat Controller]
B --> F[Message Controller]

D --> G[(MongoDB Atlas)]
E --> G
F --> G

C --> G
Loading

✨ Features

  • πŸ” JWT-based authentication
  • πŸ‘€ User registration and login
  • πŸ’¬ One-to-one real-time messaging
  • ⚑ Socket.IO powered instant communication
  • πŸ“‘ Live message synchronization
  • πŸ“± Responsive UI for desktop and mobile
  • πŸ›‘οΈ Secure backend APIs
  • 🌐 Full-stack MERN architecture
  • ☁️ Cloud deployment using Render and Vercel
  • 🟒 Online/offline user presence
  • πŸ”‘ Persistent authentication

πŸ› οΈ Tech Stack

🎨 Frontend

React Vite React Router Axios Socket.IO Client

βš™οΈ Backend

Node.js Express Socket.IO JWT bcrypt

πŸ—„οΈ Database

MongoDB Atlas Mongoose

πŸš€ Deployment

Vercel Render MongoDB Atlas


⚑ Quick Start

πŸ“¦ Installation

# Clone the repository
git clone https://github.com/Jyoti520/chatverse.git
cd chatverse

# Install backend dependencies
cd server
npm install

# Install frontend dependencies
cd ../client
npm install

πŸ“ Project Structure

chatverse/
β”œβ”€β”€ πŸ“ client/
β”‚   β”œβ”€β”€ πŸ“ src/
|   |   β”œβ”€β”€ πŸ“ assets/            # Logo , Images
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/        # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ πŸ“ context/           # React context β€” auth & socket state
β”‚   β”‚   β”œβ”€β”€ πŸ“ hooks/             # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/             # Route-level page views
β”‚   β”‚   └── πŸ“ services/          # Axios api functions
β”‚   β”œβ”€β”€ πŸ“ public/
|   β”œβ”€β”€ πŸ“ App.jsx/
|   β”œβ”€β”€ πŸ“ main.jsx/
β”‚   └── πŸ“„ package.json
β”‚
β”œβ”€β”€ πŸ“ server/
β”‚   β”œβ”€β”€ πŸ“ config/               # DB connection & environment config
β”‚   β”œβ”€β”€ πŸ“ controllers/          # Request handler logic
β”‚   β”œβ”€β”€ πŸ“ middlewares/          # Auth guards & error handling
β”‚   β”œβ”€β”€ πŸ“ models/               # Mongoose schemas (User, Chat, Message)
β”‚   β”œβ”€β”€ πŸ“ routes/               # Express route definitions
β”‚   β”œβ”€β”€ πŸ“ test/                 # Unit & integration tests
β”‚   β”œβ”€β”€ πŸ“„ index.js              # App entry point & Socket.IO init
β”‚   └── πŸ“„ package.json
β”‚
└── πŸ“„ README.md

πŸ” Environment Variables

Server

PORT=
MONGO_URI=
JWT_SECRET=
CLIENT_URL=
NODE_ENV=production

Client

VITE_API_URL=

πŸ“– Usage

  1. Register β€” Create a new account with a unique username and password
  2. Automatic Authentication β€” After successful registration, the user is automatically signed in and redirected to the chat interface.
  3. Log In β€”You can also login and Authenticate securely and receive a JWT session token
  4. Open Contacts β€” Toggle the contacts panel to browse all users
  5. Start a Chat β€” Select any user to open a private conversation
  6. Send Messages β€” Type and send β€” delivery is instant via Socket.IO
  7. Stay Live β€” Messages sync in real time across all active sessions
  8. Return Later β€” Existing users can log in again to continue their conversations.

πŸ”„ Real-Time Communication

  • Socket.IO establishes persistent client-server connections.
  • Connected users receive new messages without page refreshes.
  • Message updates propagate instantly across active sessions.

πŸš€ Deployment

🌐 Frontend β€” Vercel

# Install Vercel CLI and deploy
npm install -g vercel
cd client
vercel --prod

Add to Vercel dashboard environment:

VITE_API_URL=https://your-render-backend.onrender.com

πŸ–₯️ Backend β€” Render

  1. Connect your GitHub repo to Render
  2. Set Root Directory β†’ server
  3. Set Start Command β†’ npm start
  4. Add all server environment variables in the Render dashboard

πŸ—„οΈ Database β€” MongoDB Atlas

  1. Create a free cluster at MongoDB Atlas
  2. Whitelist 0.0.0.0/0 under Network Access for Render's dynamic IPs
  3. Copy your connection string into MONGO_URI

πŸ§ͺ Future Improvements

  • πŸ‘€ Profile updates
  • πŸ–ΌοΈ Media sharing
  • πŸ”” Push notifications
  • πŸ“ž Voice & video calls
  • πŸ”’ End-to-end encryption
  • πŸ” Message search

πŸ’¬ Designed to demonstrate scalable real-time communication with the MERN stack and Socket.IO.

If you like this project, consider giving it a ⭐

⭐ Star this repository

About

Real chat application developed using React, Node.js, Express, MongoDB, and Socket.IO. Supports real-time messaging, authentication and chat management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages