A real-time chat server built with Node.js and Socket.io, featuring persistent message storage using Turso (libSQL), enabling instant messaging with user notifications and message history.
- Real-time chat powered by Socket.io.
- Persistent message storage using Turso (libSQL).
- User join and leave notifications.
- Message history synchronization on reconnect.
- Simple and functional web client for sending and receiving messages.
- Local storage of username in the browser.
- Node.js
- Express
- Socket.io
- Turso (libSQL)
- morgan (HTTP logger)
- Clone the repository:
git clone https://github.com/nruizcano/real-time-chat-server.git
- Install dependencies:
npm install
- Create a
.envfile in the root directory and add your libSQL URL and authentication token. - Start the server:
npm start
- Open the web client in your browser at
http://localhost:3000.
- When accessing the app, you'll be prompted to enter a username.
- Send messages using the input form.
- Messages will appear in real-time to all connected users.
- Notifications appear when users join or leave the chat.
- Message history is synchronized automatically when reconnecting.