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
Suggested execution
1. Fork the repo and create a branch — git checkout -b feature/publish-api-flow.
2. Implement changes — src/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.
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 inAPP_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
APIItemtype (src/data/mockApis.ts:1-16).Requirements and context
/publishroute toAPP_ROUTES(src/App.tsx:99-108) and aPublishApiPagerendering a form forname,provider.name,description,pricePerRequest,category(reuseALL_CATEGORIESfromsrc/components/FiltersSidebar.tsx:1-7), andtags.src/App.tsx:492) and the developer CTA at/publish.pricePerRequest >= 0, non-empty category) and show inline errors; on submit, append the newAPIItemto an in-memory list (orlocalStorage) consistent with the existingMOCK_APISshape so it appears in the marketplace.README.md:19-26), keep the form keyboard-navigable with labelled fields likeFiltersSidebar, and avoid the inline-style sprawl seen inApiDetailPage.Acceptance criteria
/publishroute exists and renders a labelled, validated publish form./billing.APIItem-shaped record that renders in the marketplace grid.npm run buildpasses with strict TypeScript.Suggested execution
1. Fork the repo and create a branch —
git checkout -b feature/publish-api-flow.2. Implement changes —
src/App.tsx(route + CTA), a newsrc/pages/PublishApiPage.tsx, and a small helper to add listings to themockApissource.3. Write/extend tests — this repo has no test runner configured. Add Vitest +
@testing-library/react+jsdomand 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 —
Example commit message
Guidelines