Skip to content

PavanRa-crypto/NexusChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

💬 NexusChat v2.0 — Real-Time Secure Messaging Platform

MERN Socket.io MongoDB JWT Encryption Status

A modern WhatsApp/Telegram-inspired real-time messaging application built using the MERN Stack, Socket.io, and AES-256 encryption for secure communication.

NexusChat delivers a fast, secure, and responsive messaging experience with real-time communication, encrypted chats, media sharing, typing indicators, reactions, and advanced messaging features.


🚀 Live Features

💬 Messaging System

  • Real-time bidirectional messaging
  • Instant message delivery
  • Typing indicator
  • Date separators
  • Last seen status
  • Online/offline presence
  • Read receipts
    • ✓ Sent
    • ✓✓ Delivered
    • 🔵✓✓ Read

🔐 Security & Encryption

  • AES-256-CBC message encryption using CryptoJS
  • Random IV generation for every message
  • Shared key derivation using SHA-256
  • JWT Authentication with httpOnly cookies
  • Encrypted message storage in MongoDB
  • Server never stores plaintext messages

😀 Chat Experience

  • Emoji reactions
  • Edit messages
  • Delete for me
  • Delete for everyone
  • WhatsApp + Telegram inspired dark UI
  • Responsive mobile-friendly design

📁 Media & File Sharing

Supports sharing:

  • Images
  • Videos
  • Audio files
  • PDFs
  • Documents

Additional media features:

  • Image preview lightbox
  • File attachment handling
  • Profile picture upload

🛠️ Tech Stack

Category Technology
Frontend React 18, Vite
State Management Zustand
Backend Node.js, Express.js
Database MongoDB, Mongoose
Real-Time Communication Socket.io
Authentication JWT + Cookies
Encryption CryptoJS (AES-256)
File Uploads Multer
HTTP Client Axios
Styling Pure CSS

📂 Project Structure

NexusChat/
│
├── backend/
│   ├── controllers/
│   ├── middleware/
│   ├── models/
│   ├── routes/
│   ├── socket/
│   ├── uploads/
│   └── server.js
│
├── frontend/
│   ├── src/
│   ├── public/
│   └── vite.config.js
│
└── README.md

⚙️ Installation & Setup

🔹 Prerequisites

Make sure these are installed:

  • Node.js v18+
  • MongoDB (Local or Atlas)
  • Git

🔸 Backend Setup

cd backend
npm install

Create .env file inside backend folder:

PORT=5000
MONGO_URI=mongodb://127.0.0.1:27017/nexuschat
JWT_SECRET=your_super_secret_key
NODE_ENV=development

Create uploads directory:

mkdir uploads

Run backend server:

npm run dev

🔸 Frontend Setup

cd frontend
npm install
npm run dev

Frontend runs on:

http://localhost:5173

🔐 Encryption Architecture

NexusChat uses secure client-side encryption flow:

  1. Shared secret generated using SHA-256
  2. AES-256 encryption performed before sending
  3. Random IV generated per message
  4. Only encrypted ciphertext stored in database
  5. Receiver decrypts message locally
  6. Server never accesses plaintext data

📡 REST API Endpoints

Method Endpoint Description
POST /api/auth/signup Register user
POST /api/auth/login Login user
POST /api/auth/logout Logout user
GET /api/users Fetch all users
GET /api/messages/:id Fetch messages
POST /api/messages/send/:id Send message

🔌 Socket Events

Event Purpose
newMessage Receive new messages
typing Typing indicator
stopTyping Stop typing event
messageEdited Edit message
messageDeleted Delete message
messageReaction Emoji reactions
messagesRead Read receipts
getOnlineUsers Online users list

🌍 Deployment

Service Platform
Frontend Vercel / Netlify
Backend Render / Railway
Database MongoDB Atlas

🧠 Future Enhancements

  • 📹 Voice & Video Calling
  • 👥 Group Chats
  • 🔔 Push Notifications
  • 🤖 AI Chatbot Integration
  • 🌐 Multi-language Support
  • ☁️ Cloud Media Storage
  • 📱 PWA Mobile Support

👨‍💻 Author

M Pavan

MCA Student
Full Stack MERN Developer


⭐ Project Status

✅ Production-Ready Real-Time MERN Chat Application


📜 License

This project is developed for educational and portfolio purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors