README
Food Scanner App
Upload a meal photo and get instant nutrition guidance. A Next.js frontend and a serverless AWS backend combine OpenAI-powered image analysis with account-based scan history.
What It Does
Upload a meal photo, get a nutrition estimate, and save the result to a personal scan history when signed in. Signed-out visitors can still analyze photos and see useful nutrition guidance - results just stay on-device instead of syncing to an account.
Architecture
Frontend
Next.js static export with React, Cognito auth helpers, and a responsive card-based interface with inline image compression before upload.
Authentication
Amazon Cognito provides sign-in and a signed-out fallback so users can move between private and local-history modes.
Backend
AWS Lambda behind API Gateway, with Cognito JWT verification on protected routes.
Analysis
Lambda sends the image payload to OpenAI for analysis, with fallback heuristic logic when the AI call is unavailable, and returns user-friendly meal guidance.
Storage
DynamoDB stores per-user scan records for signed-in accounts; the browser keeps a local fallback history for people who are not signed in.
Key Endpoints
GET /health: service health checkGET /config: public runtime configurationPOST /analyze: submit a meal photo for analysis/scans(protected) - load and save account scan history