https://www.hreniuc.net A full-stack real-time chat platform built with Node.js, WebSockets, PostgreSQL, and WebRTC.
The application supports public chat, private messaging, friend systems, voice channels, and persistent message history.
It was designed and implemented as a custom communication platform focusing on real-time networking, backend architecture, and security best practices.
- WebSocket-based real-time messaging
- Public and private chat channels
- Tab-based chat interface
- Live online user list
- Peer-to-peer voice communication using WebRTC
- Custom WebSocket signaling server
- ICE/STUN negotiation
- Friend requests
- Private messaging between friends
- Online/offline presence indicators
- Image uploads
- Automatic client-side compression
- Image preview and modal viewer
- Secure password hashing (bcrypt)
- Email verification system
- Password reset flow
- Login rate limiting
- SQL injection protection (parameterized queries)
- XSS mitigation through HTML escaping
- Session token authentication
- PostgreSQL database
- Persistent message history
- Lazy-loaded message pagination
- User profiles and avatars
Backend:
- Node.js
- Express
- WebSocket (ws)
- PostgreSQL
- bcrypt
- Nodemailer
Frontend:
- Vanilla JavaScript
- WebRTC
- WebSocket API
- Responsive UI
Infrastructure:
- Environment-based configuration (.env)
- Secure file uploads
- Static asset serving
The system consists of:
- Node.js WebSocket server for real-time messaging
- PostgreSQL database for persistence
- WebRTC peer connections for voice channels
- Token-based authentication for session management
WebSocket messages are used for:
- chat messaging
- presence updates
- friend system events
- WebRTC signaling
This project implements several defensive measures:
- Password hashing using bcrypt
- SQL injection prevention via parameterized queries
- Login brute-force protection
- HTML escaping to prevent XSS
- Controlled image upload handling
- Token-based authentication
This project was developed as a learning exercise to explore:
- real-time networking
- WebSocket protocol design
- WebRTC signaling
- secure authentication flows
- scalable chat architecture