How yonko-sid/indelible works
Purpose and Entry Points
INDELIBLE is a cross-platform digital-rights forensics system: it watermark-protects creator media, verifies suspected copies, monitors for piracy, and drafts enforcement material. The user-facing client starts at lib/main.dart and composes the Flutter application in lib/src/app.dart. The service boundary is the FastAPI application in backend/main.py, deployed as a Dockerized Python service via backend/Dockerfile.
Client Application
Flutter targets Android, iOS, desktop, and web. Authentication and API access are isolated behind lib/src/services/auth_service.dart and lib/src/services/api_service.dart; Firebase configuration is generated in lib/firebase_options.dart. App screens expose the core workflows—protect, verify, archive/activity, dashboard, and settings—through lib/src/screens/protect_screen.dart, lib/src/screens/verify_screen.dart, and lib/src/screens/dashboard_screen.dart.
HTTP Workflow Boundary
backend/main.py owns multipart upload handling, user-scoped alert retrieval, suspect-URL scanning, and protected-file download endpoints. The Flutter client submits files and form data to this API rather than performing DSP locally. Processed media is retained and served from backend/outputs; metadata/registries are file-backed, including backend/creator_registry.json and backend/blockchain_registry.json.
Protection and Proof Pipeline
Protection orchestrates signed payload construction, robust watermark embedding, creator registration, and chain-of-custody recording. backend/core/payload.py creates creator-fingerprint/timestamp/HMAC payloads with Reed-Solomon recovery encoding. backend/core/watermark.py applies/extracts the image watermark through Y-channel Haar DWT, LL-band redundant QIM, and robust verification search. backend/core/core_engine.py is the likely coordination layer between media processing, registries, and verification results.
Media and Video Processing
The image watermark engine is the central forensic primitive in backend/core/watermark.py. Video support is separated in backend/core/video_processor.py, using FFmpeg to extract and reassemble frames, keeping video transport/encoding concerns outside the DSP algorithm. Output artifacts and .meta sidecars represent the protected-media delivery boundary under backend/outputs.
Detection, Monitoring, and Enforcement
Known protected works are indexed with perceptual hashes in a BK-tree (backend/core/bktree_index.py) to cheaply filter candidate matches before cryptographic extraction. The background watchdog in backend/core/monitoring_daemon.py invokes web acquisition in backend/core/scraper.py, then applies similarity and watermark proof stages. backend/core/ai_engine.py integrates Google Gemini 2.5 Flash for piracy analysis and DMCA draft generation; this requires a Gemini API key external to source control.
Identity, Storage, and Infrastructure
Firebase Auth supplies client identity; Firebase storage integration is represented by backend/storage/firebase.py, while backend/storage/file_manager.py handles local file operations. Creator fingerprints deterministically map Firebase UIDs to registry records. Blockchain anchoring is abstracted in backend/core/blockchain.py and persisted in backend/blockchain_registry.json; README identifies Polygon as the intended immutable anchor. Runtime dependencies include Python 3.10+, FastAPI/Uvicorn, OpenCV/PyWavelets/NumPy, FFmpeg, and Docker/Railway-compatible deployment.
Main entry points: core_engine.py Forensic coordinator · main.py FastAPI application · monitoring_daemon.py Monitoring daemon · protect_screen.dart Core workflows
Components 22
Flutter Client
- Flutter entry
lib/main.dart - App composition
lib/src/app.dart - Core workflows · Protect, verification, activity, and dashboard user flows.
lib/src/screens/protect_screen.dart - Auth service
lib/src/services/auth_service.dart - API service
lib/src/services/api_service.dart - Firebase config
lib/firebase_options.dart
Backend Service
- FastAPI application · Handles uploads, alerts, suspect URLs, and protected downloads.
backend/main.py
Forensics Pipeline
- Forensic coordinator
backend/core/core_engine.py - Signed payload · Builds recoverable creator, timestamp, and signature payloads.
backend/core/payload.py - Image watermark engine · Embeds, extracts, and robustly verifies image watermarks.
backend/core/watermark.py - Video processor
backend/core/video_processor.py - Monitoring daemon
backend/core/monitoring_daemon.py - Web acquisition
backend/core/scraper.py - Similarity index · Filters candidate works before cryptographic proof.
backend/core/bktree_index.py - Piracy analysis & DMCA · Analyzes piracy candidates and drafts enforcement material.
backend/core/ai_engine.py
Storage & Registries
- Protected artifacts · Delivery boundary for processed media and metadata.
backend/outputs - Creator & blockchain registries
backend/creator_registry.json - Blockchain anchor · Intended to anchor proof records on Polygon.
backend/core/blockchain.py - Firebase storage adapter
backend/storage/firebase.py - Local file manager
backend/storage/file_manager.py
Other components
- Firebase Auth
- Gemini 2.5 Flash · Requires an externally supplied Gemini API key.
Connections 24
- Flutter entry → App composition: starts
- App composition → Core workflows: renders
- Core workflows → Auth service: authenticates through
- Core workflows → API service: submits workflows
- Auth service → Firebase config: uses
- Auth service → Firebase Auth: authenticates with
- API service → FastAPI application: multipart and API requests
- FastAPI application → Forensic coordinator: protects and verifies
- Forensic coordinator → Signed payload: constructs proof payload
- Forensic coordinator → Image watermark engine: embeds or extracts
- Forensic coordinator → Video processor: processes video
- Video processor → Image watermark engine: watermarks frames
- Forensic coordinator → Protected artifacts: writes protected artifacts
- Forensic coordinator → Creator & blockchain registries: records creators and custody
- Forensic coordinator → Blockchain anchor: anchors proof
- Blockchain anchor → Creator & blockchain registries: persists anchor records
- FastAPI application → Monitoring daemon: accepts suspect scans
- Monitoring daemon → Web acquisition: acquires web media
- Monitoring daemon → Similarity index: filters candidates
- Similarity index → Image watermark engine: candidate proof extraction
- Monitoring daemon → Piracy analysis & DMCA: sends piracy evidence
- Piracy analysis & DMCA → Gemini 2.5 Flash: analyzes and drafts
- FastAPI application → Firebase storage adapter: uses remote storage
- FastAPI application → Local file manager: manages local files