Skip to content

Latest commit

Β 

History

History
86 lines (71 loc) Β· 3.17 KB

Architecture.md

File metadata and controls

86 lines (71 loc) Β· 3.17 KB

The architecture used in this project is GetX Architecture, which organizes the codebase into three core layers:

How GetX Architecture Works

Each module in the project follows a consistent three-layer structure:

Bindings: Handles dependency injection. Each screen has a binding class that registers its controller before the view is loaded, ensuring everything is available when needed.

Controllers: The brain of each screen. Controllers manage state, business logic, and interactions with services. They extend GetxController and expose reactive variables that the view observes.

Views: Pure UI. Views observe the controller's state and rebuild only when relevant data changes. They contain no business logic.

Every module under lib/app/modules/ follows this pattern:

module_name/
β”œβ”€β”€ bindings/    # Dependency injection
β”œβ”€β”€ controllers/ # State & business logic
└── views/       # UI widgets

Key Rules

  • Views should never directly call services; always go through the controller.
  • Views should contain zero business logic; only render what the controller exposes.
  • Controllers should not depend on other controllers.
  • Controllers may be reused across views if they share the same functionality.
  • Services are globally accessible and shared across all controllers.

Architecture Diagram

GetX Architecture

Since services are global, a multi-screen app shares them while each screen gets its own controller and view:

Multi-screen structure

Project Structure

lib/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ modules/
β”‚   β”‚   β”œβ”€β”€ about/
β”‚   β”‚   β”œβ”€β”€ detailRoute/
β”‚   β”‚   β”œβ”€β”€ home/
β”‚   β”‚   β”œβ”€β”€ logs/
β”‚   β”‚   β”œβ”€β”€ manageTaskServer/
β”‚   β”‚   β”œβ”€β”€ manage_task_champion_creds/
β”‚   β”‚   β”œβ”€β”€ onboarding/
β”‚   β”‚   β”œβ”€β”€ permission/
β”‚   β”‚   β”œβ”€β”€ profile/
β”‚   β”‚   β”œβ”€β”€ reports/
β”‚   β”‚   β”œβ”€β”€ settings/
β”‚   β”‚   β”œβ”€β”€ splash/
β”‚   β”‚   └── taskc_details/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ tour/
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ add_task_dialogue/
β”‚   β”‚   β”œβ”€β”€ app_settings/
β”‚   β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   β”œβ”€β”€ debug_logger/
β”‚   β”‚   β”œβ”€β”€ gen/
β”‚   β”‚   β”œβ”€β”€ home_path/
β”‚   β”‚   β”œβ”€β”€ language/
β”‚   β”‚   β”œβ”€β”€ permissions/
β”‚   β”‚   β”œβ”€β”€ taskc/
β”‚   β”‚   β”œβ”€β”€ taskchampion/
β”‚   β”‚   β”œβ”€β”€ taskfunctions/
β”‚   β”‚   β”œβ”€β”€ taskserver/
β”‚   β”‚   └── themes/
β”‚   └── v3/
β”‚       β”œβ”€β”€ champion/
β”‚       β”œβ”€β”€ db/
β”‚       β”œβ”€β”€ models/
β”‚       └── net/
β”œβ”€β”€ rust_bridge/
└── main.dart

Resources