A tiny real time chat app using Node.js, Express, and Socket.IO.
- Send messages: type and hit Send
- Live receive: other tabs get the message instantly
- Typing indicator: shows bouncin dots while a user be typin
- Auto scroll: keeps the latest message in view without stretchin the panel
- Node.js (any modern LTS be fine)
Install deps:
npm installStart the server:
npm startOpen:
http://localhost:3000
To test chat proper, open two tabs and send messages between em.
index.js: Express server + Socket.IO eventspublic/index.html: UI and Socket.IO client code
-
Client to server
user:message{ text }user:typing{ typing: true|false }
-
Server to client
server:message{ text }server:typing{ id, typing }
- Static files be served from
public/ - If port
3000be taken, free it up or change the port inindex.js