A clean clone needs three users plus their wallets and creator profiles to exercise most flows (creator list, profile read, ownership-gated update). The repo ships an idempotent seed script that creates exactly that state so contributors do not need to copy production-like data.
The script creates three deterministic users:
| Wallet address | Creator handle | Notes | |
|---|---|---|---|
alice.creator@example.test |
GA7XLM…ALICE |
alice |
Verified creator. Use for happy-path creator profile tests. |
bob.creator@example.test |
GA7XLM…BOB00 |
bob |
Unverified creator. Useful for permission and verification flows. |
charlie.fan@example.test |
GA7XLM…CHARLIE |
charlie |
Fan account (still has a creator profile). Use as the "wrong wallet" in ownership-gated tests. |
All three share the password localdev-password-1 (use this in any auth
flow that requires a password). The wallet addresses are obviously fake
placeholders — they keep the database happy without colliding with real
Stellar accounts.
The seed file is at prisma/seed.ts and is idempotent:
re-running it updates existing rows instead of failing on the unique
constraints.
# Bring the local Postgres container up
pnpm db:up
# Apply migrations
pnpm migrate
# Generate the Prisma client
pnpm generate
# Run the seed
pnpm exec ts-node prisma/seed.tsIf you want Prisma to call the seed automatically on prisma migrate reset,
add this to package.json:
The fastest way to a known-good state is prisma migrate reset, which drops
the schema, re-applies migrations, and runs the seed (when the hook above is
in place):
pnpm exec prisma migrate reset --forceWithout the hook, do it in two steps:
pnpm exec prisma migrate reset --force --skip-seed
pnpm exec ts-node prisma/seed.tsWhen you ship a feature that needs new fixture data:
- Add the row(s) to
SEED_USERS(or a new typed array if the shape differs) inprisma/seed.ts. - Use
upsertwith a stable unique key so re-runs stay idempotent. - Document any new account in this file's table.
- Avoid real PII —
*.testemails and synthetic wallet addresses are fine.
- Test the creator list endpoint:
GET /api/v1/creatorsreturns Alice and Bob (Charlie's profile is also included since the seed gives every user a creator profile). - Test ownership-gated profile update:
PUT /api/v1/creators/alice/profilewith headerx-wallet-address: GA7XLM…ALICEsucceeds; the same request withx-wallet-address: GA7XLM…CHARLIEreturns403 FORBIDDEN. - Test wallet-not-mapped path:
Send any request with a wallet address that is not in
SEED_USERS— ownership middleware returns401 UNAUTHORIZED.