Add optional Docker dev environment + dummy data seed scripts - #34
Open
tkitsunai wants to merge 1 commit into
Open
Add optional Docker dev environment + dummy data seed scripts#34tkitsunai wants to merge 1 commit into
tkitsunai wants to merge 1 commit into
Conversation
Running the backend locally currently requires a native Postgres/Redis/diesel_cli install, and the DB stays empty until `cargo run pull` has synced real data from a live Steam client. This adds an optional docker-compose based dev environment plus scripts to seed dummy players/games/ratings so every frontend page has something to render without either of those.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33
Why
Local backend setup currently needs a native Postgres + Redis +
diesel_cliinstall.
Even once it's running, the DB is empty until
cargo run pullhassynced real match data from a logged-in Steam client - so there's no fast way
to check what a page actually looks like while working on the frontend.
What this adds
docker/docker-compose.dev.yml+docker/diesel/Dockerfile- optionalPostgres 18 + Redis containers, plus a disposable
diesel_cliimage (builtfrom
rust:slim, no native libpq needed) for running migrations.scripts/seed/*.sh- generates dummy players/ratings/games and aggregatesthem into the same Redis keys the real
src/pull.rsjobs(
update_matchups/update_distribution/update_popularity) produce, soTop, Legend, per-character rankings, search, Popularity, Matchup Tables, and
Rank Distribution all have something to render. See
scripts/seed/README.mdfor exactly what gets created and the dependencyorder between scripts.
README pointing at both.
What this doesn't change
Nothing about the existing native setup path (Requirements, manual
Postgres/Redis/diesel_cli install,
cargo run/cargo run pull) is touched -this is purely additive and opt-in.
Testing
Verified end-to-end:
scripts/seed/reset.sh(recreate containers +migrate) ->
scripts/seed/seed-all.sh(seed) -> every affected API endpointreturns seeded data -> spot-checked in the frontend (rankings, legend tier,
search, matchup tables, popularity, rank distribution, per-match rating change
display, multi-character player pages).