FaceGuard exposes two interfaces. As of MVP v1, the Web Admin UI replaces the CLI design documented in earlier sprints.
| Interface | Type | User | Status in MVP v1 |
|---|---|---|---|
| Live Display | Web (MJPEG + SSE) | Employees, guests | Implemented |
| Admin Web UI | Web (HTML + HTMX) | System administrators | Implemented (MVP v1) |
| Replaced by Web Admin |
The CLI design (register, remove, list, add-guest, logs, status,
threshold) has been superseded by the web admin — every CLI action now
has an equivalent page (see mapping table below).
The live camera feed and verdict overlay shown to anyone standing in front of the door. The same MJPEG stream is also embedded in the admin dashboard so the admin can see what the camera sees from their laptop.
URL (admin view): / (dashboard, requires login)
The verdict overlay reflects the current state of the recognition loop.
Waiting for face...┌─────────────────────┐
│ [Camera feed] │
│ │
│ │
└─────────────────────┘
Waiting for face...
(grey)
Scanning...RECOGNITION_INTERVAL_MS).Access granted: {Name}{access_type} · score {score:.3f}SERVO_OPEN_DURATION_SEC, then
returns. On x86 (no GPIO), the servo state is reflected in the status
panel as “Triggered (open)”.┌─────────────────────┐
│ [Camera feed] │
│ ┌─────────┐ │
│ │ face │ │
│ └─────────┘ │
│ Access granted: │
│ Ivanov Petr │
│ user · 0.821 │
└─────────────────────┘
(green)
Access denied: Unknownscore {best:.3f}success=false).┌─────────────────────┐
│ [Camera feed] │
│ ┌─────────┐ │
│ │ face │ │
│ └─────────┘ │
│ Access denied: │
│ Unknown │
│ score 0.312 │
└─────────────────────┘
(red)
System errorML service unreachable)ML service: Offline.Accessible from any device on the same LAN as the Raspberry Pi.
URL: http://<pi-ip>:8000/
/login.ADMIN_USERNAME / ADMIN_PASSWORD).admins table).faceguard_session), 12h expiry.//status/events) — no polling./usersLists permanent users and active (non-expired) guests with delete/revoke
buttons. Each row shows ID, name, and either created_at (users) or
expires_at (guests).
Expired guests are auto-purged inside the recognition loop — no manual
cleanup needed, but a Purge expired button is available for forced cleanup.
/registerThe admin-side counterpart of US-02.
Steps:
Surname Firstname) — unique among permanent users.Permanent — never expires.Temporary — additional field Valid for (days) appears (HTMX swap).REGISTRATION_FRAME_COUNT (default 5) frames from
the ML service at REGISTRATION_FRAME_INTERVAL_MS intervals. For each
frame the biggest detected face’s embedding is taken.users row (permanent) or a guests row
(temporary, with expires_at = now + N days).Failure modes shown to the admin:
User '<name>' already exists.No face detected on frame N/5.ML service error on frame N: .../logsAudit log (US-10). Each row records:
| Field | Source |
|---|---|
| timestamp | when the attempt happened |
| name | matched name, or Unknown |
| access_type | user / guest / unknown |
| score | cosine similarity, 0..1 |
| success | true if access was granted |
Filters:
Ivan matches Ivanov).The recognition threshold is read from env at startup (THRESHOLD).
A runtime-adjustable threshold UI is planned for v2; for MVP v1 the
threshold is configured via .env / Docker env.
The CLI commands documented in earlier sprints have the following web equivalents in MVP v1:
| Old CLI command | Web admin equivalent |
|---|---|
register <name> |
/register form (permanent access) |
add-guest <name> --hours N |
/register form (temporary access, days) |
remove <name> |
Delete button on /users |
list |
/users page |
logs [--today] [--user X] |
/logs page (same filters) |
status |
Dashboard right panel (/) |
threshold <value> |
.env: THRESHOLD (runtime UI planned v2) |
| Aspect | Live Display | Admin Web UI |
|---|---|---|
| User | Employee, guest | System admin |
| Input | None (passive) | Forms, buttons (HTMX) |
| Output | MJPEG + verdict overlay | HTML pages, SSE updates |
| Location | Pi + camera | Any LAN device, browser |
| Authentication | Biometric (face) | Username + password (session) |
| Latency | Real-time (≤ 500ms tick) | On-demand |
| MVP v1 | ✓ | ✓ |
SERVO_MODE=gpio): backend drives the servo via
gpiozero.AngularServo on SERVO_PIN. On access granted, the servo
rotates to 90° for SERVO_OPEN_DURATION_SEC, then returns to 0°.SERVO_MODE=emulated): no hardware. The status panel
on the dashboard shows Servo: Triggered (open) for the same duration,
replicating the timing of the physical actuator.Customer-requested LED feedback (green=granted, red=denied, yellow=scanning) is documented but not yet wired in MVP v1. The verdict overlay colour scheme mirrors the planned LED colours so the visual feedback contract is already stable.
All admin endpoints require a valid session cookie. See README.md for
the full HTTP method / path table.