Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/safakb/socketio-chat
Socket.IO Chat with NodeJS + Mysql (Room Supported)
https://github.com/safakb/socketio-chat
html mysql node node-js socket socket-io
Last synced: about 1 month ago
JSON representation
Socket.IO Chat with NodeJS + Mysql (Room Supported)
- Host: GitHub
- URL: https://github.com/safakb/socketio-chat
- Owner: SafakB
- Created: 2024-09-07T18:46:29.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-09T07:45:11.000Z (2 months ago)
- Last Synced: 2024-10-15T17:43:43.940Z (about 1 month ago)
- Topics: html, mysql, node, node-js, socket, socket-io
- Language: JavaScript
- Homepage:
- Size: 65.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NodeJS socket.io Chat (Mysql Supported)
[![NPM version](https://badge.fury.io/js/socketio-chat.svg)](https://www.npmjs.com/package/socket.io)
![Downloads](https://img.shields.io/npm/dm/socketio-chat.svg?style=flat)![image](https://github.com/user-attachments/assets/007bd8b6-ef48-4a8b-a86f-daa21e7214ce)
![image](https://github.com/user-attachments/assets/36e9dfef-717a-4b77-92f5-79703995a781)
Using NodeJS with socket.io
Creating server and client with socket connection
Mysql Supported## ๐จ Important
~~`token`~~ and `password`(md5) hashes not safety## ๐ฅ Features
- Register
- Login
- Rooms
- Users
- Get online users list and count
- Connect / Disconnect
- Send Message## ๐ API Endpoints
| Action | Url | Request + Header |
| ------ | ------ | ------ |
| ๐ Login | /login | `{ "username" : "","password" : "" }` |
| ๐ Register | /register | `{"username" : "","nickname" :"","password" : "" }` |
| ๐ Logout | /logout | `{ "token": "" }` |
| ๐ Check Token | /check-token | `{ "token": "" }` |
| ๐ข Get Rooms | /rooms | `header: { "Authorization": "Bearer " }` |
| ๐ข Room Messages | /room-messages/:id | `header: { "Authorization": "Bearer " }` |
| ๐ Send Message to Room | /room-messages/:id | `{ "message": "" }` `header: { "Authorization": "Bearer " }` |### ๐ Before
- Create database
- Import database `exampledb.sql`
- Set `.env.example` and rename `.env`### ๐ Start NodeJS Server
```bash
npm install
node app.js
```### ๐ Go URL
`http://localhost:3001/index.html`### ๐งช Test User
User : `test`
Password : `123456`## ๐ฏ Roadmap
- Enabled Https server with certificate
- ~~Token change JWT~~
- ~~Fix multiple tab login~~
- Add new room messages counts
- Room message convert socket io `to` method#### Credits
- Used [UI](https://codepen.io/ThomasDaubenton/pen/QMqaBN)