feat: add public user profiles

- Add GET /api/users/:username endpoint for public profiles
- Create PublicProfilePage component with user stats and info
- Add getUserByUsername function to API service
- Add /:username route to App.jsx
- Display user info: name, location, stats, WSDC ID, social links
- Only show public data (no email or sensitive information)
- Accessible only to authenticated users

Users can now view public profiles of other users by visiting
/<username>. The profile displays stats, location, WSDC ID, and
social media links.
This commit is contained in:
Radosław Gierwiało
2025-11-13 21:03:37 +01:00
parent 144b13a0cf
commit 897d6e61b3
4 changed files with 294 additions and 1 deletions

View File

@@ -160,6 +160,11 @@ export const authAPI = {
return data;
},
async getUserByUsername(username) {
const data = await fetchAPI(`/users/${username}`);
return data.data;
},
logout() {
localStorage.removeItem('token');
localStorage.removeItem('user');