Skip to content

Frontend: configure React Router, protected routes, and page structure #32

@Manak-hash

Description

@Manak-hash

Description

Set up the complete routing architecture for the app: all page routes, protected route wrapper, guest-only routes, and the 404 fallback. This is the navigation backbone of the entire frontend.

Tasks

  • Define all routes in App.tsx or a dedicated routes.tsx:
    • /LandingPage (guest only, redirect to dashboard if logged in)
    • /loginLoginPage (guest only)
    • /registerRegisterPage (guest only)
    • /exploreExploreProjectsPage (public)
    • /projects/:slugProjectDetailPage (public)
    • /projects/newProjectFormPage (auth required)
    • /projects/:slug/editProjectFormPage (auth required, owner only)
    • /dashboardDashboardPage (auth required)
    • /profileProfilePage (auth required)
    • /profile/:idPublicProfilePage (public)
    • /applicationsMyApplicationsPage (auth required)
    • /bookmarksBookmarksPage (auth required)
    • /notificationsNotificationsPage (auth required)
    • /adminAdminDashboardPage (admin only)
    • *NotFoundPage
  • Create ProtectedRoute.tsx — redirects unauthenticated users to /login
  • Create AdminRoute.tsx — redirects non-admin users to /dashboard
  • Create GuestRoute.tsx — redirects logged-in users away from /login and /register
  • Create NotFoundPage.tsx — clean 404 page with back to home button
  • Wrap all authenticated pages in AppLayout.tsx (with Navbar)
  • Wrap public pages in PublicLayout.tsx (minimal header)

Acceptance Criteria

  • All routes resolve to the correct page component
  • Unauthenticated users cannot access protected pages
  • Non-admins cannot access /admin
  • Logged-in users are redirected away from login/register
  • 404 page shows for unknown routes

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions