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

@@ -11,6 +11,7 @@ import MatchChatPage from './pages/MatchChatPage';
import RatePartnerPage from './pages/RatePartnerPage';
import HistoryPage from './pages/HistoryPage';
import ProfilePage from './pages/ProfilePage';
import PublicProfilePage from './pages/PublicProfilePage';
import VerificationBanner from './components/common/VerificationBanner';
// Protected Route Component with Verification Banner
@@ -132,9 +133,18 @@ function App() {
}
/>
{/* Public Profile - must be before default redirect */}
<Route
path="/:username"
element={
<ProtectedRoute>
<PublicProfilePage />
</ProtectedRoute>
}
/>
{/* Default redirect */}
<Route path="/" element={<Navigate to="/events" replace />} />
<Route path="*" element={<Navigate to="/events" replace />} />
</Routes>
</AuthProvider>
</BrowserRouter>