Skip to content

Add optional Docker dev environment + dummy data seed scripts - #34

Open
tkitsunai wants to merge 1 commit into
nemasu:masterfrom
tkitsunai:feature/docker-dev-seed
Open

Add optional Docker dev environment + dummy data seed scripts#34
tkitsunai wants to merge 1 commit into
nemasu:masterfrom
tkitsunai:feature/docker-dev-seed

Conversation

@tkitsunai

Copy link
Copy Markdown
Contributor

Closes #33

Why

Local backend setup currently needs a native Postgres + Redis + diesel_cli
install.
Even once it's running, the DB is empty until cargo run pull has
synced 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 - optional
    Postgres 18 + Redis containers, plus a disposable diesel_cli image (built
    from rust:slim, no native libpq needed) for running migrations.
  • scripts/seed/*.sh - generates dummy players/ratings/games and aggregates
    them into the same Redis keys the real src/pull.rs jobs
    (update_matchups/update_distribution/update_popularity) produce, so
    Top, Legend, per-character rankings, search, Popularity, Matchup Tables, and
    Rank Distribution all have something to render. See
    scripts/seed/README.md for exactly what gets created and the dependency
    order between scripts.
  • A short "Development database (Docker, optional)" section in the main
    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 endpoint
returns 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).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Docker containers for local dev DB + dummy data seeding

1 participant