This is a real-time chat application built with Node.js, Express, Socket.IO, and SQLite. Users can register with a username and send direct messages to other users. Messages are stored in a database and delivered instantly if the recipient is online, or shown when they next connect.
- Real-time messaging using Socket.IO
- User registration (username-based)
- Direct (one-to-one) chat
- Message persistence with SQLite
- Modern WhatsApp-style UI
index.js # Main server logic (Express, Socket.IO, SQLite)
package.json # Project metadata and dependencies
public/
css/
message.css # Chat UI styles
js/
message.js # Frontend chat logic
templates/
message.html # Main chat interface (HTML)
- Node.js (https://nodejs.org/)
- Clone or download this repository.
- Install dependencies:
npm install
Start the server:
npm startThe app will run on http://localhost:4000
- Open the app in your browser.
- Enter a username to register.
- Use the chat interface to send messages to other users by entering their username.
- Messages are delivered instantly if the recipient is online, or shown when they next connect.
- Edit
public/css/message.cssfor styles. - Edit
public/js/message.jsfor frontend logic. - Edit
templates/message.htmlfor the HTML interface. - Edit
index.jsfor backend/server logic.