Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,28 @@ Seeded accounts use the password `Demo1234!`.

Priya's Neural Sync team and Marcus's CareBridge AI team have pending requests and seeded chat messages, so you can try the leader and chat flows without creating new accounts.

### Demo data on a live site

Use the demo seeder when you want a production-like database to look active for recruiters or testing. It creates 12 non-admin accounts at `@demo.hackmatch.dev`, 6 teams on upcoming hackathons, sample hackathons only when fewer than three upcoming events exist, team memberships, join requests, follows, and short team-chat messages. It never overwrites or deletes existing rows, and it only adds data for demo accounts.

From the repository root, set a password of at least 12 characters and confirm the run:

```bash
DEMO_SEED_CONFIRM=yes DEMO_PASSWORD="<at-least-12-characters>" npm run seed:demo
```

The command prints the database host and the counts it will create before writing anything. The password is never stored in the repository, hardcoded in the script, or printed. Keep demo credentials separate from any real account password.

To remove the demo data:

```bash
DEMO_SEED_CONFIRM=yes npm run seed:demo:remove
```

The removal command deletes only users whose email ends with `@demo.hackmatch.dev`. Their teams, memberships, requests, follows, messages, and notifications are removed by the existing cascade rules. It prints how many users it will delete first, and it refuses to run without `DEMO_SEED_CONFIRM=yes`.

These accounts are fake. Do not use them for real communication, and do not reuse a password from a real account. Never run `npm run db:seed` against production; that command is for the local development database only. The demo seeder is create-only and safe to repeat, and the removal command only deletes demo-domain accounts. Always confirm the printed database host before approving a run.

### Admin setup

The local seed creates one admin (`admin@hackmatch.dev`) with the demo password above. This account is for local demos only; do not reuse that password in production.
Expand Down
2 changes: 2 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"db:push": "prisma db push",
"db:generate": "prisma generate",
"db:seed": "ts-node src/seed.ts",
"seed:demo": "ts-node prisma/seedDemo.ts",
"seed:demo:remove": "ts-node prisma/seedDemoRemove.ts",
"make-admin": "ts-node src/scripts/make-admin.ts",
"migrate": "prisma migrate deploy",
"migrate:dev": "prisma migrate dev",
Expand Down
Loading
Loading