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.
- π Live Demo
- ποΈ Architecture
- β¨ Features
- π οΈ Tech Stack
- β‘ Quick Start
- π§ Installation
- π Project Structure
- π Environment Variables
- π Usage
- π Real-Time Communication
- π Deployment
- π§ͺ Future Improvements
πΊ Live Link: Chatverse
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
- π 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
# 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 installchatverse/
βββ π 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
PORT=
MONGO_URI=
JWT_SECRET=
CLIENT_URL=
NODE_ENV=productionVITE_API_URL=- Register β Create a new account with a unique username and password
- Automatic Authentication β After successful registration, the user is automatically signed in and redirected to the chat interface.
- Log In βYou can also login and Authenticate securely and receive a JWT session token
- Open Contacts β Toggle the contacts panel to browse all users
- Start a Chat β Select any user to open a private conversation
- Send Messages β Type and send β delivery is instant via Socket.IO
- Stay Live β Messages sync in real time across all active sessions
- Return Later β Existing users can log in again to continue their conversations.
- Socket.IO establishes persistent client-server connections.
- Connected users receive new messages without page refreshes.
- Message updates propagate instantly across active sessions.
# Install Vercel CLI and deploy
npm install -g vercel
cd client
vercel --prodAdd to Vercel dashboard environment:
VITE_API_URL=https://your-render-backend.onrender.com- Connect your GitHub repo to Render
- Set Root Directory β
server - Set Start Command β
npm start - Add all server environment variables in the Render dashboard
- Create a free cluster at MongoDB Atlas
- Whitelist
0.0.0.0/0under Network Access for Render's dynamic IPs - Copy your connection string into
MONGO_URI
- π€ 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 β