Architecture Visual
Food Scanner Production Flow
End-to-end architecture for static delivery, Cognito sign-in, protected Lambda APIs, OpenAI-powered analysis, and DynamoDB-backed scan history.
Delivery and Frontend
User BrowserLoads the app and submits meal photos→
CloudFront CDNapp.joesparkman.com edge delivery→
S3 Static HostingNext export assets and HTML pagesAuth and API Routing
Amazon CognitoHosted sign-in and JWT tokens→
API Gateway/health, /config, /analyze, /scans→
Lambda (Python)Routing, auth, analysis, and persistenceAnalysis and Persistence
OpenAI APIImage analysis and recipe estimates↔
Lambda RuntimePrompting, fallback logic, response shaping→
DynamoDBPer-user scan history storageProtected endpoints require Cognito bearer tokens. Cloud scan records are keyed by the signed-in user so scan history stays private.
Hosting: CloudFront serves the app globally while S3 stores the exported frontend assets.Auth: Cognito handles sign-in and token issuance for protected save and list routes.Compute: API Gateway routes requests to Lambda for analysis and persistence operations.Data: DynamoDB stores per-user scan history and correction updates.AI: OpenAI returns a meal estimate and tips, with a fallback when the model path is unavailable.Security: Credentials stay server-side and the frontend only sends user tokens and photo data.