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: 10 months 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-09T07:45:11.000Z (over 1 year ago)
- Last Synced: 2025-04-14T23:11:54.245Z (10 months 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)
[](https://www.npmjs.com/package/socket.io)



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)