Architecture
Openza Tasks follows Clean Architecture principles with a clear separation of concerns.
Project Structure
lib/├── app/ # Application setup│ ├── app.dart # Root widget│ ├── app_router.dart # Navigation (GoRouter)│ └── app_theme.dart # Material theme│├── core/ # Shared utilities│ ├── constants/ # App-wide constants│ ├── errors/ # Error handling│ ├── services/ # Core services│ └── utils/ # Utilities│├── data/ # Data layer│ ├── datasources/│ │ ├── local/ # SQLite (Drift)│ │ └── remote/ # API clients│ ├── models/ # Data transfer objects│ ├── repositories/ # Repository implementations│ ├── services/ # Data services│ └── sync/ # Rust FFI bridge│ ├── sync_engine.dart│ └── sync_ffi.dart│├── domain/ # Business logic│ ├── entities/ # Domain entities (Freezed)│ ├── repositories/ # Repository interfaces│ └── usecases/ # Business logic│├── presentation/ # UI layer│ ├── providers/ # Riverpod providers│ ├── screens/ # UI screens│ └── widgets/ # Reusable components│├── services/ # Application services│ ├── auth/ # Authentication services│ └── token/ # Token management│└── main.dart # Entry point
rust/ # Rust sync engine├── src/│ ├── api.rs # Todoist API client│ ├── db/ # SQLite repository│ ├── domain/ # Models and errors│ ├── ffi.rs # FFI exports│ ├── lib.rs # Crate entry│ └── sync/ # Sync engine logic└── Cargo.tomlKey Technologies
| Layer | Technology |
|---|---|
| State Management | Riverpod 3 |
| Navigation | GoRouter |
| Database | Drift (SQLite) |
| Sync Engine | Rust + FFI |
| HTTP Client | Dio (Dart), reqwest (Rust) |
| Code Generation | Freezed, Riverpod Generator |
| Secure Storage | flutter_secure_storage |
Data Flow
UI (Screens) → Providers → Use Cases → Repositories → Data Sources- UI triggers actions through Riverpod providers
- Providers call use cases for business logic
- Use Cases orchestrate repository calls
- Repositories abstract data source access
- Data Sources handle API calls and local storage