feat(notify-bridge): phase 2 - core abstractions

Define the generic provider/event/variable system:
- ServiceProvider ABC with connect, disconnect, poll, list_collections
- ServiceProviderType enum (IMMICH first)
- EventType enum (assets_added/removed, collection_renamed/deleted, sharing_changed)
- MediaAsset, MediaCollection, CollectionState dataclasses
- TemplateVariableDefinition and VariableRegistry with 11 base variables
- All models use extra: dict for provider-specific data passthrough

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 22:33:11 +03:00
parent b724447f4d
commit 3ed0d8ce88
9 changed files with 378 additions and 0 deletions
+8
View File
@@ -29,3 +29,11 @@ PID=$(netstat -ano 2>/dev/null | grep ':5173.*LISTENING' | awk '{print $5}' | he
- **System-owned entities**: `user_id=0` means system-owned (e.g. default templates).
- **FastAPI route ordering**: Static path routes MUST be registered BEFORE parameterized routes.
- **`__pycache__`**: Add to `.gitignore`. Never commit.
## Project Structure (Phase 1)
- **packages/core** (`notify_bridge_core`): Shared library — providers, models, notifications, templates. No DB dependency.
- **packages/server** (`notify_bridge_server`): FastAPI REST API + SQLite. Depends on core.
- **frontend**: SvelteKit 2 + Svelte 5 + Tailwind CSS v4. Static adapter with SPA fallback. Dev proxy to :8420.
- **Environment vars**: `NOTIFY_BRIDGE_DATA_DIR`, `NOTIFY_BRIDGE_SECRET_KEY`, `NOTIFY_BRIDGE_DATABASE_URL`
- Core package includes `jinja2` dependency (template rendering lives in core, not server).