Skip to content

Wire the "Publish Your API" developer flow instead of routing publishers to /billing #137

@greatest0fallt1me

Description

@greatest0fallt1me

Description

The landing page advertises a publisher journey ("Register as developer", "Publish your API", "Set pricing per request") in developerSteps (src/App.tsx:71-92), and the hero exposes a "Publish Your API" button. However that button's handler routes publishers to the billing/deposit screen — onPublishApi={() => navigate(APP_ROUTES.billing)} (src/App.tsx:492) — and there is no publish route in APP_ROUTES (src/App.tsx:99-108). Developers therefore have nowhere to actually list an API.

This issue adds a real "Publish your API" page with a form that captures the listing fields the rest of the app already consumes via the APIItem type (src/data/mockApis.ts:1-16).

Requirements and context

  • Add a /publish route to APP_ROUTES (src/App.tsx:99-108) and a PublishApiPage rendering a form for name, provider.name, description, pricePerRequest, category (reuse ALL_CATEGORIES from src/components/FiltersSidebar.tsx:1-7), and tags.
  • Point the hero "Publish Your API" button (src/App.tsx:492) and the developer CTA at /publish.
  • Validate inputs (required name/description, pricePerRequest >= 0, non-empty category) and show inline errors; on submit, append the new APIItem to an in-memory list (or localStorage) consistent with the existing MOCK_APIS shape so it appears in the marketplace.
  • Non-functional: reuse existing design tokens and shared components per the design-system guide (README.md:19-26), keep the form keyboard-navigable with labelled fields like FiltersSidebar, and avoid the inline-style sprawl seen in ApiDetailPage.

Acceptance criteria

  • /publish route exists and renders a labelled, validated publish form.
  • "Publish Your API" no longer navigates to /billing.
  • Submitting a valid form creates an APIItem-shaped record that renders in the marketplace grid.
  • Invalid submissions show inline, accessible error messages and block submission.
  • npm run build passes with strict TypeScript.

Suggested execution

1. Fork the repo and create a branchgit checkout -b feature/publish-api-flow.

2. Implement changessrc/App.tsx (route + CTA), a new src/pages/PublishApiPage.tsx, and a small helper to add listings to the mockApis source.

3. Write/extend tests — this repo has no test runner configured. Add Vitest + @testing-library/react + jsdom and a "test": "vitest run" script, then test that submitting valid values calls the add-listing helper and invalid values surface errors.

4. Test and commit

npm install
npm run dev      # verify Publish Your API opens the new form
npm run build
npm run test

Example commit message

feat(publish): add developer Publish Your API flow and route

Guidelines

  • New form/page modules must reach ≥90% line coverage once tested.
  • Use design tokens and shared components, keep all inputs labelled, and document the publish flow in the README.
  • Timeframe: 96 hours.

Metadata

Metadata

Assignees

No one assigned

    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