Skip to content

backend: use structured response modeling in public profile endpoint#69

Open
Harxhit wants to merge 1 commit into
Dev-Card:mainfrom
Harxhit:public-response
Open

backend: use structured response modeling in public profile endpoint#69
Harxhit wants to merge 1 commit into
Dev-Card:mainfrom
Harxhit:public-response

Conversation

@Harxhit
Copy link
Copy Markdown

@Harxhit Harxhit commented May 10, 2026

Summary

Added dedicated TypeScript interfaces for all public profile and card responses in apps/backend/src/routes/public.ts. This provides full compile-time type safety and encourages consistent API contracts across the public endpoints.

Closes #21


Type of Change

  • Refactor (no functional change)
  • Documentation

What Changed

  • Created four new type interfaces in public.ts:
    • PublicProfileLink
    • UsernamePublicProfileResponse
    • CardPublicProfileResponse
    • UsernameCardPublicProfileResponse
  • Updated the three public routes to return properly typed response objects:
    • GET /:username (public profile)
    • GET /card/:cardId (direct shared card)
    • GET /:username/card/:cardId (username + card view)
  • Added/improved JSDoc comments with clear API documentation for all three endpoints.

No functional changes — only improved type safety and documentation.


Checklist

  • My code follows the project's coding style (pnpm -r run lint passes).
  • TypeScript compiles without errors (pnpm -r run typecheck).
  • I have added or updated tests for the changes I made.
  • All tests pass locally (pnpm -r run test).
  • I have updated documentation where necessary.
  • No new console.log or debug statements left in the code.
  • Breaking changes are documented in this PR description.

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.

backend: use structured response modeling in public profile endpoint

1 participant