Skip to content

feat: replace numeric user ID in shareable profile URL with name slug #899

@Sachinchaurasiya360

Description

@Sachinchaurasiya360

Feature Request / Bug

Route: /student/profile/public/:id
Example URL: https://www.internhack.xyz/student/profile/public/1

Problem

The shareable profile URL currently uses the numeric user ID (e.g. /public/1). This is:

  • Not user-friendly or shareable in a professional context
  • Exposes internal database IDs
  • Hard to remember or share verbally

Proposed Solution

Replace the numeric ID in the URL with a URL-safe version of the user's name or a unique username slug.

Option A — Name slug (e.g. /public/sachin-chaurasiya):

  • Generate a URL-safe slug from user.name (lowercase, spaces to hyphens)
  • Add a profileSlug field to the user table with a unique index
  • Fall back to name-id (e.g. sachin-chaurasiya-42) if the name slug is already taken

Option B — Username field:

  • Add a username field that students can set manually from their profile settings
  • Validate uniqueness and URL safety on save

Acceptance Criteria

  • The shareable URL shows a human-readable identifier instead of a numeric ID
  • Old numeric-ID URLs either redirect to the new slug URL or continue to work
  • The copy URL button in StudentProfilePage.tsx generates the slug-based URL
  • Profile slug is unique across all users

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions