Add full demo seed mode, admin API, and dashboard demo button#12
Open
Spbd1 wants to merge 1 commit into
Open
Conversation
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.
Motivation
Description
packages/db/src/demoSeed.tsthat creates an admin user, four treatment demo servers, 10x10 maps, 20 anonymous participants per server, parcel assignments, an active 7-round season, synthetic decisions for rounds 1–3 (production, investments, safe assets, public contributions, contracts, lobbying, exits), resolves rounds 1–3 via the engine, and records contracts/events/treasury/player round states.packages/db/scripts/seed-demo.tsand a new workspace scriptpnpm seed:demothat runs the demo seed (pnpm --filter @parcel-society/db seed:demo).POST /api/admin/demoatapps/web/app/api/admin/demo/route.tsand a dashboard action button labeledCreate Demo Experiment(visible only whenNODE_ENV === "development") inapps/web/app/admin/page.tsxwhich calls the endpoint and records an audit action.ADMIN_EMAIL=admin@example.comandADMIN_PASSWORD=changeme(.env.example,apps/web/lib/api/auth.ts, and admin login form), and README documentation describingpnpm seed:demoand demo login details.Testing
pnpm exec prettier --check ...which passed for the modified files.git diff --checkto ensure no whitespace/patch issues; the check passed.pnpm install/ typecheck / lint / fullpnpm seed:demowere attempted but blocked in this environment due to missingnode_modules(registry 403 for@types/node) and missing runtimetsx, so full runtime/typecheck verification could not complete here.pnpm install,pnpm --filter @parcel-society/db db:generate,pnpm --filter @parcel-society/db db:migrate, thenpnpm seed:demolocally to execute and verify end-to-end behavior.Codex Task