๐๐ผ๐ ๐ ๐๐๐ถ๐น๐ ๐ฎ๐ป ๐๐-๐ฃ๐ผ๐๐ฒ๐ฟ๐ฒ๐ฑ ๐๐ฎ๐บ๐ฝ๐๐ ๐ ๐ฎ๐ป๐ฎ๐ด๐ฒ๐บ๐ฒ๐ป๐ ๐ฆ๐๐๐๐ฒ๐บโฆ
A step-by-step breakdown of building TechPhantom AI Campus โ real-time facial attendance, full-stack architecture, and everything inโฆ
๐๐ผ๐ ๐ ๐๐๐ถ๐น๐ ๐ฎ๐ป ๐๐-๐ฃ๐ผ๐๐ฒ๐ฟ๐ฒ๐ฑ ๐๐ฎ๐บ๐ฝ๐๐ ๐ ๐ฎ๐ป๐ฎ๐ด๐ฒ๐บ๐ฒ๐ป๐ ๐ฆ๐๐๐๐ฒ๐บ ๐ณ๐ฟ๐ผ๐บ ๐ฆ๐ฐ๐ฟ๐ฎ๐๐ฐ๐ต
A step-by-step breakdown of building TechPhantom AI Campus โ real-time facial attendance, full-stack architecture, and everything in between.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ

me
๐ง๐ต๐ฒ ๐ฃ๐ฟ๐ผ๐ฏ๐น๐ฒ๐บ ๐ช๐ผ๐ฟ๐๐ต ๐ฆ๐ผ๐น๐๐ถ๐ป๐ด
Every university Iโve seen handles attendance the same way: a teacher calls names, students raise hands, and someone scribbles on a sheet. In a class of 60 students, this wastes 5โ10 minutes every single session. Multiply that across hundreds of courses and an entire semester โ youโre looking at thousands of hours lost, unreliable records, and rampant proxy attendance.
I decided to build something that eliminates this entirely. Not just a digital register โ a fully AI-powered system where a camera does the job automatically, with zero manual input from the teacher or the student.
This is the story of exactly how I built it.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ

๐ฆ๐๐ฒ๐ฝ ๐ญ โ ๐๐ฒ๐ณ๐ถ๐ป๐ฒ ๐๐ต๐ฒ ๐ฆ๐๐๐๐ฒ๐บ ๐๐ฒ๐ณ๐ผ๐ฟ๐ฒ ๐ช๐ฟ๐ถ๐๐ถ๐ป๐ด ๐ฎ ๐ฆ๐ถ๐ป๐ด๐น๐ฒ ๐๐ถ๐ป๐ฒ ๐ผ๐ณ ๐๐ผ๐ฑ๐ฒ
The most common mistake developers make is jumping straight into code. I spent the first few days just thinking through what the system actually needed to do.
๐ง๐ต๐ฟ๐ฒ๐ฒ ๐๐๐ฝ๐ฒ๐ ๐ผ๐ณ ๐๐๐ฒ๐ฟ๐: โข ๐๐ฑ๐บ๐ถ๐ป โ manages students, courses, sessions, monitors attendance โข ๐ฆ๐๐๐ฑ๐ฒ๐ป๐ โ views their own attendance, enrolls in courses, registers their face โข ๐๐ถ๐ผ๐๐ธ (๐๐ถ๐๐ฒ ๐ฆ๐ฐ๐ฎ๐ป๐ป๐ฒ๐ฟ) โ a camera-based terminal that recognizes faces and marks attendance in real time
๐๐ผ๐ฟ๐ฒ ๐ณ๐น๐ผ๐๐ ๐ ๐ต๐ฎ๐ฑ ๐๐ผ ๐๐๐ฝ๐ฝ๐ผ๐ฟ๐:
- Admin creates a course โ enrolls students โ starts an attendance session
- Student registers their face via webcam โ system encodes and stores it
- Live camera feed streams to backend โ backend matches faces โ records attendance
- Both admin and student see live updates instantly
๐ง๐ต๐ฒ ๐ป๐ผ๐ป-๐ป๐ฒ๐ด๐ผ๐๐ถ๐ฎ๐ฏ๐น๐ฒ๐: โข Real-time โ no polling, must use WebSockets โข Privacy-safe โ store face encodings, never raw images โข Role-based access โ admins cannot do student things and vice versa โข Must work even if heavy AI libraries arenโt installed (fallback mode)
Only after this clarity did I start setting up the project.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ๐๐ฒ๐ฝ ๐ฎ โ ๐ฃ๐ฟ๐ผ๐ท๐ฒ๐ฐ๐ ๐ฆ๐๐ฟ๐๐ฐ๐๐๐ฟ๐ฒ & ๐๐ป๐๐ถ๐ฟ๐ผ๐ป๐บ๐ฒ๐ป๐ ๐ฆ๐ฒ๐๐๐ฝ
I chose a clean separation: one ๐ฏ๐ฎ๐ฐ๐ธ๐ฒ๐ป๐ฑ/ folder for Python/FastAPI, and one ๐ณ๐ฟ๐ผ๐ป๐๐ฒ๐ป๐ฑ/ folder for React/Vite. Keeping them completely independent means either side can be swapped, redeployed, or scaled without touching the other.
The backend used a Python virtual environment to isolate dependencies โ ๐๐ฎ๐๐๐๐ฃ๐, ๐ฆ๐ค๐๐๐น๐ฐ๐ต๐ฒ๐บ๐, ๐ฃ๐๐ฑ๐ฎ๐ป๐๐ถ๐ฐ, JWT libraries, ๐ข๐ฝ๐ฒ๐ป๐๐ฉ, and face_recognition. The frontend used npm with ๐ฅ๐ฒ๐ฎ๐ฐ๐, ๐๐ ๐ถ๐ผ๐, Lucide Icons, ๐ฅ๐ฒ๐ฐ๐ต๐ฎ๐ฟ๐๐, and react-webcam.
Having a clear folder structure from day one prevented the chaos of a disorganized codebase as the project grew.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ๐๐ฒ๐ฝ ๐ฏ โ ๐๐ฒ๐๐ถ๐ด๐ป ๐๐ต๐ฒ ๐๐ฎ๐๐ฎ๐ฏ๐ฎ๐๐ฒ ๐ ๐ผ๐ฑ๐ฒ๐น๐
Before writing any API, I designed the full database schema. This is the foundation everything else sits on โ get it wrong and youโll be rewriting half the app later.
I needed 5 entities:
๐จ๐๐ฒ๐ฟ โ Authentication for both admins and students ๐ฆ๐๐๐ฑ๐ฒ๐ป๐ โ Extended profile linked to a User ๐๐ผ๐๐ฟ๐๐ฒ โ A university course with a unique code ๐๐๐๐ฒ๐ป๐ฑ๐ฎ๐ป๐ฐ๐ฒ๐ฆ๐ฒ๐๐๐ถ๐ผ๐ป โ A time-bounded window opened by an admin ๐๐๐๐ฒ๐ป๐ฑ๐ฎ๐ป๐ฐ๐ฒ๐ฅ๐ฒ๐ฐ๐ผ๐ฟ๐ฑ โ One attendance entry per student per session
The trickiest relationship was ๐ฆ๐๐๐ฑ๐ฒ๐ป๐ โ ๐๐ผ๐๐ฟ๐๐ฒ โ a student can be in many courses, and a course has many students. This is a classic many-to-many relationship, handled with a separate enrollment association table that also stores the date a student enrolled.
The most important design decision: the Student model stores the face encoding as raw binary โ a 128-float numpy array serialized to bytes. ๐ก๐ผ ๐ฟ๐ฎ๐ ๐ณ๐ฎ๐ฐ๐ฒ ๐ถ๐บ๐ฎ๐ด๐ฒ๐ ๐ฎ๐ฟ๐ฒ ๐ฒ๐๐ฒ๐ฟ ๐๐ฎ๐๐ฒ๐ฑ ๐ฎ๐ป๐๐๐ต๐ฒ๐ฟ๐ฒ. This is a deliberate privacy-first choice.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ๐๐ฒ๐ฝ ๐ฐ โ ๐๐๐ถ๐น๐ฑ ๐๐ต๐ฒ ๐๐๐๐ต๐ฒ๐ป๐๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป ๐ฆ๐๐๐๐ฒ๐บ (๐๐ช๐ง + ๐ฅ๐ผ๐น๐ฒ-๐๐ฎ๐๐ฒ๐ฑ ๐๐ฐ๐ฐ๐ฒ๐๐)
Security is not optional. I built the auth layer before any feature routes โ because every route depends on knowing who is calling it and what role they have.
The system has two roles: ๐ฎ๐ฑ๐บ๐ถ๐ป and ๐๐๐๐ฑ๐ฒ๐ป๐, stored directly on the User record.
๐ฃ๐ฎ๐๐๐๐ผ๐ฟ๐ฑ ๐ต๐ฎ๐๐ต๐ถ๐ป๐ด uses ๐๐ฐ๐ฟ๐๐ฝ๐ via the passlib library. Passwords are never stored in plain text โ only the hash is saved to the database.
๐๐ช๐ง ๐๐ผ๐ธ๐ฒ๐ป๐ are issued on login. Each token carries the userโs ID and role, and expires after 24 hours. Every subsequent API request must include this token in the Authorization header.
๐ฅ๐ผ๐๐๐ฒ ๐ฝ๐ฟ๐ผ๐๐ฒ๐ฐ๐๐ถ๐ผ๐ป is handled by FastAPI dependency injection. I created two reusable guard functions โ one that enforces admin access, one that enforces student access. Any route just declares which guard it needs and FastAPI handles the rest automatically. This made it impossible to accidentally expose an admin endpoint to a regular student.
The system also auto-creates a default admin account on first startup โ no manual database seeding required.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ๐๐ฒ๐ฝ ๐ฑ โ ๐๐๐ถ๐น๐ฑ ๐๐ต๐ฒ ๐๐ฎ๐ฐ๐ฒ ๐๐ป๐ฐ๐ผ๐ฑ๐ถ๐ป๐ด ๐ฃ๐ถ๐ฝ๐ฒ๐น๐ถ๐ป๐ฒ
This was the most technically complex piece. The goal: take an image, detect the face, and produce a 128-number vector โ called an ๐ฒ๐ป๐ฐ๐ผ๐ฑ๐ถ๐ป๐ด โ that uniquely represents that personโs face.
๐ฃ๐ฟ๐ถ๐บ๐ฎ๐ฟ๐ ๐บ๐ฒ๐๐ต๐ผ๐ฑ โ ๐ฑ๐น๐ถ๐ฏ ๐๐ถ๐ฎ ๐ณ๐ฎ๐ฐ๐ฒ_๐ฟ๐ฒ๐ฐ๐ผ๐ด๐ป๐ถ๐๐ถ๐ผ๐ป: The face_recognition library (built on dlib) detects face locations in an image and computes a 128-dimension floating-point vector for each face found. This encoding is the mathematical โfingerprintโ of a face. Two photos of the same person produce encodings with a very small Euclidean distance. Two different people produce a large distance. A threshold of 0.5 is used โ faces within that distance are considered a match.
๐ง๐ต๐ฒ ๐ฐ๐ต๐ฎ๐น๐น๐ฒ๐ป๐ด๐ฒ: dlib requires C++ build tools to compile from source. Many environments donโt have them. Rather than making the whole system fail, I built a graceful fallback.
๐๐ฎ๐น๐น๐ฏ๐ฎ๐ฐ๐ธ ๐บ๐ฒ๐๐ต๐ผ๐ฑ โ ๐ข๐ฝ๐ฒ๐ป๐๐ฉ ๐๐ฎ๐ฎ๐ฟ ๐๐ฎ๐๐ฐ๐ฎ๐ฑ๐ฒ + ๐ฐ๐ผ๐น๐ผ๐ฟ ๐ต๐ถ๐๐๐ผ๐ด๐ฟ๐ฎ๐บ ๐ฒ๐ป๐ฐ๐ผ๐ฑ๐ถ๐ป๐ด: If face_recognition isnโt available, OpenCVโs Haar Cascade classifier detects the face region. That region is resized to a fixed size and analyzed channel-by-channel to build a 128-bin color histogram โ a different kind of numerical fingerprint. Itโs less accurate than dlib embeddings but keeps the system functional without any C++ dependencies.
Both methods produce a 128-dimension array, so storage, comparison, and matching work identically regardless of which method is used. The system detects which method is available at startup and uses it consistently throughout.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ๐๐ฒ๐ฝ ๐ฒ โ ๐๐ป๐๐ฒ๐ด๐ฟ๐ฎ๐๐ฒ ๐ฌ๐ข๐๐ข๐๐ด ๐ณ๐ผ๐ฟ ๐ฃ๐ฒ๐ฟ๐๐ผ๐ป ๐๐ฒ๐๐ฒ๐ฐ๐๐ถ๐ผ๐ป
Face recognition alone has a problem: someone could hold up a printed photo and trick the system. ๐ฌ๐ข๐๐ข๐๐ด adds a real-world validation layer โ it confirms that an actual person is physically present in the camera frame before any face recognition is attempted.
YOLOv8 (the nano variant, optimized for speed) runs on every incoming camera frame and looks specifically for the โpersonโ class. If no person is detected, face recognition is skipped entirely โ saving compute and preventing the most obvious spoofing attack.
Like face_recognition, YOLOv8 is wrapped in a conditional import so the system starts cleanly and continues in degraded mode if the model isnโt available.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ๐๐ฒ๐ฝ ๐ณ โ ๐๐๐ถ๐น๐ฑ ๐๐ต๐ฒ ๐ฅ๐ฒ๐ฎ๐น-๐ง๐ถ๐บ๐ฒ ๐ช๐ฒ๐ฏ๐ฆ๐ผ๐ฐ๐ธ๐ฒ๐ ๐๐ถ๐ผ๐๐ธ
This was the most exciting engineering challenge. The live attendance kiosk needs to receive a continuous stream of camera frames from the browser, run the full AI pipeline on each one, and send the result back instantly โ all without the overhead of repeated HTTP requests.
๐ช๐ฒ๐ฏ๐ฆ๐ผ๐ฐ๐ธ๐ฒ๐๐ are the only sensible solution. They keep a persistent, two-way connection open between the browser and the server.
Hereโs the flow that happens dozens of times per second:
- Browser captures a webcam frame using react-webcam
- Frame is encoded as a base64 JPEG string and sent over the WebSocket
- Backend decodes the image and runs ๐ฌ๐ข๐๐ข๐๐ด person detection
- If a person is confirmed, runs face encoding on the frame
- Loads all enrolled studentsโ stored encodings from the database
- Compares using Euclidean distance to find the closest match
- If a match is found within the tolerance threshold, records attendance and sends back the studentโs name, confidence score, and face bounding box coordinates
- Browser draws the bounding box overlay on a canvas and displays the name
The frontend throttles frame sending to approximately 10 frames per second to avoid overwhelming the backend while still feeling real-time to the user.
๐ ๐๐น๐๐ถ-๐ฐ๐ผ๐๐ฟ๐๐ฒ ๐ฐ๐ผ๐ป๐ณ๐น๐ถ๐ฐ๐ ๐ฟ๐ฒ๐๐ผ๐น๐๐๐ถ๐ผ๐ป was also added: if a student is enrolled in two courses that both have active sessions at the same time, the system handles the selection intelligently rather than recording double attendance.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ๐๐ฒ๐ฝ ๐ด โ ๐๐๐ถ๐น๐ฑ ๐๐ต๐ฒ ๐๐ฎ๐๐๐๐ฃ๐ ๐ฅ๐๐ฆ๐ง ๐๐ป๐ฑ๐ฝ๐ผ๐ถ๐ป๐๐
With the AI pipeline working, I built all the standard management endpoints that power the dashboards.
๐๐ป๐ฑ๐ฝ๐ผ๐ถ๐ป๐ ๐ด๐ฟ๐ผ๐๐ฝ๐: โข ๐๐๐๐ต ๐ฟ๐ผ๐๐๐ฒ๐ โ register, login, get current user, update profile, upload/delete profile picture โข ๐๐ฑ๐บ๐ถ๐ป ๐ฟ๐ผ๐๐๐ฒ๐ โ full CRUD for students, courses, and attendance sessions; attendance reports with filtering by course or session โข ๐ฆ๐๐๐ฑ๐ฒ๐ป๐ ๐ฟ๐ผ๐๐๐ฒ๐ โ view own profile, enroll/unenroll from courses, view attendance history, register own face via webcam
FastAPIโs Pydantic integration made validation clean โ each request body has a strict schema, and invalid requests are automatically rejected with clear error messages before they ever reach the database.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ๐๐ฒ๐ฝ ๐ต โ ๐๐๐ถ๐น๐ฑ ๐๐ต๐ฒ ๐ฅ๐ฒ๐ฎ๐ฐ๐ ๐๐ฟ๐ผ๐ป๐๐ฒ๐ป๐ฑ
The frontend is organized around three main views and a shared authentication context.
๐๐๐๐ต๐ฒ๐ป๐๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป is managed via React Context โ the logged-in userโs data and JWT token are stored in context and localStorage, available to any component without prop drilling.
๐๐ฃ๐ ๐ฐ๐ฎ๐น๐น๐ all go through a centralized Axios instance that automatically attaches the JWT token to every request โ no component ever manually handles authorization headers.
๐๐ฑ๐บ๐ถ๐ป ๐๐ฎ๐๐ต๐ฏ๐ผ๐ฎ๐ฟ๐ฑ โ the largest component, organized into tabs: โข Overview with live statistics โ total students, courses, active sessions, face enrollment rate โข Student management โ add, edit, delete, course assignments, face registration via webcam โข Course management โ create, update, delete โข Session management โ start and stop attendance sessions per course โข Attendance reports with course and session filtering
๐ฆ๐๐๐ฑ๐ฒ๐ป๐ ๐๐ฎ๐๐ต๐ฏ๐ผ๐ฎ๐ฟ๐ฑ โ the student-facing view: โข Personal attendance rate per course shown as bar charts via Recharts โข List of enrolled courses with per-course percentages โข Available courses for self-enrollment โข Webcam-based face registration โ student takes a photo that gets sent to the backend for encoding
๐๐ถ๐๐ฒ ๐๐ถ๐ผ๐๐ธ โ connects to the WebSocket endpoint, streams webcam frames, receives recognition results, and draws bounding box overlays on a canvas. Shows โRecognized โโ with the student name, or โUnknown Faceโ for unregistered individuals.
๐๐ฒ๐๐ถ๐ด๐ป ๐๐๐๐๐ฒ๐บ โ a full glassmorphism CSS system with a dark theme, gradient accents, smooth hover transitions, and consistent spacing โ all in vanilla CSS, no Tailwind dependency.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ๐๐ฒ๐ฝ ๐ญ๐ฌ โ ๐๐ฒ๐ฝ๐น๐ผ๐๐บ๐ฒ๐ป๐ ๐๐ฟ๐ฐ๐ต๐ถ๐๐ฒ๐ฐ๐๐๐ฟ๐ฒ
Local development runs two processes in parallel โ the backend on port 8000 with hot reload, and the Vite dev server on port 5173 with HMR.
Production deployment uses a proper layered stack:
๐๐๐ป๐ถ๐ฐ๐ผ๐ฟ๐ป + ๐จ๐๐ถ๐ฐ๐ผ๐ฟ๐ป ๐๐ผ๐ฟ๐ธ๐ฒ๐ฟ๐ โ Multi-process ASGI serving ๐ก๐ด๐ถ๐ป๐ โ SSL termination, WebSocket proxy, static file serving ๐๐ผ๐ฐ๐ธ๐ฒ๐ฟ โ Reproducible Python + AI environment ๐ฉ๐ฒ๐ฟ๐ฐ๐ฒ๐น โ CDN-backed React frontend deployment ๐ฃ๐ผ๐๐๐ด๐ฟ๐ฒ๐ฆ๐ค๐ (prod) / ๐ฆ๐ค๐๐ถ๐๐ฒ (dev) โ Persistent data storage
The most critical Nginx detail: ๐ช๐ฒ๐ฏ๐ฆ๐ผ๐ฐ๐ธ๐ฒ๐ connections require special proxy headers โ Upgrade and Connection. Without them, the live kiosk silently fails behind Nginx with no obvious error.
๐๐ผ๐ฐ๐ธ๐ฒ๐ฟ is especially important because dlib and YOLOv8 have complex native dependencies โ C++ libraries and model weight files. Containerizing the backend means the exact same environment runs in development, staging, and production, eliminating environment-specific bugs entirely.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐๐ต๐ฎ๐น๐น๐ฒ๐ป๐ด๐ฒ๐ ๐ ๐๐ถ๐ ๐ฎ๐ป๐ฑ ๐๐ผ๐ ๐ ๐ฆ๐ผ๐น๐๐ฒ๐ฑ ๐ง๐ต๐ฒ๐บ
โ ๐ฑ๐น๐ถ๐ฏ ๐๐ผ๐ปโ๐ ๐ถ๐ป๐๐๐ฎ๐น๐น ๐๐ถ๐๐ต๐ผ๐๐ ๐++ ๐ฏ๐๐ถ๐น๐ฑ ๐๐ผ๐ผ๐น๐ โ Built the OpenCV histogram fallback that produces a compatible 128-dimension encoding. System gracefully degrades without breaking.
โ ๐ช๐ฒ๐ฏ๐ฆ๐ผ๐ฐ๐ธ๐ฒ๐ ๐ณ๐ฟ๐ฎ๐บ๐ฒ๐ ๐ฎ๐ฟ๐ฟ๐ถ๐๐ถ๐ป๐ด ๐ณ๐ฎ๐๐๐ฒ๐ฟ ๐๐ต๐ฎ๐ป ๐ฝ๐ฟ๐ผ๐ฐ๐ฒ๐๐๐ถ๐ป๐ด ๐๐ฝ๐ฒ๐ฒ๐ฑ โ Added frame throttling on the frontend โ send a frame every 100ms, not on every render cycle. The backend processes one frame per connection at a time.
โ ๐ ๐๐น๐๐ถ๐ฝ๐น๐ฒ ๐ฎ๐ฐ๐๐ถ๐๐ฒ ๐๐ฒ๐๐๐ถ๐ผ๐ป๐ ๐ฐ๐ฎ๐๐๐ถ๐ป๐ด ๐ฐ๐ผ๐ป๐ณ๐๐๐ถ๐ผ๐ป โ Added multi-course conflict detection. If a student is in two courses with active sessions simultaneously, the system handles the selection intelligently.
โ ๐๐ฎ๐ฐ๐ฒ ๐ฒ๐ป๐ฐ๐ผ๐ฑ๐ถ๐ป๐ด๐ ๐ป๐ผ๐ ๐ฝ๐ผ๐ฟ๐๐ฎ๐ฏ๐น๐ฒ ๐ฏ๐ฒ๐๐๐ฒ๐ฒ๐ป ๐ฑ๐น๐ถ๐ฏ ๐ฎ๐ป๐ฑ ๐ข๐ฝ๐ฒ๐ป๐๐ฉ โ The encoding method is detected at runtime and used consistently. Mixing methods on a single deployment is avoided by design.
โ ๐๐ช๐ง ๐๐๐ฏ ๐ณ๐ถ๐ฒ๐น๐ฑ ๐บ๐๐๐ ๐ฏ๐ฒ ๐ฎ ๐๐๐ฟ๐ถ๐ป๐ด ๐ฝ๐ฒ๐ฟ ๐๐ฝ๐ฒ๐ฐ๐ถ๐ณ๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป โ User ID is cast to a string when creating the token and back to an integer when verifying. A subtle bug that caused 401 errors until tracked down.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ช๐ต๐ฎ๐ ๐โ๐ฑ ๐๐ผ ๐๐ถ๐ณ๐ณ๐ฒ๐ฟ๐ฒ๐ป๐๐น๐
- ๐ฆ๐ฒ๐ฝ๐ฎ๐ฟ๐ฎ๐๐ฒ ๐๐ต๐ฒ ๐๐ ๐๐ผ๐ฟ๐ธ๐ฒ๐ฟ โ run face recognition in a dedicated async process to avoid blocking the event loop under heavy load
- ๐๐ฑ๐ฑ ๐ฅ๐ฒ๐ฑ๐ถ๐ โ for session state caching instead of hitting the database on every WebSocket frame
- ๐๐ฑ๐ฑ ๐น๐ถ๐๐ฒ๐ป๐ฒ๐๐ ๐ฑ๐ฒ๐๐ฒ๐ฐ๐๐ถ๐ผ๐ป โ blink detection or head movement to prevent photo spoofing more robustly
- ๐ ๐๐น๐๐ถ-๐ฐ๐ฎ๐บ๐ฒ๐ฟ๐ฎ ๐๐๐ฝ๐ฝ๐ผ๐ฟ๐ โ one WebSocket connection per camera, all feeding into a shared session
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐๐น๐ผ๐๐ถ๐ป๐ด ๐ง๐ต๐ผ๐๐ด๐ต๐๐
This project touched every layer of modern software: database design, secure authentication, computer vision, real-time communication, UI development, and production deployment. Each layer had its own challenges, and solving them end-to-end gave me a much deeper appreciation for how complex production systems actually work.
If youโre a developer looking to go beyond CRUD apps, Iโd strongly recommend building something that involves real-time data and AI โ it forces you to think about performance, reliability, and user experience in ways that simple request/response systems never do.
Feel free to reach out if you have questions about any specific part of the architecture!
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Python #FastAPI #ReactJS #ComputerVision #YOLOv8 #FaceRecognition #WebSocket #FullStack #EdTech #SoftwareEngineering
๋ฉํ๋ฐ์ดํฐ
- post_id
- cfb94b5b1ad7
- slug
- -cfb94b5b1ad7
- url
- https://medium.com/@hussnain-bashir/-cfb94b5b1ad7
- canonical_url
- https://medium.com/@hussnain-bashir/-cfb94b5b1ad7
- author_url
- https://medium.com/@hussnain-bashir
- status
- ok
- fetched_at
- 2026-06-26 03:39:16