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
Tracking Job Flow (BullMQ)
Automated tracking uses BullMQ job queue for long-running operations.
Flow Steps:
- User clicks "Run Tracking" button in detection dialog
- Frontend sends POST request to backend with tracking options
- Backend creates BullMQ job with video ID and model config
- BullMQ adds job to Redis queue
- Backend returns job ID to frontend (202 Accepted)
- Frontend polls job status every 2 seconds
- BullMQ worker picks job from Redis queue
- Worker calls model service
/track
endpoint - Model service runs tracking algorithm (e.g., ByteTrack, SAMURAI)
- Model service returns tracking results to worker
- Worker stores results and marks job complete
- Frontend receives results and displays tracking candidates
- User reviews and accepts/rejects tracks
Job Status Flow: pending → active → completed (or failed)
Next Steps
- Understand the Annotation Workflow
- Learn about Exporting Data
- Learn about Importing Data
- Explore Observability for monitoring data flows