Giter Site home page Giter Site logo

caioicy / slippi-leaderboard-sa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grantismo/coslippileaderboard

0.0 0.0 0.0 4.72 MB

Home Page: https://caioicy.github.io/slippi-leaderboard-sa

License: MIT License

JavaScript 5.46% TypeScript 94.45% CSS 0.09%

slippi-leaderboard-sa's Introduction

South America Ranked Slippi Leaderboard

Code powering https://caioicy.github.io/slippi-leaderboard-sa/#/

Fork of Grantismo/CoSlippiLeaderboard Documentation may not be updated relative to it

Technologies

How it works

The leaderboard is built from two programs:

  • [src/] A static react website which displays player data
  • [cron/] A cron job which pulls connect codes from a google sheet, player data from slippi, and writes that data to json files in cron/data/, and then redeploys the static site.

Caveats

  • The undocumented slippi api this depends on may break at any time
  • This project takes extra consideration to avoid slamming the slippi servers with api calls, please be considerate of this.
  • Logic for determining ranks may become out of sync with the official slippi rank logic
  • I would appreciate if you keep my 'by me a coffee' link and give me credit for building this in your leaderboard.

Getting started

  • Easiest to get working on a unix system (linux/mac). On windows you can use WSL to install ubuntu. https://learn.microsoft.com/en-us/windows/wsl/install
  • Clone this repository: git clone https://github.com/caioicy/slippi-leaderboard-sa.git
  • (Optional) Install NVM -- instructions here
  • (Optional) Run nvm use 18.12.0. This will ensure that you are running the supported version of Node.js.
  • Install yarn npm install --global yarn
  • Install dependencies: yarn (from your code directory).
  • (Optional) Install the github cli tool -- instructions here https://github.com/cli/cli#installation
  • (Optional) Run gh auth login
  • Set your repoPath in settings.js and "homepage" in package.json to your github pages url (e.g. https://caioicy.github.io/slippi-leaderboard-sa/)

If you want to collect connect codes from a google form

If you want to manually populate your list of connect codes:

Test your cronjob

  • Create dummy initial data echo '[]' >> cron/data/players-new.json
  • Run the job ./cron/run.sh
  • A successful job should look like this:

image

Test the web app

Final steps

  • Commit any remaining changes
  • git add .
  • git commit -m "Describe your commit here"
  • Edit your crontab to run the cronjob on a reoccuring basis (every hour for example) Example crontab:
# m h  dom mon dow   command
0 * * * * /bin/bash /full/path/to/your/code/slippi-leaderboard-sa/cron/run.sh
  • You can look in cron/logs/log.txt to see the output of the latest cron run.
  • That's it!
  • DM me on discord if you run into problems. blorppppp#2398

Settings

settings.js file includes all important settings that should be used to setup deployments to gh-pages:

  • title – Base application title
  • cname – Adds CNAME file that allows to use custom domain names with gh-pages
  • repoPath – username.github.io/repoPath for react router to recognize gh-pages paths
  • spreadsheetID - ID for google sheet containing player connect codes. https://docs.google.com/spreadsheets/d/[YOUR ID]

scripts

  • npm start – starts development server with webpack-dev-server
  • npm run build – builds project to production
  • npm run deploy – builds and deploys project to Github pages
  • ./cron/run.sh - manually runs the cron job

Support original repo creator

buy me a coffee

slippi-leaderboard-sa's People

Contributors

caioicy avatar grantismo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.