How brian-aldana/sentinel_face_backend works
Sentinel Face is a Flask REST backend for biometric access control and administrative management. The main workflow receives recognition frames, checks active employee embeddings, runs active and passive liveness checks plus face matching, then records the access result and any security alert. Separate API branches manage login, employees, users, roles, logs, alerts, and audit history. The graph follows documented and indexed relationships; several controller-to-model links are supported by the SOURCE INDEX rather than fully sampled implementations.
Main entry points: db.py MariaDB connection pool · __init__.py API factory · routes Admin routes · log_controller.py Recognition and logs
Components 27
API and access
- App entry
app.py - API factory
api/__init__.py - Auth routes
api/routes/auth_ns.py - Employee routes
api/routes/employee_ns.py - Recognition route
api/routes/recognize_ns.py - Log routes
api/routes/log_ns.py - Admin routes
api/routes - Admin authorization
api/decorators.py
Biometric access
- Recognition and logs
api/controllers/log_controller.py - Face pipeline
face_logic.py - Blink detection
blink_detector.py - Passive liveness
liveness.py
Administration
- Authentication logic
api/controllers/auth_controller.py - Employee management
api/controllers/employee_controller.py - User management
api/controllers/usuario_controller.py - Role management
api/controllers/role_controller.py - Alert management
api/controllers/alert_controller.py - Audit queries
api/controllers/audit_controller.py
Persistence
- Employee records
api/models/employee.py - Access logs
api/models/log.py - Security alerts
api/models/alert.py - Audit records
api/models/audit.py - User records
api/models/usuario.py - Role records
api/models/role.py - MariaDB connection pool
db.py
Other components
- API client
- MariaDB
Connections 41
- API client → App entry: sends requests
README.md - App entry → API factory: creates app
app.py - API factory → Auth routes: registers
api/__init__.py - API factory → Employee routes: registers
api/__init__.py - API factory → Recognition route: registers
api/__init__.py - API factory → Log routes: registers
api/__init__.py - API factory → Admin routes: registers
api/__init__.py - Auth routes → Authentication logic: calls
api/routes/auth_ns.py - Employee routes → Employee management: calls
api/routes/employee_ns.py - Recognition route → Recognition and logs: calls
api/routes/recognize_ns.py - Log routes → Recognition and logs: calls
api/routes/log_ns.py - Admin routes → User management: routes to
api/routes/usuario_ns.py - Admin routes → Role management: routes to
api/routes/role_ns.py - Admin routes → Alert management: routes to
api/routes/alert_ns.py - Admin routes → Audit queries: routes to
api/routes/audit_ns.py - Employee routes → Admin authorization: uses
api/routes/employee_ns.py - Admin routes → Admin authorization: uses
api/routes/usuario_ns.py - Employee management → Face pipeline: generates embedding
api/controllers/employee_controller.py - Recognition and logs → Employee records: loads active embeddings
api/controllers/log_controller.py - Recognition and logs → Face pipeline: processes frames
api/controllers/log_controller.py - Recognition and logs → Access logs: writes access result
api/controllers/log_controller.py - Recognition and logs → Security alerts: creates security alert
api/controllers/log_controller.py - Face pipeline → Blink detection: checks blink sequence
face_logic.py - Face pipeline → Passive liveness: checks passive liveness
face_logic.py - Authentication logic → User records: authenticates users
api/controllers/auth_controller.py - User management → User records: manages users
api/controllers/usuario_controller.py - User management → Audit records: records actions
api/controllers/usuario_controller.py - Role management → Role records: manages roles
api/controllers/role_controller.py - Role management → Audit records: records actions
api/controllers/role_controller.py - Employee management → Employee records: manages employees
api/controllers/employee_controller.py - Employee management → Audit records: records actions
api/controllers/employee_controller.py - Alert management → Security alerts: manages alerts
api/controllers/alert_controller.py - Alert management → Audit records: records actions
api/controllers/alert_controller.py - Audit queries → Audit records: queries audit
api/controllers/audit_controller.py - Employee records → MariaDB connection pool: gets connection
api/models/employee.py - Access logs → MariaDB connection pool: gets connection
api/models/log.py - Security alerts → MariaDB connection pool: gets connection
api/models/alert.py - Audit records → MariaDB connection pool: gets connection
api/models/audit.py - User records → MariaDB connection pool: gets connection
api/models/usuario.py - Role records → MariaDB connection pool: gets connection
api/models/role.py - MariaDB connection pool → MariaDB: opens pooled connections
db.py