This project is a simple chat application built using Socket.IO, Express, and SQLite. It demonstrates how to set up a real-time chat application with message persistence and clustering for better performance.
- Real-time messaging using Socket.IO
- Message persistence with SQLite
- Clustering for better performance
- Connection state recovery
- Simple and clean UI
- Node.js (v14 or later)
- npm (v6 or later)
-
Clone the repository:
-
Install the dependencies:
npm install
-
Start the server:
node index.js
-
Open your browser and navigate to http://localhost:3000 to start chatting.
socketio-chat/
├── index.html
├── index.js
├── package.json
└── README.md
- index.html: The frontend of the chat application.
- index.js: The backend server using Express and Socket.IO.
- package.json: The project's dependencies and scripts.
- Socket.IO: Real-time communication library.
- Express: Web application framework for Node.js.
- SQLite: Lightweight database for message persistence.
- Socket IO Cluster Adapter: Node.js module for creating child processes.
This project is licensed under the ISC License. See the LICENSE file for details.
This project is based on the Socket.IO tutorial: Socket.IO Tutorial.
Feel free to contribute to this project by opening issues or submitting pull requests. Happy chatting!