Seed the WealthWise database using the project's built-in seed scripts.
Behavior by argument
| Argument | Command | Seeds |
|---|---|---|
(none) or categories |
npm run db:seed |
System transaction categories from categories.seed.ts |
demo |
npm run db:seed -- demo |
Full demo dataset: user, transactions, budgets, goals from demo.seed.ts |
all |
Run both in sequence | Categories first, then demo |
Pre-flight checks
- Verify
.envexists inapps/api/— check withtest -f apps/api/.env. Never read its contents. - Warn if
NODE_ENV=productionis set — seeding in production is destructive. - Confirm MongoDB is reachable (check if the API is running or MongoDB container is up).
- Note: demo seeding may create duplicates if run multiple times against the same database.
Steps
- Run the appropriate seed command
- Report what was created based on the seed output (number of categories, demo records, etc.)
- Remind the user:
- The demo user's credentials are defined in
apps/api/src/seeds/demo.seed.ts - The seeded data is only visible when the API server connects to the same MongoDB instance
- The demo user's credentials are defined in
Safety
Never run db:seed -- demo without confirming the target environment is not production.
If any doubt exists, ask before proceeding.