Real-time anonymous campus chat platform
Like Chinese Whisper gone wild: one rumor, doubt, roast or confession enters the chatβ¦ by the time it reaches the 50th person it's morphed into five different savage versions. Everyone walks away with their own twisted, unfiltered take β zero names attached.
Perfect for:
- Asking "dumb" questions without judgment
- Roasting campus Wi-Fi / mess / profs safely
- Confessions, memes, group study SOS, pure bakchodi
- Jo bolna hai bolo
Live demo: https://campus-whisper.onrender.com
Campus Whisper has been architected as an enterprise-grade, high-throughput distributed platform capable of scaling to 10,000+ concurrent WebSocket connections and processing 3,000+ messages/second:
- Horizontal WebSocket Clustering: Integrated
@socket.io/redis-adapterwithioredisto synchronize real-time messaging across multiple Node.js instances behind an API Gateway / Load Balancer. - Write-Behind Asynchronous Message Queueing: Decoupled instant real-time fanout (Fast Path: <5ms broadcast) from database persistence using BullMQ / Redis Streams. Background workers batch database inserts (
Message.insertMany), reducing MongoDB write IOPS by ~92% and preventing event loop starvation. - Distributed Presence Engine: Replaced single-node in-memory state with Redis Hashes & TTL key heartbeats to maintain active user rosters and room counts seamlessly across distributed cluster nodes.
- DDoS & Spam Defense: Token-bucket sliding window rate limiters on WebSockets (
socketRateLimiter) and Express API endpoints (express-rate-limit) to enforce strict payload and frequency controls. - Optimistic UI & Reconnect Resilience: Frontend built with client-assigned temp UUIDs, immediate state rendering, ACK acknowledgment handlers, and exponential backoff auto-rejoin logic.
- Automated High-Concurrency Load Tester: Includes a built-in stress testing suite (
scripts/loadTest.js) to simulate 1,000+ virtual concurrent clients pushing message bursts.
- 100% anonymous (random fun usernames, no email/phone)
- Real-time messaging (Socket.IO + Redis Pub/Sub)
- Write-behind message queueing & batch persistence (BullMQ + Redis)
- Categorized rooms: tech, study, confessions, gaming, social, etc.
- No dean, no tracking, no receipts
- Dark theme, mobile-friendly, modern UI
- Frontend: React 18 + TypeScript + Vite + Tailwind CSS + shadcn/ui
- Backend: Node.js + Express + Socket.IO + Redis Pub/Sub + BullMQ Queue + MongoDB (Mongoose) + JWT
- Real-time Engine: Distributed WebSockets via Socket.IO Redis Adapter
- Auth: Stateless anonymous JWT sessions
campus-whisper/
βββ frontend_campus_whisper/ β React/Vite app with optimistic UI & socket ACKs
βββ backend_campus_whisper/ β Scalable Express + Socket.IO + Redis + BullMQ server
β βββ config/redis.js β Redis Pub/Sub & presence manager
β βββ queue/messageQueue.js β BullMQ write-behind batching queue
β βββ workers/messageWorker.js β Decoupled MongoDB batch persistence worker
β βββ middleware/rateLimiter.jsβ Socket & API rate limiters
β βββ scripts/loadTest.js β High-concurrency socket load tester
βββ OVERVIEW.md β Architecture deep-dive
βββ OVERVIEW_Unhinged.md β Extra spicy notes (optional)
βββ README.md β You are here
Backend
cd backend_campus_whisper
npm install
cp .env.example .env # fill MONGODB_URI, JWT_SECRET, REDIS_URL
npm run devRun High-Concurrency Load Test
cd backend_campus_whisper
CONCURRENT_CLIENTS=50 MESSAGES_PER_CLIENT=20 node scripts/loadTest.jsFrontend
cd frontend_campus_whisper
npm install
cp .env.example .env.local # update VITE_SOCKET_URL if backend port β 5002
npm run devDetailed steps β check each folder's own README.
Never commit .env files or credential dumps.
PRs welcome β add rooms, features, bug fixes, or more chaos.
MIT β fork, deploy, roast responsibly.