Form a league with friends for a fun competition to complete achievements awarded for actions in your League of Legends games
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

League Unlock Challenge

League Unlock Challenge uses data about your League of Legend games provided by the Riot Developer API to give you points for several kinds of achievements. You can form a league with friends for a fun competition to be the best at the League Unlock Challenge!

The project is currently ongoing and not yet fully functional.


  1. PostgreSQL
  2. PostgREST
  3. Python 3
  4. Virtualenv
  5. Node.JS
  6. Bower

If you are using MacOSX you should install homebrew by opening the terminal and running

/usr/bin/ruby -e "$(curl -fsSL"

Install PostgreSQL

PostgreSQL is a open source database that is used in this project to store the data we receive from the API. You can get more information on


sudo apt-get install postgresql postgresql-contrib

MacOSX with homebrew:

brew install postgres


Download and install binary from

Get PostgREST

PostgREST serves a fully RESTful API from any existing PostgreSQL database. It provides a cleaner, more standards-compliant, faster API than you are likely to write from scratch.

You can get more information on

To use PostgREST you can download the release for you platform from and extract it with

tar -xf postgrest-[version]-[platform].tar.xz

Install Python


Linux distribution usually come with python 3 preinstalled. If both python 2 and 3 are installed, you might need to run it as python3. You can make sure you have the right version with python -v.

MacOSX with homebrew:

Install it with

brew install python


Download the official release here and execute to install:

This will come with pip automatically. If your installation does not have it read here

Install virtualenv & python dependencies

To install virtualenv, run pip install virtualenv.

Create virtualenv and install the dependencies for the python scripts:


virtualenv --no-site-packages --distribute .env && source .env/bin/activate && pip install -r db_scripts/requirements.txt


virtualenv --no-site-packages --distribute .env; and source .env/bin/; and pip install -r db_scripts/requirements.txt

To deactivate the virtualenv again:


Install Node.JS


curl -sL | sudo -E bash -
sudo apt-get install -y nodejs

MacOsX with homebrew:

brew install node


Download and install the binary:

After installing:

Once Node.JS and NPM are installed you can run

npm install

to install the required javascript packages.

Install Bower

npm install -g bower
bower install


Start PostgreSQL server

Read how to start the database server:

Once the server is started, create a database

createdb luc

Start PostgREST server

Start PostgREST server on default port 3000

postgrest postgres://localhost:5432/luc -a postgres -j <secret>

For more information read

You can now use the PostgREST API to register, login and read the available data.

To create a new user, you can use the signup function.

POST localhost:3000/rpc/signup


    "leaguename": "Fidge1234",
    "region": "EUW",

Use the login function to receive a jwt token to authenticate with.

POST localhost:3000/rpc/login


    "leaguename": "Fidge1234",
    "region": "EUW",


    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImZvb0BiYXIuY29tIiwicm9sZSI6ImF1dGhvciJ9.KHwYdK9dAMAg-MGCQXuDiFuvbmW-y8FjfYIcMrETnto"

You can get account information with the current_id function, if you provide the jwt token.

POST localhost:3000/rpc/current_id


Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImZvb0BiYXIuY29tIiwicm9sZSI6ImF1dGhvciJ9.KHwYdK9dAMAg-MGCQXuDiFuvbmW-y8FjfYIcMrETnto


    "id": "12345678",
    "region": "euw"

To make requests against the database, you also have to provide your token.

GET localhost:3000/player?id=eq.12345678


Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImZvb0BiYXIuY29tIiwicm9sZSI6ImF1dGhvciJ9.KHwYdK9dAMAg-MGCQXuDiFuvbmW-y8FjfYIcMrETnto


    "id": 12345678,
    "leaguename": "fidge1234",
    "region": "euw",
    "iconid": 1,
    "leagueid": null,
    "wins": 0,
    "points": 0

Python scripts

Too use the python scripts, you will need to create key-file with your Riot API Key first.


To use the python scripts that are updating/filling your database, you will need to create a db_config file with your hostadress of your postgresql server, the name of your db, the user_name for your database and your password for this user. All this information should each be stored per line.

echo HOSTADRESS >> db_config
echo DB_NAME >> db_config
echo USER_NAME >> db_config
echo PASSWORD >> db_config

Once this information is provided, you can run the to trigger all necessary functionality.

./db_scripts/ -h # help
./db_scripts/ --reset # reset or create the database and fill it with static data from the API
./db_scripts/ --register -n 'name' -r 'region' -p 'password' # convenience function to register a user
./db_scripts/ --verify # trigger a verification process which creates an entry in the player table for all registered users
./db_scripts/ --update # load recent games for all players and write calculated points to db


Local Deployment for Development

You can use the serve gulp task to deploy locally.

gulp serve

This outputs an IP address you can use to locally test and another that can be used on devices connected to your network.

Github Pages

  1. In app.js change app.baseUrl = '/'; to app.baseUrl = '/league-unlock-challenge/';
  2. Run gulp build-deploy-gh-pages from command line
  3. To see changes wait 1-2 minutes then load Github pages for your app (ex: