Deployment Guide

Deploy StemCell to production

CRITICAL: Deployment Order

You MUST deploy in this exact order:

  1. AWS Infrastructure FIRST - Creates S3 buckets and credentials
  2. Vercel Backend - Requires S3 credentials from step 1
  3. Mobile App - Requires backend URL from step 2
  4. Firmware - Optional, requires S3 bucket from step 1

Step 1: AWS Infrastructure

Deploy AWS resources first (S3 buckets, IAM credentials):

cd infrastructure
npm install

# First time only
cdk bootstrap --region ap-southeast-1

# Deploy
cdk deploy StemCellMinimal-dev --region ap-southeast-1

⚠️ Save these outputs: FirmwareBucketName, MarketplaceBucketName, VercelAccessKeyId, VercelSecretAccessKey

Step 2: Vercel Backend

Configure and deploy the Next.js backend:

cd packages/cloud
vercel link

# Set environment variables in Vercel Dashboard
# Deploy
vercel --prod

# Run migrations
npx prisma migrate deploy

Step 3: Mobile App

Build and deploy the Flutter mobile app:

cd packages/nucleus
fvm flutter pub get
fvm flutter build apk --release

Cost Optimization

Current Costs

AWS S3: ~$0.75/month

Vercel: Free or $20/month

Neon: Free or $19/month

Total: $18-20/month

Removed Services

❌ ECS Fargate: $15-20/mo

❌ Load Balancer: $16/mo

❌ RDS Aurora: $30-50/mo

❌ NAT Gateway: $32/mo

Savings: $93-118/month