Onboarding Guide: treetracker-android

Generated from the Understand-Anything knowledge graph. Source commit 949d962.

Project Overview

Treetracker Android is Greenstand's native Android app for the Treetracker reforestation platform. Growers register tree captures (photos and GPS), manage grower accounts and wallets, and sync captured data to the Greenstand backend. The app works offline first: captures live in a local Room database and upload in the background when a connection is available.

The app follows a layered MVVM flow: Compose screen → ViewModel → use case → repository/DAO → Room / API / S3, with WorkManager driving background sync and Koin wiring everything together.

Architecture Layers

Key Concepts

Guided Tour

Follow these steps in order to learn the codebase end to end:

  1. Project Overview: Read the README and docs/engineering/architecture.md for what the app does and how it is structured.
  2. Application Entry Point: TreeTrackerApplication.kt boots the process: Firebase, Koin DI, and Timber logging.
  3. Dependency Injection Graph: di/AppModule.kt wires every repository, use case, manager, and ViewModel (highest fan-out file).
  4. Navigation Host: Host.kt wires every screen destination into the Compose NavDisplay, where ViewModels meet screens.
  5. MVVM Foundation: BaseViewModel.kt, Action.kt, and CustomTheme.kt define the presentation contract every screen follows.
  6. Feature Screens and ViewModels: DashboardScreen/DashboardViewModel, TreeCaptureScreen/TreeCaptureViewModel, and SignupViewModel apply the MVVM foundation to real features (camera, GPS gating, feature flags).
  7. Domain Use Cases: SyncDataUseCase orchestrates upload; CreateTreeRequestUseCase, UploadImageUseCase, UploadLocationDataUseCase are single-purpose steps.
  8. Data and Persistence: AppDatabase, TreeTrackerDAO, TreeEntity, User, and Preferences hold captures on the device.
  9. API and Object Storage: ObjectStorageClient (AWS S3 → DigitalOcean Spaces), UploadBundle, and NewTreeRequest move data off the device.
  10. Background Sync: TreeSyncWorker (WorkManager) invokes SyncDataUseCase; SyncNotificationManager and TreeUploader support it.
  11. Testing Infrastructure: MainCoroutineRule, FakeFileGenerator, and SessionUploaderTest show the coroutine-driven test approach.
  12. Build and CI/CD: app/build.gradle, gradle/libs.versions.toml, and the build.yml / test.yml / deploy-play-store.yml workflows build and ship the app.

File Map (by layer)

Complexity Hotspots

Approach these areas carefully: they carry the most logic or the largest surface (53 files rated complex, 180 moderate):


Regenerate with /understand then /understand-domain then /understand-onboard.