- Create topic-based chat rooms
- Chat anonymously with auto-generated usernames
- View messages in real-time via WebSockets
- Messages are automatically deleted after 24 hours
🔗 Click here to open the app (deployed)
- ⚡ Real-time WebSocket chat (using
ws) - 🧪 Anonymous names per device (stored in
localStorage) - 💬 Multiple topic rooms
- 🧹 Automatic message cleanup after 24 hours (via cron job)
- 🌐 REST API for room & message management
- 🎨 Clean and responsive UI using shadcn/ui
- React + Vite
- TypeScript
- Shadcn UI (Radix + Tailwind)
- WebSocket (native browser)
- Node.js with TypeScript
- Express.js
- WebSocket Server (using
ws) - PostgreSQL + Prisma ORM
- Cron jobs with
node-cron
- What WebSockets are: A persistent full-duplex communication channel between client and server.
- How
wsworks: A minimalist WebSocket library in Node.js that gives low-level control. - Why not Socket.IO?: Socket.IO adds extra metadata and abstraction.
wsis better for lean setups and learning real WebSocket protocol. - How to handle real-time messaging: Broadcast messages to connected clients in a room.
- Room handling logic: Track rooms and users using in-memory data structures (like
Record<string, Set<WebSocket>>). - Anonymous user generation: Persist anonymous names per device via localStorage.
- Cron for cleanup: Scheduled task to remove messages older than 24 hours from the database.
- Add typing indicators
- Add message reactions or emojis
- Auto-scroll to latest messages
- Option to set nickname (optional)
MIT