Skip to content
Open
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
4 changes: 4 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ NEXT_PUBLIC_CONTRACT_ID=

# Optional app environment label for diagnostics (not a secret).
# NODE_ENV is set automatically by Next.js (development | production | test).

# Set to true to auto-seed the in-memory demo data when the local task API is first read.
# This is ignored in production.
NEXT_PUBLIC_SEED_DEMO_DATA=false
10 changes: 10 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,13 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.

## Local demo data

The frontend includes deterministic in-memory demo data for local development. It covers two organizations and three bounties: an open bounty, a bounty awaiting review with a submission and comment, and a completed bounty with an approved submission. The seed also creates representative notifications and contributor activity history.

From the `frontend` directory, run `pnpm db:seed` to reset the in-memory stores and load the sample records in the current process. Run `pnpm db:reset` when a clean in-memory state is needed. Because the project’s development stores are intentionally in memory, these commands are useful for scripts and tests; the data is not written to a production database or Stellar ledger.

To have the task API load the sample data automatically when its process starts, set `NEXT_PUBLIC_SEED_DEMO_DATA=true` in the local environment. This flag is ignored in production, and normal development behavior remains unchanged when it is omitted.

The reusable implementation is in `src/lib/demo-seed.ts`, making it straightforward to extend the fixtures or call `seedDemoData()` from additional local tooling.
5 changes: 4 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"start": "next start",
"lint": "eslint",
"test": "vitest run",
"test:security-headers": "node --test security-headers.test.mjs"
"test:security-headers": "node --test security-headers.test.mjs",
"db:seed": "tsx scripts/seed-demo-data.ts",
"db:reset": "tsx scripts/seed-demo-data.ts --reset"
},
"dependencies": {
"@creit.tech/stellar-wallets-kit": "^1.9.5",
Expand Down Expand Up @@ -50,6 +52,7 @@
"eslint": "^9",
"eslint-config-next": "16.1.3",
"tailwindcss": "^4",
"tsx": "^4.23.13",
"typescript": "^5",
"vitest": "^4.1.10"
},
Expand Down
Loading