Skip to content

πŸ”‘ Add Username Support for UsersΒ #29

@sensasi-delight

Description

@sensasi-delight

Currently, users are identified only by their account information (e.g., email).
To improve personalization and discovery, we will add unique usernames that can be displayed on profiles, posts, comments, and leaderboards.


βœ… Tasks

  • Database & Schema

    • Update User model in Prisma to include username field (unique, indexed).
    • Run Prisma migration for the new field.
    • Add validation (only alphanumeric + underscore, 3–20 chars).
  • Authentication & Registration

    • Update signup flow to include username input.
    • Ensure username uniqueness is enforced at registration.
    • Add fallback username generator for OAuth (Google/GitHub).
  • Profile & Settings

    • Display username on profile, posts, comments, and leaderboard.
    • Add option to update username in Profile Settings (with restrictions, e.g., max 1 change per 30 days).
    • Add friendly error messages for duplicate or invalid usernames.
  • Routing & SEO

    • Update profile URLs to use /@username format.
    • Redirect old profile URLs (if any) to the new format.
  • Testing

    • Add unit tests for username validation.
    • Add integration tests for signup and profile update flow.
    • Test OAuth signup with auto-generated username.

🎯 Acceptance Criteria

  • Users can choose a unique username during signup.
  • Usernames are displayed consistently across the platform.
  • Profile URLs follow the /@username format.
  • Validation and uniqueness checks work reliably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    πŸ”‘ USER & AUTHUser accounts, authentication (email & OAuth), profiles, and account security.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions