Architecture
Production Stack
| Service | Provider | Purpose | Pricing |
|---|---|---|---|
| App Runtime | AWS App Runner | Hosts the Next.js application | Pay per vCPU/memory |
| Database | Supabase (PostgreSQL) | Primary data store via Prisma 7 | Free tier available |
| Cache | Upstash (Redis) | Enrichment caching, rate limiting | Free tier available |
| DNS | Route 53 | Domain management | ~$0.50/zone/month |
| CDN | CloudFront | Marketing site + static assets | Pay per request |
| Container Registry | Amazon ECR | Docker image storage | Pay per GB |
Step-by-Step Setup
Create a Supabase project
- Go to supabase.com and create a new project
- Choose a region close to your App Runner deployment
- Copy the Connection string (Settings → Database → URI)
- The format is:
postgresql://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres
Create an Upstash Redis database
- Go to upstash.com and create a new Redis database
- Choose the same region as your Supabase project
- Copy the Redis URL (starts with
rediss://) - Upstash provides TLS by default — the
rediss://protocol handles encryption
Create App Runner service
- Go to the AWS App Runner console
- Choose Container registry → Amazon ECR as the source
- Select the
kaireon-apirepository andlatesttag - Configure:
- CPU: 1 vCPU (or 2 for production)
- Memory: 2 GB (or 4 for production)
- Port: 3000
- Add environment variables:
Initialize the database
Run migrations against your Supabase database from your local machine:Then seed the admin user:
Updating
To deploy a new version:Monitoring
- App Runner logs — Available in the App Runner console or CloudWatch
- Supabase dashboard — Monitor database connections, query performance, and storage
- Upstash dashboard — Monitor Redis commands, memory usage, and latency