Inspiration
We wanted a lightweight, privacy-aware way to understand when someone is focused during a session (study, meetings, deep work) using only the browser and a serverless backend—no heavy installs or complex setup.
What it does
FocusCam captures webcam frames in the browser and periodically sends them to an AWS Lambda via API Gateway. The Lambda uses Amazon Rekognition signals to estimate a simple "focus" score and records events in DynamoDB. An analytics page can visualize trends over time.
How we built it
- Frontend: a static site (
frontend/index.html,script.js,style.css) that requests webcam access, samples frames every ~5s, and POSTs JSON withsessionId,timestamp, andimageBase64to an API endpoint. - Backend: a Python Lambda (
lambda/processFocusImage.py) that calls Rekognition, computes a focus score, and writes results to DynamoDB. Exposed via API Gateway. - Dev loop: run the frontend locally with a static server; test the Lambda handler locally with a small Python snippet and boto3.
Challenges we ran into
- Handling browser permission flows reliably across different devices
- Designing a simple, explainable focus metric from Rekognition outputs
- Ensuring secure, authenticated access before any public exposure
- Ensuring our API Gateway and backend are configured to correctly handle CORS requests
Accomplishments that we're proud of
- End-to-end working prototype with minimal infra
- Clean separation between a simple frontend and serverless backend
- Straightforward payload and handler that are easy to test locally
What we learned
- Practical tradeoffs of browser-based frame capture and rate limiting
- Rekognition signal quality varies with lighting, angle, and camera
- DynamoDB works well for append-only event logging and quick analytics
What's next for FocusCam
- Add authentication (Cognito/API keys/IAM) and per-user sessions
- Improve focus scoring heuristics and/or add light on-device ML
- Integrate Amazon Bedrock to generate personalized tips to improve focus scores
- Add unit tests for the Lambda (moto/pytest) and a minimal CI
- Provide infrastructure-as-code (SAM/CloudFormation) for one-command deploy
- Ship a simple hosted analytics dashboard
Built With
- amazon-cloudwatch
- amazon-dynamodb
- amazon-q
- copilot
- css
- gateway-api
- html
- lambda
- rekognition
Log in or sign up for Devpost to join the conversation.