Warcraft Stat is a web-site that allow you to track best players' statistics on their character.
It has been developed to facilitate the tedious process of wondering which stats pros are prioritizing on their class.
This repo is only the back-end, you can find the front-end (an SPA built with React) in the link bellow.
Python 3.10
with MyPy typingFastApi 0.80
with auto-generated doc
Here are the steps:
- You specify to the API which with boss you want to scrap from and with which class/spec/dps or heal,...
- The program will query WarcraftLog API to get the top 100 players on this boss with specify params.
- The program will query BattleNet API to get stat of each player's character.
- The API will display the results.
This repo is set-up with github actions. Each time you push on main
, the code will be deployed on production.
This app uses:
- Python
- FastApi
- Swagger (API documentation)
- GraphQL client (request to warcraftLog API).
- Docker (deployement)
In order to run the project, I used Docker to avoid installation issues.
All you need to do is:
Decrypt the .env.gpg
file to get API secrets. (use the passphrase in the 1password).
If you don't have it:
- Create a file
.env
(at the root of the project) - Require an API keys to warcraft log and to battle net. Fill
.env
like that:
# Wacraft log CLIENT ID
WL_CLIENT_ID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
# Wacraft log CLIENT SECRET
WL_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
WL_AUTH_URL=https://www.warcraftlogs.com/oauth/token
WL_API_GQL_URL=https://www.warcraftlogs.com/api/v2/client
# Battle net CLIENT ID
BN_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Battle net CLIENT SECRET
BN_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
BN_AUTH_URL=https://us.battle.net/oauth/token
Install Docker, launch it, then run:
docker build -t warcraft_stats_api .
Based on the image created, run the container:
docker run --env-file .env -p 8000:8000 -t warcraft_stats_api
The API should be accessible at localhost:8000/docs
The API should be accessible at localhost:8000
If you would like to add something to the project, feel free to open a Pull-Request!