RoutingLogic - IEEE-Team-3/map GitHub Wiki

# Routing Logic 🔁

Routing is handled using react-router-dom (or next/navigation if using Next.js App Router). It supports:

  • Lazy-loaded routes
  • Protected routes
  • Role-based guards
  • Nested layout routing

Route Groups

  1. Public Routes

    • /login, /signup, /reset-password
    • Accessible without auth
  2. Protected Routes

    • Wrapped with AuthGuard
    • Redirect to /login if not authenticated
  3. Role-Based Routes

    • Certain pages require Admin/Owner roles (e.g., /admin, /settings)

Dynamic Routes

  • /teams/:id/*
    Used for accessing dynamic team pages, where :id is the team UUID.

Navigation

  • Navigation links are based on current role and team permissions.
  • Active routes highlight on sidebar.
  • Smooth transitions using Framer Motion.

Route Example

<Route path="/teams/:id" element={<TeamLayout />}>
  <Route path="chat" element={<TeamChat />} />
  <Route path="tasks" element={<TaskBoard />} />
</Route>
⚠️ **GitHub.com Fallback** ⚠️