Skip to content

feat: add bootstrap demo data endpoint for testnet#817

Closed
malik203 wants to merge 5 commits into
Pulsefy:mainfrom
malik203:comment
Closed

feat: add bootstrap demo data endpoint for testnet#817
malik203 wants to merge 5 commits into
Pulsefy:mainfrom
malik203:comment

Conversation

@malik203

Copy link
Copy Markdown
Contributor

Description

Implements a controlled way to bootstrap demo data for testnet environments, allowing reviewers to test the MVP quickly without manual data setup.

Changes

Core Implementation

  • Bootstrap Service - Generates 5 realistic demo projects with roadmaps, funding targets, and owner information
  • Bootstrap Controller - Admin-only endpoint with JWT authentication and role-based access control
  • DTOs - Request/response data types for the API
  • Bootstrap Module - Proper module integration with dependency injection

Key Features

  • ✅ Admin-only endpoint (requires ADMIN role)
  • ✅ Environment-based security (disabled in production by default)
  • ✅ Optional seed-based reproducible data generation
  • ✅ Returns created project IDs for verification
  • ✅ Comprehensive audit logging

Configuration

  • Added BOOTSTRAP_ENABLED environment variable
  • Auto-enabled in development/staging, disabled in production
  • Production-safe defaults

Documentation

  • BOOTSTRAP_DEMO_DATA.md - Comprehensive guide with configuration, API reference, usage examples, and troubleshooting
  • BOOTSTRAP_DEMO_QUICK_REF.md - Quick reference for contributors (60-second start guide)

Files Changed

  • apps/backend/src/bootstrap/bootstrap.service.ts (new)
  • apps/backend/src/bootstrap/bootstrap.controller.ts (new)
  • apps/backend/src/bootstrap/bootstrap.module.ts (new)
  • apps/backend/src/bootstrap/dto/bootstrap.dto.ts (new)
  • apps/backend/src/app.module.ts (modified)
  • apps/backend/src/lib/config.ts (modified)
  • apps/backend/BOOTSTRAP_DEMO_DATA.md (new)
  • apps/backend/BOOTSTRAP_DEMO_QUICK_REF.md (new)

Acceptance Criteria

  • Admin-only endpoint that creates demo projects/metadata
  • Does not run in production by default
  • Returns created IDs for verification
  • Documented usage steps for contributors

Usage Example

# Bootstrap demo data with optional reproducible seed
curl -X POST http://localhost:3000/bootstrap/demo-data \
  -H "Authorization: Bearer <JWT_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"seed": "test-123"}'

Closes #815

- Implement admin-only endpoint to seed demo projects
- Add environment-based security (disabled in production by default)
- Return created project IDs for verification
- Include comprehensive documentation for contributors
- Add BOOTSTRAP_ENABLED configuration flag

Closes Pulsefy#815
@drips-wave

drips-wave Bot commented May 30, 2026

Copy link
Copy Markdown

@malik203 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Cedarich

Copy link
Copy Markdown
Contributor

Fix workflow

@malik203

Copy link
Copy Markdown
Contributor Author

How am i gonna fix the workflow?

@Cedarich

Cedarich commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@malik203

@malik203

malik203 commented Jun 5, 2026 via email

Copy link
Copy Markdown
Contributor Author

@Cedarich

Cedarich commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

please fix

@malik203

malik203 commented Jun 5, 2026 via email

Copy link
Copy Markdown
Contributor Author

@Cedarich

Cedarich commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

See
Uploading IMG_1676.png…

Please resolve the conflict and fix workflow

@malik203

malik203 commented Jun 5, 2026 via email

Copy link
Copy Markdown
Contributor Author

@Cedarich Cedarich closed this Jun 5, 2026
@Cedarich Cedarich reopened this Jun 5, 2026
@Cedarich

Cedarich commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Fix lint errors

@Cedarich

Cedarich commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Please fix workflow

Run npm run lint and address the errors below

backend@0.0.1 lint
eslint "{src,apps,libs,test}/**/*.ts" --fix

/home/runner/work/Lumenpulse/Lumenpulse/apps/backend/src/bootstrap/bootstrap.controller.ts
Error: 14:3 error 'ApiExcludeEndpoint' is defined but never used @typescript-eslint/no-unused-vars

/home/runner/work/Lumenpulse/Lumenpulse/apps/backend/src/bootstrap/bootstrap.service.ts
Error: 58:3 error Async method 'bootstrapDemoData' has no 'await' expression @typescript-eslint/require-await
Error: 106:11 error Unsafe assignment of an error typed value @typescript-eslint/no-unsafe-assignment
Error: 106:22 error Unsafe call of a type that could not be resolved @typescript-eslint/no-unsafe-call

✖ 4 problems (4 errors, 0 warnings)

@Cedarich

Cedarich commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Please do npm run lint, and address the 4 pending lint errors.

We are almost there

Thank you

@malik203

malik203 commented Jun 6, 2026 via email

Copy link
Copy Markdown
Contributor Author

@Cedarich

Cedarich commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Please fix lint errrors

@Cedarich Cedarich closed this Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend: Testnet demo bootstrap endpoint (create sample projects + seed metadata) for MVP demos

2 participants