Nexus is a full-stack real-time chat application built to demonstrate live communication, secure authentication, user presence tracking, and media handling using modern web technologies.
The project focuses on correctness, security, and real-time system behavior, rather than UI-heavy features.
- Instant 1-to-1 message delivery using Socket.IO
- Typing indicators with smooth UI updates
- Automatic message ordering during concurrent sends
- Real-time online/offline user status
- Accurate lastSeen timestamps persisted in MongoDB
- Presence updates broadcast instantly across connected clients
- JWT-based authentication stored in HTTP-only cookies
- Protected Express routes using middleware-based authorization
- Persistent login via session validation
- Profile images and inline chat media uploads via Cloudinary
- Optimized image URLs stored securely in the database
Frontend
- React (Vite)
- Context API
- React Router
- Axios
- Socket.IO Client
- Tailwind CSS
Backend
- Node.js
- Express.js
- MongoDB & Mongoose
- Socket.IO
- JWT Authentication
- Cloudinary
- REST APIs handle authentication, user management, and message history
- Socket.IO powers real-time messaging, typing indicators, and presence updates
- Server maintains a
userId → socketIdmapping to track active users - On socket disconnect, the user’s lastSeen timestamp is updated in MongoDB
- HTTP-only cookies are used instead of localStorage to mitigate XSS risks
- Authentication middleware protects all sensitive routes
- Media uploads are offloaded to Cloudinary to reduce backend load
- Route–controller separation improves maintainability and clarity
cd backend
npm install
npm run dev