Architecture Visual
Complete production architecture for Pet Recipe App, from static frontend delivery through authentication, protected API routes, serverless compute, AI generation, and persistent storage.
Delivery and Frontend

User Browser
Loads app and enters pet details
→

CloudFront CDN
app.joesparkman.com edge delivery
→

S3 Static Hosting
index.html, app.js, styles.css
Auth and API Routing

Amazon Cognito
Hosted UI + PKCE + JWT tokens
→

API Gateway HTTP API
/recipes, /saved-recipes, /pet-profiles
→

Lambda (Python)
route dispatch and token-claim user mapping
Generation and Persistence

Gemini API
generateContent for recipe output
↔

Lambda Runtime
prompt builder + response formatting
→

DynamoDB Tables
SavedRecipes and PetProfiles
Protected endpoints require Cognito bearer tokens. Recipe generation and saved data are user-scoped through JWT claim mapping in Lambda.
Hosting layer: CloudFront serves the app globally while S3 stores static frontend assets under the pet-recipe-app path.
Auth layer: Cognito handles sign-in and issues JWT tokens used as Bearer auth for protected save/list API routes.
Compute layer: API Gateway routes requests to Lambda for recipe generation and user-scoped persistence operations.
Data layer: DynamoDB stores saved recipes and pet profiles keyed by signed-in user identity from token claims.
AI layer: Lambda sends prompt content to Gemini and returns recipe text to the frontend response panel.
Security posture: Sensitive credentials stay server-side in environment/secret configuration, never in frontend code.