Files
immich/mobile/lib/infrastructure
Alex e4443fa43e chore: dart http foreground upload (#24883)
* feat: bring back manual backup

* expose iCloud retrieval progress

* wip

* unify http upload method, check for connectivity on iOS

* handle LivePhotos progress

* feat: speed calculation

* wip

* better upload detail page

* handle error

* handle error

* pr feedback

* feat: share intent upload

* feat: manual upload

* feat: manual upload progress

* chore: styling

* refactor

* refactor

* remove unused logs

* fix: background android backup

* feat: add error section

* remove complete section

* remove empty state and prevent slot jumps

* more refactor

* fix: background test

* chore: add metadata to foreground upload

* fix: email and name get reset in auth provider

* pr feedback

* remove version check for metadata field in upload payload

* chore: fix unit test

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2026-01-15 20:10:08 -06:00
..

Infrastructure Layer

This directory contains the infrastructure layer of Immich. The infrastructure layer is responsible for the implementation details of the app. It includes data sources, APIs, and other external dependencies.

Structure

  • Entities: These are the classes that define the database schema for the domain models.
  • Repositories: These are the actual implementation of the domain interfaces. A single interface might have multiple implementations.
  • Utils: These are utility classes and functions specific to infrastructure implementations.
infrastructure/
├── entities/
│   └── user.entity.dart
├── repositories/
│   └── user.repository.dart
└── utils/
    └── database_utils.dart

Usage

The infrastructure layer provides concrete implementations of repository interfaces defined in the domain layer. These implementations are exposed through Riverpod providers in the root providers directory.

// In domain/services/user.service.dart
final userRepository = ref.watch(userRepositoryProvider);
final user = await userRepository.getUser(userId);

The domain layer should never directly instantiate repository implementations, but instead receive them through dependency injection.