The code is messy as hell, mostly because this project was started with zero internet access and built during a period of heavy internet censorship in Iran. Don’t expect elegance—expect shit getting done for survival.
This project is a lightweight, single-file web chat room built with Node.js and no extra frameworks or databases. The UI is RTL-friendly and works well on mobile.
This project has no database. All messages are stored in memory, with a small temporary cache under /tmp/enc_data to survive short restarts.
- Realtime chat with SSE (no WebSocket required)
- Unlimited rooms based on URL path (e.g.
/general) - Custom username stored in browser cookies
- Online users and join/leave presence
- “Typing” and “Uploading” status indicators
- Message reactions (👍 👎 ❤️ 💩)
- Replies with scroll-to-referenced message
- Pin messages with the
!pincommand - “Seen” indicator for messages
- File, image, voice, and video-note uploads with progress
- Built-in voice and video players
- Built-in emoji picker
- Multiple themes (Telegram/Discord/Amoled/Sunset/Mint/Slate/Rose)
- Message cache stored at
/tmp/enc_datafor partial persistence after restart
- Max file size: 100MB
- Max voice size: 8MB
- Max video size: 20MB
- Allowed extensions:
png, jpg, jpeg, gif, webp, pdf, txt, zip, mp4, mov, webm, mp3, wav, m4a, ogg, opus, apk, exe, deb
Just buy a Node.js instance from a PaaS like liara.ir and upload the project zip.
npm start
# or
node chat.jsThen open in your browser:
http://localhost:4000
To create a new room, just change the path:
http://localhost:4000/room-name
- Pin a message:
!pin your message - Clear all messages:
clearall342745, change it for your project
- The server runs over
httponly (HTTPS is currently disabled in code). - Messages are stored in memory with a ring limit of 300 per room.
- Minimal, easy to customize and extend.
chat.js: Node.js server and core logicindex.html: UI and client scriptfonts/andVazirmatn-font-face.css: Persian font assetsnotif.mp3: Notification sound