https://github.com/conterkote/vk-fortune-wheel-backend
Fortune wheel fullstack application for vk-mini-apps with real-time winners update
https://github.com/conterkote/vk-fortune-wheel-backend
express express-ws rest-api typescript webscoket-server
Last synced: 8 days ago
JSON representation
Fortune wheel fullstack application for vk-mini-apps with real-time winners update
- Host: GitHub
- URL: https://github.com/conterkote/vk-fortune-wheel-backend
- Owner: conterkote
- Created: 2023-04-09T17:06:02.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-11T18:11:06.000Z (about 2 years ago)
- Last Synced: 2024-12-29T12:22:17.954Z (6 months ago)
- Topics: express, express-ws, rest-api, typescript, webscoket-server
- Language: TypeScript
- Homepage: https://vk-backend.onrender.com/
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vk-fortune-wheel-backend
Frontend repository and more info about this project:
https://github.com/conterkote/vk-fortune-wheel-frontendFeatures:
- Websocket Server sends every client real-time winners
- All winning logic incapsulated inside server, you can't cheating on front :)# API Info
## Websocket:
This websocket sending to all clients real-time info about winners
wss://vk-backend.onrender.com/winners:## Routes:
#### POST : v1/wheel/spin
* Receives request with VK UserData, decrement user balance by 100 and add it to jackpot, then increment by winning amount and send response with new jackpot, balance and sends an object with degree measures, between which is the player's prize on the fortune wheel#### POST : v1/users/authorize
* Receives request with VK UserData and create his profile in database if not exist#### GET : v1/wheel/jackpot
* Sends info about current jackpot state#### GET : v1/users/balance
* Sends info about current user balance#### GET : v1/winners/latest
* Sends list of last 10 winnersUserData example: {
id : string,
photo_200 : string,
first_name : string
}