AWS Builder Center
LogClass: How I Built an AI-Powered Attendance System on Serverless AWS

LogClass: How I Built an AI-Powered Attendance System on Serverless AWS

LogClass turns a single classroom photo into verified attendance in seconds. Here's how Amazon Rekognition, AWS Lambda, DynamoDB, and S3 come together in a serverless pipeline — plus the security decisions that keep AWS credentials out of the browser.

Manual attendance doesn't scale. A teacher calling out fifty names, or passing around a sheet that half the class forgets to sign, eats minutes out of every single lecture — and the data it produces is still just a sheet of paper. LogClass is my answer to that: a cloud-based attendance platform where a teacher uploads one photo of the classroom, and the system detects every face in it, matches each one against registered students, and records attendance automatically.
The interesting part isn't the idea — it's what it took to make "upload a photo, get attendance" actually work as a secure, scalable pipeline. This post walks through the AWS architecture behind LogClass: what each service does, why it's there, and how a request flows from the browser all the way to a recorded attendance entry.

What LogClass does

  • Teachers create classrooms and invite students via a time-limited invitation link
  • Students register once with a student ID and a face capture
  • Teachers upload a classroom photo to take attendance for a session
  • LogClass detects and matches faces, then writes attendance records automatically
  • Both roles get dashboards: attendance history, analytics, and CSV/Excel export
  • A pay-as-you-go wallet meters usage per face processed
The frontend is React (Vite, PWA-installable). The backend is Node.js/Express. But the real engine of the product is the serverless pipeline sitting behind it — and that's almost entirely AWS.

Why serverless

Attendance processing is bursty by nature: nothing happens most of the day, then a wave of requests hits the moment a class starts. Running a server that's provisioned for peak load but idle 90% of the time didn't make sense for this workload. AWS Lambda scales to zero when nothing's happening and scales out automatically when a teacher uploads a photo — so the architecture ended up serverless almost by default, once I looked at the actual traffic shape.

Architecture, at a glance

React Frontend (Vite/PWA) │ HTTPS / REST ▼ Node.js Backend (Express) │ ┌────┴─────────────────┐ ▼ ▼ MongoDB Amazon S3 (users, classrooms, (face images, app metadata) classroom photos) │ ▼ AWS Lambda │ ▼ Amazon Rekognition (detect + match) │ ▼ Amazon DynamoDB (attendance + sessions) │ ▼ Notifications (FCM/SES)
Two databases, deliberately. MongoDB holds the stuff that looks like a normal application — teachers, students, classrooms, auth. DynamoDB holds attendance and session data, which is high-write, queried by predictable keys (by classroom, by date, by student), and needs to scale automatically as more classrooms come online. Picking one database for both jobs would have meant compromising on one of them.

The attendance pipeline, step by step

This is the core flow, and the one worth tracing end to end:
  1. Teacher selects a classroom and uploads a photo
  1. Backend authenticates the request and generates a pre-signed S3 URL
  1. The browser uploads the image directly to S3 — it never passes through the Node.js server
  1. A Lambda function picks up the processing job
  1. Lambda calls Amazon Rekognition to detect every face in the photo, then searches each detected face against the classroom's Rekognition Collection
  1. Matched faces resolve to student IDs
  1. Lambda writes an attendance record per matched student to DynamoDB
  1. A notification goes out to each student
Every one of those AWS services earns its place for a specific reason, so let's go through them.

Amazon S3 — where every image actually lives

Face images and classroom photos are binary files; they don't belong inside a document or key-value store. S3 handles that, and the database only ever stores the key, not the image:
{
"studentId": "STU123",
"imageS3Key": "students/user123/profile.jpg"
}
The upload itself uses a pre-signed URL: the backend authenticates the request, then hands the browser a short-lived, single-purpose URL scoped to exactly one S3 object. Two things fall out of that for free — AWS credentials never reach the browser, and the image bytes never have to round-trip through the Node.js server, since the browser talks to S3 directly.

Amazon Rekognition — the actual "AI" in the pipeline

LogClass doesn't train or host its own face-recognition model — Rekognition does the detection, indexing, and matching. There are two operations that matter:
Indexing (once, at registration). When a student registers, their face image is indexed into a Rekognition Collection, which returns a  FaceId :
Student Image → Rekognition detects the face → Face indexed into Collection → FaceId generated Student ID: STU123 → FaceId: abc-xyz-123
LogClass's own database keeps the authoritative link between  FaceId  and  StudentId  — Rekognition's Collection is the searchable index; the app database is the source of truth for what each  FaceId  means.
Searching (every attendance run). A classroom photo goes through  DetectFaces , and each detected face gets searched against the classroom's Collection to resolve a match.

AWS Lambda — three focused functions, not one big backend

Rather than one monolithic handler, the processing logic is split by responsibility:
Lambda
Responsible for
Registration
Student image → Rekognition  IndexFaces  → FaceId → write to DynamoDB
Attendance / Search
Classroom image → detect faces → search Collection → resolve students → write attendance
Session management
Tracks session metadata: date, class order, faces detected, total students

Amazon DynamoDB — attendance at scale

Attendance data is high-volume and queried in a small number of predictable ways, which is exactly the profile DynamoDB is built for. A partition key/sort key design like this supports "today's attendance," "this student's history," and "this class on this date" without scans:
{
"PK": "CLASS#123",
"SK": "2026-09-18#STU001",
"studentId": "STU001",
"status": "present",
"classOrder": 1
}

API Gateway + IAM — the front door and the lock on every door behind it

API Gateway exposes the Lambda functions as versioned REST routes. IAM is what actually makes the system safe: each Lambda's execution role is scoped to the specific actions it needs —  s3:PutObject ,  rekognition:SearchFaces ,  dynamodb:PutItem  — and nothing broader. Combined with the pre-signed URL pattern, this adds up to one non-negotiable rule that shaped the whole design: AWS credentials never touch the frontend. Every AWS-facing action is brokered by the backend or a Lambda's IAM role.

Amazon SQS — for when attendance shouldn't block on Rekognition

When several classrooms process attendance at once, or a session spans multiple photos, doing recognition synchronously inside the request would block the teacher's upload and make retries painful. SQS decouples "image received" from "image processed," so the upload returns immediately and processing happens asynchronously behind it.

What's next

The attendance pipeline above is what's built and running today. The next piece I'm designing is a general-purpose file storage module — reusing the exact same pattern (S3 for the file, a database for metadata, pre-signed URLs for every transfer) so it fits the rest of the architecture instead of introducing a second way of doing things. It's still on the roadmap, not shipped yet.

Closing thoughts

The biggest lesson from building LogClass wasn't about Rekognition's API — it was about drawing clean boundaries: one database for application data, one for high-volume attendance data; one credential path (backend/Lambda IAM roles) for anything AWS-facing; one Lambda per responsibility instead of one that does everything. None of that is exotic, but sticking to it consistently is what made a "photo in, attendance out" idea into something that actually holds up under real classroom load.
I'd love feedback from anyone who's built similar Rekognition-based pipelines, especially around Collection management at scale — happy to compare notes in the comments.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article