Architecture Visual

Complete production architecture for TrendDraw, from static delivery through serverless trend analysis, AI-assisted suggestions, and scheduled data ingestion.

Delivery and Frontend

BrowserUser BrowserReact 19 SPA, dashboards and charts
Amazon CloudFrontCloudFrontShared with the main portfolio distribution
Amazon S3S3 Static Hostingjoesparkman.com/trend-draw path

API Layer

Amazon API GatewayAPI GatewayHTTP API, Lambda proxy integration
AWS LambdaAPI LambdaFastAPI + Mangum, python3.12
Amazon DynamoDBDynamoDBdraws, subscribers, saved picks, meta

AI Trend Analysis

Analytics Enginehot / cold / overdue frequency stats
Anthropic ClaudeAnthropic Claudeclaude-sonnet-4-5 blends trends into suggested sets
Backtest Enginevalidates every strategy against a random baseline

Scheduled Ingestion & Alerts

Amazon EventBridgeEventBridgecron matched to real Mega Millions / Powerball draw days
AWS LambdaIngest Lambdaseparate function, separate IAM role
Amazon SESDynamoDB + SES/Resendnew-draw detection triggers subscriber alerts

Infrastructure as Code

TerraformTerraformProvisions Lambda, API Gateway, DynamoDB, and EventBridge from HCL config

Two independent Lambda functions, each with its own least-privilege IAM role: the API Lambda never gets ingest permissions, and the ingest Lambda never gets exposed to the public API surface.

Rendering: React 19 SPA with a CloudFront Function handling SPA routing at the edge.
Compute: Two Lambda functions on python3.12, one for the public API, one for scheduled ingestion — never the same function.
AI: Claude blends hot/cold/overdue trend signals into suggested sets, explicitly disclaimed as entertainment only, never predictions.
Scheduling: EventBridge cron rules match actual draw calendars, not a generic polling interval.
Data: Four single-purpose DynamoDB tables — draws, subscribers, saved picks, and ingest metadata.
Security: The Anthropic key lives in SSM Parameter Store (SecureString), fetched at cold start — never in source, Terraform state, or a Lambda env var; each Lambda's IAM role is scoped to exactly what it touches.
Back to App Back to Portfolio