API Standardization, Documentation Improvements, DX Enhancements & Ar…#445
Merged
Conversation
…chitecture Records
|
@Agbeleshe is attempting to deploy a commit to the vic's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Agbeleshe 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.
PR: API Standardization, Documentation Improvements, DX Enhancements & Architecture Records
Overview
This PR improves the Harvest Finance backend by enhancing API documentation, standardizing response structures, improving developer experience around database migrations, and introducing Architecture Decision Records (ADRs) to preserve key technical decisions.
Key Changes
1. Enhanced Swagger Documentation for Authentication Endpoints
@ApiOperationdecorators across all authentication endpoints.@ApiResponsedefinitions for success and error scenarios.@ApiBearerAuthwhere JWT authentication is required.Files Updated
backend/src/auth/auth.controller.ts2. Database Migration Management Scripts
Added convenient npm scripts to streamline database operations:
{ "db:migrate": "...", "db:rollback": "...", "db:reset": "...", "db:seed": "..." }These scripts wrap the TypeORM CLI configuration and eliminate the need for contributors to memorize migration commands.
Files Updated
backend/package.json3. Architecture Decision Records (ADRs)
Created ADR documentation structure to preserve important architectural decisions.
Added
Documented:
4. Global Response Interceptor
Implemented a NestJS
ResponseInterceptorthat standardizes all API responses into a consistent envelope:{ "data": {}, "meta": {} }Benefits:
Files Added
backend/src/common/interceptors/response.interceptor.tsFiles Updated
backend/src/main.tsExample Response Format
Before:
{ "id": 1, "email": "user@example.com" }After:
{ "data": { "id": 1, "email": "user@example.com" }, "meta": { "timestamp": "2026-06-03T00:00:00Z" } }Benefits
Testing
Related Issues
Closes #397
Closes #396
Closes #393
Closes #379