Architecture and SDK
Brokerr uses an internal plugin architecture. A production provider is a direct subfolder of either:
backend/app/sync_v2/sources/<source_type>/backend/app/sync_v2/targets/<target_type>/The folder exports one create_plugin() factory from plugin.py. Discovery
imports direct subfolders, validates their contracts, rejects duplicates, and
sorts plugins by stable provider type. There is no core provider registry to edit.
The current SDK version is 5. Providers live in the Brokerr repository; pip packages and Python entry-point discovery are not implemented.
Dependency boundary
Section titled “Dependency boundary”A provider may import:
- its own package;
app.sync_v2.sdkand its public submodules;- ordinary third-party libraries already available to Brokerr.
A provider must not import the database, FastAPI routes, engine services, another concrete provider, or internal storage models. Context objects provide HTTP, logging, credentials, cancellation, progress, identity, auth gateway, and mapping services without exposing their implementation.
This boundary has two consequences:
- Adding a source or target does not add provider branches to the engine or UI.
- A future source such as Jellyfin can feed an existing target without changing that target, provided it emits the canonical observations and capabilities the target features require.
Data flow
Section titled “Data flow”source runtime -> SourceItem observations -> source filters and enrichments -> target map_items() -> target read_items() -> deterministic feature planners -> persisted TargetOperation values -> target write_items() / revert_items()Source items are provider-neutral and JSON-safe. Standard observations use
fields such as watchlist, rating, playback_status, progress, total, and
in_continue_watching. Provider-only data belongs under a namespaced extension
key such as example.metadata.
Targets own mapping, remote snapshots, request construction, reconciliation, and safe revert behavior. Features plan operations without network access. The engine owns paging, conflicts, dry-run, persistence, cancellation, lifecycle, and confirmed state.
Provider development path
Section titled “Provider development path”- Define the manifest, capabilities, media, auth modes, resources, and instance schema.
- Implement the required runtime methods.
- Add deterministic source filters or target features only where needed.
- Export
create_plugin(). - Add unit tests for manifest/schema validation and runtime behavior.
- Add discovery and architecture tests proving the folder is found without core edits.
- Add profile-resolution, dry-run/live, partial failure, Apply, and Revert tests.
- Document provider defaults, pacing, mapping, safety, and reversibility.
Continue with Manifests and contracts, Add a source, or Add a target.