This repository holds the source for moonkinmetrics.com, a website for exploring talent selection in World of Warcraft's rated PvP.
There are two distinct pieces to the site:
- A Go service which scrapes the Blizzard API for information about talents, pvp leaderboards, and spell icons.
- A Next.js front-end which can be rendered to static pages.
At a high-level, development setup consists of:
- Run
go run cmd/cli/cli.go talents
to collect information about talent trees. - Run
go run cmd/cli/cli.go ladder --region <region> --bracket <bracket>
to collect leaderboard data. - Run the development server with
npm run dev
from theui/
directory.
- Go 1.21.1
- Node
- Battle.net API key
Let's look at the fastest way to get the site up and running for local development:
#!/bin/bash
git clone https://github.com/crbednarz/moonkinmetrics
cd moonkinmetrics
# Both `WOW_CLIENT_ID` and `WOW_CLIENT_SECRET` should be set using your Battle.net API key.
# https://develop.battle.net/
export WOW_CLIENT_ID="<client_id>"
export WOW_CLIENT_SECRET="<client_secret>"
# Install Go dependencies
go mod download
# Capture current talent trees
go run cmd/cli/cli.go talents
# Scan a brackets
for region in us eu; do
go run cmd/cli/cli.go ladder --region "$region" --bracket 2v2
go run cmd/cli/cli.go ladder --region "$region" --bracket 3v3
go run cmd/cli/cli.go ladder --region "$region" --bracket rbg
go run cmd/cli/cli.go ladder --region "$region" --bracket shuffle
done
# Run the UI
cd ui
npm install
npm run dev
With that, the site is up and running. Changes made to source should be seen live on the development server at http://localhost:3000/
.
If you've finished scanning all brackets, you may also render the static pages with:
npm run build
npm run export
Which will dump the rendered site to the ui/out/
directory.
To help monitor the scanner, metrics can be exported to an OpenTelemetry collector via the --collector
flag. The simplest way to get started with the metrics is to use the provided docker-compose file:
cd infra/otel
# Start the collector, Prometheus, and Grafana
docker compose up -d
cd ../..
# Run any scan using localhost:4317 as the collector
go run cmd/cli/cli.go --collector localhost:4317 ladder --region "$region" --bracket shuffle
# Browse to http://localhost:3000 to view metrics in Grafana.
Contribution are now welcome. However, fair warning: Much of the project is missing sufficient documentation and testing, which could make it challenging to work on. This is something I'm actively working to improve, but in the meantime, feel free to reach out directly either as a GitHub discussion or on discord if you have any questions.
GNU Affero General Public License v3.0, see LICENSE.