A lightweight real-time chat application built with Node.js, React, and WebSockets. It demonstrates a basic client–server architecture where multiple users can connect and exchange messages instantly.
- Real-time messaging using WebSockets
- React frontend interface
- Node.js backend server
- Multiple clients can connect simultaneously
- Lightweight and easy to run locally
- Node.js
- WebSockets (ws)
- React
- JavaScript
server/
server.js
client/
src/
package.json
git clone <repo-url>
cd simple-chatcd server
npm installcd ../client
npm installcd server
node server.jscd client
npm startThe app should now be available in your browser.
-
The Node.js server creates a WebSocket server.
-
The React client connects to the WebSocket endpoint.
-
When a user sends a message:
- It is sent to the server
- The server broadcasts the message to all connected clients
-
All users see the message instantly.
- Usernames / authentication
- Chat rooms
- Message persistence (database)
- Message timestamps
- Typing indicators
- Better UI styling