arch-atlas

Routes & Bindings

GetX routes · middleware

di

Overview

GetX route table + AuthBinding that lazy-puts the AuthController. AuthGuard middleware redirects unauthenticated users to /login on protected routes.

Screens

Home — signed inwireframe
success

Get.offAll(/home) after the token is cached — no back-stack to login.

User Flow

  1. App boots → GetMaterialApp reads AppPages.routes.
  2. /login, /register, /forgot are public — bound with AuthBinding.
  3. /home and below are gated by AuthGuard.middleware.
  4. Guard reads AuthController.user.value — null → redirect to /login.

Cases & Edge Cases

  • Deep link to a protected route while logged-out → guard saves intended path and replays after login.
  • Token expired during navigation → 401 from a protected call triggers Get.offAll('/login').

Code References

  • lib/core/routing/app_pages.dart
  • lib/core/routing/app_routes.dart
  • lib/features/auth/presentation/bindings/auth_binding.dart
  • lib/features/auth/presentation/middleware/auth_guard.dart

API Calls

Empty — fill this in later. Open the manifest and add content here.

Notes

Keep route names in AppRoutes constants — never hardcode strings inside screens.