Skip to content

Feature: Sponsor Bounty Creation Flow #181

Description

@Benjtalkshow

Overview

The platform exposes a createBounty GraphQL mutation but has no UI route to actually create one. Sponsors can only view, review, and approve bounties; they cannot create them through the app. This is a critical missing flow that blocks any new sponsor from listing work on the platform.


Goals

  • Allow authenticated sponsors to create bounties of all four types (FIXED_PRICE, COMPETITION, MILESTONE_BASED, lightning round)
  • Validate inputs client-side (title, reward amount, deadlines, category)
  • Wire to the existing createBounty mutation
  • Surface success and error states clearly
  • Redirect to the new bounty detail page on success

Implementation Details

1. Create the bounty creation route

Create: app/bounty/create/page.tsx

  • Multi-step form (basic info → rewards/deadline → review)
  • Type selector (FIXED_PRICE, COMPETITION, MILESTONE_BASED)
  • Reward amount + currency picker (XLM, USDC, EURC)
  • Deadline picker
  • Optional bountyWindowId for Lightning Rounds
  • GitHub issue URL field (required for FIXED_PRICE)
  • Cover description (markdown editor optional)

2. Validation

  • Min cover description length
  • Reward amount > 0
  • Deadline must be in the future
  • For COMPETITION: require start/end dates
  • For MILESTONE_BASED: require at least 2 milestones with payout split summing to 100%

3. Create the mutation hook

Create: hooks/use-create-bounty.ts

  • Wraps the generated useCreateBountyMutation
  • Invalidates bountyKeys.lists() on success
  • Returns toast and redirect

4. Permission gating

Modify: components/global-navbar.tsx

  • Show "Create Bounty" CTA only for authenticated users with sponsor role (or organization membership)

Files Affected

Created

  • app/bounty/create/page.tsx
  • hooks/use-create-bounty.ts
  • components/bounty/bounty-create-form.tsx

Modified

  • components/global-navbar.tsx

Acceptance Criteria

  • Sponsors can create FIXED_PRICE, COMPETITION, and MILESTONE_BASED bounties from the UI
  • Required fields are validated client-side before submission
  • Successful creation redirects to /bounty/[id]
  • Failed creation surfaces an inline error and keeps form state
  • Non-sponsors do not see the Create CTA in the navbar
  • Bounty list cache is invalidated on success

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions