Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

TriforceDataPull

Pulls LoL Esports data (leagues, tournaments, teams, players, schedule and live events) and keeps it in a PostgreSQL database.

Requirements

  • Rust 1.85+ (edition 2024)
  • Docker and Docker Compose

Setup

Start the database (PostgreSQL 18, port 5438):

docker compose -f docker/docker-compose.yml up -d

Create the Canyon config from the template:

cp canyon.toml.example canyon.toml

canyon.toml is not in git, change it there if your database is different. Canyon reads the first canyon*.toml it finds (up to 2 folders deep), so don't add other files with that name. With migrations = 'enabled' building connects to that database and creates canyon_memory, and running the app creates and changes its tables. Only point it to a database you own.

Run

cargo run

Canyon-SQL connects to the database when compiling: it creates canyon_memory, compares the models with the tables and puts the migration queries in the binary, which runs them on start. So Postgres has to be up to build, and the binary only fits the database it was built against. If you drop or recreate the tables, force a rebuild before running:

touch src/main.rs && cargo run

What runs when

On start everything is fetched and saved once (live events are saved from the first 2 minutes tick), then:

Data Every
Leagues 2 hours
Tournaments 2 hours
Teams and players 1 hour
Schedule (current page) 30 minutes
Live events 2 minutes

Schedules are in src/main.rs.

Project structure

Path What
src/main.rs Start up and scheduled loops
src/service/ LoL Esports API client
src/data_pull/ API models
src/dao/ Database models and writes
src/utils/ Constants (API base URL and endpoints)
docker/ Postgres for local development
bash_alias.sh Docker aliases (. ./bash_alias.sh)
docs/ Workflow, decisions and investigations
tools/lolesports-explorer/ Python tools to study the LoL Esports APIs

Docs

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages