A full-stack real-time communication web app built using React + Vite, Node.js, Socket.IO, WebRTC, and MongoDB. Users can create accounts, manage friendships, and communicate via chat, audio, and video calls. The system uses secure HTTP-only JWT authentication and scalable socket architecture with STUN/TURN support.
- Secure JWT-based login/signup
- HTTP-only cookies for access token
- Onboarding with full name, location, bio, hobbies
- Send, accept, reject, cancel friend requests
- Bi-directional friendship logic
- Smart recommendations (users not friends and no pending requests)
- Socket.IO powered direct messaging
- In-memory chat delivery
- Chat history via backend API
- Peer-to-peer connections using WebRTC
- STUN (Google, Twilio) support
- Call request/response/leave events over socket
- Remote stream management
- Frontend: React (Vite), Tailwind CSS
- Backend: Express.js, MongoDB, Mongoose
- Sockets: Socket.IO with full event handler separation
- WebRTC: RTCPeerConnection with free STUN servers
/backend
├── controllers/
│ ├── auth.controller.js
│ ├── user.controller.js
│ ├── friend.controller.js
│ └── chat.controller.js
├── routes/
│ ├── auth.routes.js
│ ├── user.routes.js
│ ├── friend.routes.js
│ └── chat.routes.js
├── sockets/
│ ├── chatHandler.js
│ ├── callHandler.js
│ └── connectionHandler.js
├── models/
│ ├── userModel.js
│ └── friendRequestModel.js
├── middlewares/
│ └── auth.middleware.js
├── index.js
└── .env
/frontend
├── src/
│ ├── api/
│ ├── sockets/
│ ├── contexts/
│ ├── components/
│ ├── pages/
│ ├── App.jsx
│ └── main.jsx
| Area | Method |
|---|---|
| Auth | Register, login, logout with cookie inspection |
| Friend System | Test request flows: send, accept, reject, delete |
| Chat | Send messages and verify delivery in real-time |
| Call | Simulate audio/video call with multiple tabs/devices |
| Socket | Observe console logs for each socket event |
⚠️ Add screenshots here after running the app. Suggested images:
- Signup/Login page
- Home dashboard with friends & requests
- Chat window
- Ongoing video call
- Socket logs in browser devtools
git clone https://github.com/shivammiyyy/VOXTREAM.git
cd VOXTREAMCreate .env in /backend:
PORT=5000
CLIENT_URL=http://localhost:3000
MONGO_URI=mongodb://localhost:27017/connecthub
JWT_SECRET_KEY=your_jwt_secret
Create .env in /frontend:
VITE_API_BASE_URL=http://localhost:5000/api
VITE_SOCKET_URL=http://localhost:5000
cd backend
npm install
npm run devcd frontend
npm install
npm run devUses public STUN servers:
iceServers: [
{ urls: ["stun:stun.l.google.com:19302", "stun:global.stun.twilio.com:3478"] }
]TURN server support can be added for NAT traversal (optional).
-
Friend logic uses symmetrical arrays in both user docs.
-
Chat messages are stored in-memory (not persisted).
-
Socket handlers are modular and track:
- Room creation/join/leave
- Signal data
- Call events
- Notification events
Built by Shivammiyy.





