All work

02 · Application layer · Full-stack ML system

Attendance Tracker

Recognition that knows whose data it is.

Kiosks and cameras mark attendance by recognizing registered faces, with liveness checks and strict isolation between organizations.

Role
Independent full-stack and ML development
Stack
FastAPI · PostgreSQL · Redis · ONNX Runtime · React · TypeScript
Status
Open source
Layer
02 — Application

01 · Context

The question behind the build.

Face recognition attendance is easy to demo and hard to trust. It has to reject photos and replays, keep each organization's people separate, and stay operable after launch.

Objective

Build a full-stack system around a pretrained recognition model: enrollment, matching, liveness, tenancy, authentication and an admin dashboard, with the operational tooling to run it.

Approach

A FastAPI service with async SQLAlchemy on PostgreSQL, Redis and Celery workers, and a FaceNet model exported to ONNX for 512-dimensional embeddings. A React and TypeScript dashboard shows a live event feed.

02 · Architecture

How it fits together.

  1. 01Camera frame
  2. 02Detection, quality and liveness
  3. 03ONNX embedding (512-d)
  4. 04Per-organization cosine match
Recognition flow as documented: MTCNN detection, liveness checks, ONNX embedding, then matching against the caller's organization index only.

03 · Decisions

The choices that matter.

  1. 01

    Tenancy everywhere

    Every query and every match index is scoped by organization; cross-organization access returns 404.

  2. 02

    Liveness that fails closed

    LBP texture, blink and head-movement checks reject spoof attempts and record them. Blink and movement need a short frame burst, so single frames are judged on texture alone.

  3. 03

    Store embeddings, not faces

    Enrollment quality-gates 3–5 frames and keeps only the normalized mean embedding. Face images are not persisted.

The hard part

Security and recognition interact: thresholds come from each organization's settings but can never drop below a global floor, and tokens must be revocable the moment a password changes.

04 · Implementation

From idea to working code.

The repository separates the API, services, ORM models (13 tables), inference, preprocessing, anti-spoofing, training and workers. Alembic migrations, Prometheus metrics, structured logs and Docker Compose health checks cover operations.

HTTP / Documented recognition request
POST /api/recognize
{
  "image_base64": "<primary frame>",
  "liveness_frames_base64": ["<frame 2>", "<frame 3>"],
  "check_liveness": true,
  "auto_mark_attendance": false
}

05 · Outcome

The result, and the next question.

An open-source system with a documented security model and an honest list of limits. It brings model inference, data isolation and full-stack product work into one codebase.

Summarized from the public README, including its "Honest limitations": liveness is heuristic and not PAD-certified, and the Docker stack was verified by tests and builds rather than end to end. Read the project documentation (opens in a new tab) ↗

Next · 03 Network layerARequest