Status: Accepted
Date: 2026-07-02
Quality requirements addressed: QR-001
FaceGuardV2 needs camera access, face detection, embedding extraction, recognition decisions, persistence, web UI, authentication, and door-control behavior. Combining all of this in one process would make the backend depend directly on camera and ML libraries and would make local development harder.
Keep the backend and ML responsibilities separated.
The ML service owns camera access, frame processing, face detection, and embedding extraction. The FastAPI backend owns admin UI, authentication, comparison against stored embeddings, access decisions, audit logging, status publishing, and servo control.
The backend communicates with the ML service through HTTP endpoints such as /ml/latest and /ml/stream.
Positive consequences:
Tradeoffs:
| View | Rendered diagram | Source artifact |
|---|---|---|
| Static view | component-diagram.png | component-diagram.puml |
| Dynamic view | register-new-person-sequence.png | register-new-person-sequence.puml |
| Deployment view | deployment-diagram.png | deployment-diagram.puml |
This ADR is visible in all three views: the static view shows the backend and ML service as separate components, the dynamic view shows backend-to-ML calls during registration, and the deployment view shows the services as separate runtime containers.