docs: add API_REFERENCE.md — developer reference for backend API client - #573
Merged
Merged
Conversation
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
|
@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. |
Contributor
|
Thanks for your contribution! ❤️ It looks like this PR isn't linked to an issue yet. Please add |
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 insrc/lib/api.ts.What was added
A 450-line markdown document covering:
NEXT_PUBLIC_API_URLtable with required/default/purpose columnsProject,ProjectWithDetail,Investment,PaginatedProjectsResponse,PricePoint) with field-by-field descriptionscreateInvestmentthrows on invalid input)NEXT_PUBLIC_API_URL-absent mode in detailEndpoints documented
getProjectsGET /projectsgetProjectsPaginatedGET /projects?page=&limit=getProjectGET /projects/:idcreateInvestmentPOST /investmentsgetPriceHistoryGET /projects/:id/price-historybiometricLoginWhat was tested
No runtime code was changed — documentation only. Verified the document renders correctly in markdown preview.
close #441