Data Flow
This page describes how data moves through FOVEA during common operations using sequence diagrams.
Annotation Creation Flow
When a user creates an annotation, the data flows from the frontend through Redux to the backend and PostgreSQL.
Flow Steps:
- User draws bounding box in video player
- Frontend dispatches Redux action to add keyframe
- Redux interpolation engine generates frames between keyframes
- Frontend displays interpolated boxes in real-time
- User clicks Save button
- Frontend sends POST request to backend API
- Backend creates annotation via Prisma ORM
- Prisma inserts record into PostgreSQL
- Backend returns created annotation to frontend
- Frontend updates Redux state and shows success notification
Export Flow
Export generates JSON Lines files containing ontologies, world objects, and annotations.
Flow Steps:
- User clicks Export button in toolbar
- Frontend displays export options dialog
- User selects export mode (keyframes-only or fully interpolated)
- Frontend sends GET request to backend with options
- Backend queries annotations from database via Prisma
- For keyframes-only mode, backend extracts keyframes and interpolation configs
- Backend generates JSON Lines format (one object per line)
- Frontend receives file and triggers browser download
- User saves file to local filesystem
Export Optimization: Keyframes-only mode produces files 90% smaller than fully interpolated mode while preserving all annotation intent.
Import Flow with Conflict Resolution
Import validates JSON Lines files and resolves conflicts before persisting data.
Flow Steps:
- User drags JSON Lines file to import dialog
- Frontend sends preview request to backend
- Backend validates sequence structure (keyframes, interpolation, visibility)
- Backend checks for duplicate IDs in database
- Backend returns preview with conflict warnings
- User reviews conflicts and chooses resolution strategy
- Frontend sends import request with resolution options
- Backend applies conflict resolution (skip, replace, merge)
- Backend performs database upsert via Prisma
- Frontend displays import results (items imported, skipped, errors)
Conflict Types:
- Duplicate sequence IDs
- Overlapping frame ranges
- Invalid interpolation configurations
- Missing persona or video references
Object Detection and Tracking Flow
Object detection and tracking requests are forwarded directly to the model service.
Flow Steps:
- User clicks "Run Detection" button in detection dialog
- User optionally enables tracking in dialog options
- Frontend sends POST request to backend
/api/videos/:videoId/detect - Backend validates request and forwards to model service
- Model service runs detection (YOLO-World-v2, GroundingDINO, etc.)
- If tracking enabled, model service runs tracking (SAMURAI, SAM2.1, etc.)
- Model service returns bounding boxes with confidence scores
- Backend forwards results to frontend
- Frontend displays bounding boxes on video
- User reviews results and accepts as annotations or rejects
Available Models:
- Detection: YOLO-World-v2 (default), GroundingDINO 1.5, OWLv2, Florence-2
- Tracking: SAMURAI (default), SAM2Long, SAM2.1, YOLO11n-seg
Next Steps
- Understand the Annotation Workflow
- Learn about Exporting Data
- Learn about Importing Data
- Explore Observability for monitoring data flows