NyaaStats
A user state page builder for Minecraft.
How to use
You can simply build your own web pages, just follow this instruction.
You need to do these command in a series.
First grab user data from map folder
- Clone the project.
npm install
.- Rename config.example.yml to config.yml and modify it.
- Run
npm start
. This will take long time to grab the informations for each user, be patient. Your data will be written to youroutput
directory defined in config file.
Build skin render
- Go into
skin
folder. npm install && npm run build
.
Build web pages
- Go into
web
folder. npm install && npm run build
.
That's all
Now you can find all the files you need in the web/dist
folder.
Move files in place:
- Move
web/dist
to your webroot - Move the output directory you defined to
webroot/static/data
Final File Structures
- webroot
+ index.html
- static
+ css
- data # here's the data that main application produces
+ info.json
+ players.json
+ (...) Player UUID directories
+ fonts
+ img
+ js
+ skin
Upload webroot to you server, and configure your nginx server like this:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name example.com;
location / {
try_files $uri $uri/ @rewrites;
}
location @rewrites {
rewrite ^(.+)$ /index.html last;
}
}
Notice:
If you want to deploy without nignx, you will need to change the router mode from
history
tohash
here. Remember to rebuild web pages.
Update player data
Run npm start
in the root folder of this project which means recreate the data folder and upload it to your web root. You don't need to run other commands everytime you update players' data but needed when we upgrade the code of our web client.
Credits
The skin render is almost a copy from NameMC. Thanks for their excellent work.