fix(seed): make the demo dataset usable out of the box#46
Merged
Conversation
The README's db:seed produced data that left key screens empty on a fresh local database: - Trending returned zero rows: seeded plays were anchored to a fixed past date (2026-05-23), so the "last 7 days" window was empty on any later date. Anchor seeded play timestamps to the run date instead (run.ts); catalog generation stays deterministic since the PRNG seed is unchanged. - Only 3 of 5 seeded users had history, so logging in as sam/riley showed empty analytics. Seed history for all five users and make each fuller (historyUsers 3 -> 5, historyPerUser 60-110 -> 90-160). - setup.sh migrated but never seeded, so `pnpm setup && pnpm dev` left an empty UI. Run db:seed during setup (skip with SKIP_SEED=1) and print the demo login. - README: add the seed step to the local-dev happy path and document the demo account (alex@statify.local / statify123).
|
@fateh-mammadli is attempting to deploy a commit to the Aykhan's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Why
On a fresh local database, the documented
db:seedleft several screens empty, which is exactly what a grader running the project locally would hit.What changed
2026-05-23), so the Trending query's "last 7 days" window matched nothing on any later date.run.tsnow anchors seeded play timestamps to the run date. Catalog generation stays deterministic (the PRNG seed is unchanged); only the play/playlist dates move.historyUserswas3, sosam/rileyhad no plays and showed empty analytics. Raised to5and bumpedhistoryPerUser60–110 → 90–160so every seeded account has a fuller dashboard.scripts/setup.shran install + migrate + build but only printed a seed hint, sopnpm setup && pnpm devproduced an empty UI. It now runsdb:seed(skip withSKIP_SEED=1) and prints the demo login.Verification
pnpm --filter @statify/db typecheckandpnpm --filter @statify/db testpass (72 tests, incl. the seed determinism + history-window tests).