Skip to main content

Admin Routes

🎯 Overview​

Each admin route follows: URL β†’ Validators β†’ Handler β†’ State Update


πŸ” Authentication Routes​

Accept Invitation​

🌐 URL: /auth/accept-invitation/:invitationId/:token
πŸ“„ Current Page: accept_invitation

πŸ”§ Handler: handleAcceptInvitation

  • Processes invitation tokens from URL parameters
  • Validates invitation ID and token
  • Accepts organization invitations

βœ… Validators: None (public route)


Login​

🌐 URL: /login
πŸ“„ Current Page: login

πŸ”§ Handler: handleAuthLoginRoute

  • Captures intended URL from query parameters
  • Sets up login form state
  • Handles post-login redirects

βœ… Validators: isUserNotLoggedIn

  • Redirects already authenticated users away from login

Logout​

🌐 URL: /logout
πŸ“„ Current Page: logout

πŸ”§ Handler: handleAuthLogoutRoute

  • Clears user session and authentication data
  • Invalidates auth tokens
  • Redirects to login page

βœ… Validators: None


🏠 Dashboard Routes​

Home Dashboard​

🌐 URL: /home
πŸ“„ Current Page: home

πŸ”§ Handler: handleHomeRoute

  • Loads dashboard overview data
  • Fetches recent products, categories, and attributes
  • Displays admin dashboard with key metrics

βœ… Validators: isUserNotLoggedIn

  • Ensures only authenticated users access dashboard

πŸ‘₯ User Management Routes​

Users List​

🌐 URL: /users
πŸ“„ Current Page: users_list

πŸ”§ Handler: handleUsersListRoute

  • Fetches paginated list of all users
  • Supports search by name/email
  • Loads user pagination data

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

User Details​

🌐 URL: /users/:userId
πŸ“„ Current Page: user_show

πŸ”§ Handler: handleUserByIdRoute

  • Loads specific user profile details
  • Fetches associated categories and attributes
  • Displays comprehensive user information

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

Members List​

🌐 URL: /members
πŸ“„ Current Page: members_list

πŸ”§ Handler: handleMembersListForAdminRoute

  • Lists organization members across all organizations
  • Provides admin-level member management
  • Loads member pagination data

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

🏒 Organization Management Routes​

Organizations List​

🌐 URL: /organizations
πŸ“„ Current Page: organization_list

πŸ”§ Handler: handleOrganizationListRoute

  • Fetches all organizations with pagination
  • Orders by creation date (newest first)
  • Displays organization overview data

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

Organization Details​

🌐 URL: /organizations/:orgId
πŸ“„ Current Page: organization_show_admin

πŸ”§ Handler: handleSingleOrganizationAdminRoute

  • Loads detailed organization information
  • Provides admin view of organization data
  • Enables organization management actions

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

Organization Applications List​

🌐 URL: /applications
πŸ“„ Current Page: organization_applications_list

πŸ”§ Handler: handleOrganizationApplicationsListRoute

  • Lists organization applications with status filtering
  • Supports filtering by review status (waiting_for_review, all, etc.)
  • Loads application pagination data

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

Organization Application Details​

🌐 URL: /applications/:applicationId
πŸ“„ Current Page: organization_application_show_admin

πŸ”§ Handler: handleSingleOrganizationApplicationAdminRoute

  • Shows detailed view of organization application
  • Enables admin review and approval actions
  • Loads application-specific data

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

βš™οΈ Settings Routes​

Main Settings​

🌐 URL: /settings
πŸ“„ Current Page: user_settings

πŸ”§ Handler: handleSettingsRoute

  • Loads current user settings data
  • Displays user profile information
  • Provides access to setting modification options

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

Change Email​

🌐 URL: /settings/change-email
πŸ“„ Current Page: change_email_settings

πŸ”§ Handler: handleSettingsChangeEmailRoute

  • Loads email change form
  • Handles email update requests
  • Initiates email verification process

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

Change Name​

🌐 URL: /settings/change-name
πŸ“„ Current Page: change_name_settings

πŸ”§ Handler: handleSettingsChangeNameRoute

  • Provides name update functionality
  • Loads current user name data
  • Handles name change submissions

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

Change Password​

🌐 URL: /settings/change-password
πŸ“„ Current Page: change_password_settings

πŸ”§ Handler: handleSettingsChangePasswordRoute

  • Provides secure password update form
  • Validates current password
  • Handles new password submission

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

Change Phone Number​

🌐 URL: /settings/change-phone-number
πŸ“„ Current Page: change_phone_number_settings

πŸ”§ Handler: handleSettingsChangePhoneNumberRoute

  • Enables phone number updates
  • Validates phone number format
  • Updates user contact information

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

Verify Email Change​

🌐 URL: /settings/verify-change-email-success/:verifyChangeEmailToken
πŸ“„ Current Page: verify_change_email_success

πŸ”§ Handler: handleSettingsVerifyChangeEmailSuccessRoute

  • Processes email verification tokens
  • Confirms email address changes
  • Updates user email verification status

βœ… Validators:

  • isUserLoggedIn - Validates authentication
  • updateLoggedInUser - Refreshes current user data

πŸ”‘ Password Reset Routes​

Request Password Reset​

🌐 URL: /reset-password-request
πŸ“„ Current Page: reset_password_request

πŸ”§ Handler: handleResetPasswordRequestRoute

  • Provides password reset request form
  • Initiates password reset email
  • Sets up reset token generation

βœ… Validators: None (public route)


Submit New Password​

🌐 URL: /reset-password-submit/:resetPasswordToken
πŸ“„ Current Page: reset_password_submit

πŸ”§ Handler: handleResetPasswordSubmitRoute

  • Validates reset tokens from URL
  • Provides new password submission form
  • Processes password reset completion

βœ… Validators: scrollTo (scroll to top)


Password Reset Success​

🌐 URL: /reset-password-success
πŸ“„ Current Page: reset_password_success

πŸ”§ Handler: handleResetPasswordSuccessRoute

  • Displays password reset confirmation
  • Provides login redirect options
  • Clears reset tokens

βœ… Validators: scrollTo (scroll to top)


πŸ”§ Validator Functions Reference​

ValidatorPurpose
isUserLoggedInβœ… Validates authentication, redirects to login if needed
isUserNotLoggedInβ†ͺ️ Redirects authenticated users from login/signup pages
updateLoggedInUserπŸ”„ Refreshes current user data from API
scrollTo⬆️ Scrolls page to top on route navigation

🎨 Route Flow Pattern​

🌐 URL Request β†’ βœ… Validators β†’ πŸ”§ Handler β†’ πŸ“Š State Update β†’ 🎯 Page Render

Every admin route follows this consistent pattern for reliability and maintainability.