Skip to content

feat(backend+frontend): add username-based public profile lookup endpoint and public learner profile page #283

Description

@portableDD

Description

GET /api/v1/users/:id/public requires a UUID that users do not know. The leaderboard shows usernames — clicking them should navigate to a public profile page. This issue adds username-based lookup on the backend and a public learner profile page on the frontend.

Background

  • UsersService.getPublicProfile(id) takes UUID — no username-based lookup exists
  • No GET /api/v1/users/by-username/:username endpoint
  • Leaderboard usernames need to link to /learners/{username}

Implementation Guide

Backend: add GET /api/v1/users/by-username/:username with case-insensitive username lookup. Return { id, username, xp, badgesCount, coursesCompleted, avatarUrl, bio } — never email or walletAddress. Return 404 for non-existent username. Add Swagger decorators.

Frontend: create frontend/app/learners/[username]/page.tsx showing avatar, username, XP bar, badge count, courses completed, and earned badges grid. Wire to the new endpoint.

Update the leaderboard table (Issue 39) to link each username to /learners/{username}.

Acceptance Criteria

  • GET /api/v1/users/by-username/:username returns public profile without PII
  • Case-insensitive username lookup
  • Returns 404 for non-existent username
  • Response never exposes email or wallet address
  • /learners/[username] renders public profile page
  • Leaderboard usernames link to profile page
  • Swagger decorators on the new backend endpoint

Complexity: High - 200 points
Join: https://t.me/ByteChainAcademy | Contact: contact@nexacore.org

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions