https://github.com/grmvoid/node-leaderboards
https://github.com/grmvoid/node-leaderboards
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/grmvoid/node-leaderboards
- Owner: grmvoid
- License: mit
- Created: 2022-02-05T13:38:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-08-22T18:27:11.000Z (9 months ago)
- Last Synced: 2025-02-01T14:35:24.752Z (4 months ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Leaderboards
Minecraft Leaderboards based on REST API
## Description
Leaderboards is an API that returns player statistics. Currently supported stats are points, number of kills and deaths. The API has been created to easily integrate statistics into our website. A minecraft plugin will be released soon.
## Getting Started
### Dependencies
* MySQL
* Node.js
* Yarn
* Nginx### Preinstallation
* Create new database
* Create tables
```CREATE TABLE `users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(48) DEFAULT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;CREATE TABLE `tokens` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`token` varchar(32) NOT NULL DEFAULT '',
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;CREATE TABLE `statistics` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uid` bigint(20) unsigned NOT NULL,
`kills` int(11) NOT NULL DEFAULT 0,
`deaths` int(11) NOT NULL DEFAULT 0,
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
```
* Add new token into tokens table### Installing
* Clone this repository
* Go to repository folder and type yarn install
* Rename app/backend/config/default.js to production.js
* Configure apps/backend/config/production.js
* Setup nginx as proxy server
* Start application by typing yarn start### API
* Making request
* Pass token to Authorization header
* Call /api/statistics?statisticName=[kill, death, score] (choose one)## Version History
* 0.1
* Initial Release## License
This project is licensed under the MIT License - see the LICENSE.md file for details