A modern, real-time multi-room messaging system featuring instant chat lobbies, password-protected custom rooms, private direct messages, threaded message replies, and robust administrative moderation controls. Built with Socket.IO and Express.
- 🌟 Key Features
- 🛠️ Tech Stack & Architecture
- ⚙️ Setup & Local Installation
- 🚀 Run & Quick Start
- 🛡️ Security & Architecture Best Practices
- 🤝 Contributing & Support
- 📄 License
- 💬 Multi-Room Chat Lobbies: Instantly create, join, and browse rooms. Lobbies can be configured with optional password protection for private discussions.
- ✉️ Private Messaging: Direct one-on-one private chats with distinct, real-time message histories and unread notification badges.
- 🧵 Message Thread Replies: Native, context-aware threaded message replies inside both public lobbies and private conversations.
- 🗑️ Granular Message Deletion: Users can instantly delete their own messages, while room creators maintain moderation overrides to delete any message in their room.
- 🛡️ Administrative Moderation: Empower room creators to kick (temporarily time-out) or permanently ban problematic users, with full unkick/unban support.
- ✍️ Typing & Presence Indicators: Dynamic typing alerts showing who is active, complemented by real-time green online presence dots.
- 📶 Connection Status Bar: A premium, real-time visual indicator displaying current connection status (Connected, Reconnecting, Disconnected).
- 🔔 Toast & Audio Notifications: Non-blocking in-app alert banners paired with subtle acoustic beeps for incoming messages when the browser tab is inactive.
- 🎨 Nickname Personalization: Each user receives a unique, deterministic HSL color assigned to their nickname for rapid visual identification.
- ✨ Rich Text & Emoji Shortcodes: Automatic replacement of emoji text patterns (e.g.
:)→ 😊,:fire:→ 🔥) and regex-driven auto-linking for clickable URLs.
- Frontend Core: Vanilla HTML5, ES6 ECMAScript (Socket.IO client, coordinator pattern, dynamic DOM updates)
- Backend API & Server: Node.js & Express (Static resource routing, health checks)
- Real-Time Communication: Socket.IO 4.x (WebSockets with engine.io fallback polling)
- Styling System: CSS Variables (Slate-dark palette, responsive layouts, modular layouts)
chat-app/
├── chat-server.js # Core Express and Socket.IO server execution (Port 3456)
├── client.html # Front-end layout and static accessibility-compliant elements
├── client.js # DOM renderers, Event listeners, socket connections
├── style.css # Responsive slate layout styling and modal designs
├── package.json # Node scripts and package dependencies listing
└── pnpm-lock.yaml # pnpm lockfile
- Client ➡️ Server:
set_nickname,message_to_server,create_room,join_room,delete_room,kick_user,ban_user,unban_user,unkick_user,private_message,delete_message,open_private_chat,typing_start,typing_stop - Server ➡️ Client:
nickname_set,message_to_client,update_rooms,update_users,join_room_success,private_message,private_chat_history,error_message,kicked,banned,force_join,room_deleted,message_deleted,typing_indicator,user_online,user_offline,unread_count
- Node.js >= 18.x
- pnpm >= 9.x
-
Clone the Repository & Install Dependencies:
git clone https://github.com/agopalareddy/tales-we-weave.git # (Sub-repository path: chat-app) cd chat-app pnpm install
-
Configure Environment Variables: By default, the server runs on port
3456with a maximum message size of2000characters. You can override these by creating an environment file or passing them in:Variable Default Description PORT3456HTTP server port MAX_MESSAGE_LENGTH2000Maximum characters per message
Start the Express and Socket.IO server:
pnpm startFor rapid development with auto-rebuild and live-reload:
pnpm run devOpen http://localhost:3456 in your web browser.
- State Isolation: Memory storage is utilized for active users, messages, and room credentials, eliminating direct local file exposure.
- Access Control: Password hashing is conducted for protected rooms, ensuring restricted access to authorized users only.
- Session Resiliency: Gracefully handles network failures, featuring automatic Socket.IO reconnection mechanisms and session restoration routines.
- Accessibility (A11y): Fully compliant with WAI-ARIA standards, including ARIA labels, roles, and focus indicator outlines for screen readers.
This application is part of the CSE 503S: Rapid Prototyping and Creative Programming workspace at Washington University in St. Louis. Issues and PRs are welcome!
Distributed under the ISC License. See package.json for details.