README
Pet Recipe App
A Gemini AI-powered recipe generator for pet owners, built on a production-shaped serverless AWS stack: static hosting, Cognito authentication, API Gateway + Lambda, and DynamoDB persistence for saved recipes and pet profiles.
What It Does
Pet owners describe what they have on hand and what their pet needs, and the app generates a recipe using Google's Gemini model. Signed-in users can save generated recipes and manage pet profiles that carry over between sessions.
Architecture
Hosting
The frontend is deployed to S3 and served through CloudFront at
app.joesparkman.com/pet-recipe-app for global delivery and cache control.
Auth
Amazon Cognito handles Hosted UI sign-in with PKCE. The browser stores tokens in session state and sends Bearer JWTs on protected routes.
API & Compute
API Gateway routes requests to Lambda: POST /recipes for generation, plus
protected GET/POST routes for saved recipes and pet profiles.
Data
DynamoDB persists user-scoped data across two tables, SavedRecipes and
PetProfiles, keyed by identity claims from Cognito tokens.
AI Integration
Lambda builds the recipe prompt and calls Gemini's generateContent, then
returns the generated recipe text to the browser UI.
Security Model
The frontend never holds server credentials; secrets stay in backend configuration, and IAM access is scoped to only the services each Lambda needs.
API
POST /recipes: generate a recipe from pet profile and available ingredientsGET /saved-recipes/POST /saved-recipes: list and save recipes (protected)GET /pet-profiles/POST /pet-profiles: list and save pet profiles (protected)