Skip to content

docs: add API_REFERENCE.md — developer reference for backend API client - #573

Merged
dadadave80 merged 1 commit into
Heliobond:mainfrom
CodedMumu:feat/api-reference-docs
Sep 6, 2026
Merged

docs: add API_REFERENCE.md — developer reference for backend API client#573
dadadave80 merged 1 commit into
Heliobond:mainfrom
CodedMumu:feat/api-reference-docs

Conversation

@CodedMumu

@CodedMumu CodedMumu commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Developers had no reference for how to call the backend API. This PR adds API_REFERENCE.md — a complete developer-facing reference for every function in src/lib/api.ts.

What was added

A 450-line markdown document covering:

  • Environment configurationNEXT_PUBLIC_API_URL table with required/default/purpose columns
  • Response types — all exported TypeScript interfaces (Project, ProjectWithDetail, Investment, PaginatedProjectsResponse, PricePoint) with field-by-field descriptions
  • 6 endpoints, each with:
    • Function signature with types and defaults
    • Backend HTTP method + path
    • Parameter table with constraints
    • Return value description
    • Demo/fixture fallback behaviour
    • Copy-paste usage example
  • Error handling contract — explains the never-throw-on-network pattern and the one exception (createInvestment throws on invalid input)
  • Demo/fixture fallback — explains NEXT_PUBLIC_API_URL-absent mode in detail
  • End-to-end usage examples — lazy pagination, project detail page, deposit flow, sparkline chart

Endpoints documented

Function HTTP Description
getProjects GET /projects All bond projects
getProjectsPaginated GET /projects?page=&limit= Lazy-load paginated slice
getProject GET /projects/:id Single project + detail
createInvestment POST /investments Create investment record
getPriceHistory GET /projects/:id/price-history 30-day price/yield history
biometricLogin Client-only (WebAuthn) Face ID / Touch ID auth

What was tested

No runtime code was changed — documentation only. Verified the document renders correctly in markdown preview.

close #441

Documents all 6 endpoints in src/lib/api.ts:
  - getProjects
  - getProjectsPaginated (lazy load, pagination params)
  - getProject (with input validation notes)
  - createInvestment (with validation + throw contract)
  - getPriceHistory
  - biometricLogin (WebAuthn, client-only)

Also covers:
  - NEXT_PUBLIC_API_URL environment configuration
  - All TypeScript response types with field descriptions
  - Demo/fixture fallback behaviour per function
  - Error handling contract (never throws on network errors)
  - Usage examples for each endpoint
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

@CodedMumu is attempting to deploy a commit to the David Dada's projects Team on Vercel.

A member of the Team first needs to authorize it.

@sshdopey

sshdopey commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution! ❤️ It looks like this PR isn't linked to an issue yet. Please add Fixes #123 (or Closes #123) to the PR description, or link it via the Development sidebar on the right. Once linked, I'll automatically re-review and merge if the changes show effort toward the issue. No stress — we'll help fix things up if needed!

@drips-wave

drips-wave Bot commented Sep 6, 2026

Copy link
Copy Markdown

@CodedMumu 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

@dadadave80
dadadave80 merged commit bfd08ec into Heliobond:main Sep 6, 2026
2 of 3 checks passed
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.

documentation: API integration guide missing — where to find endpoints, auth headers, rate limits

3 participants