Getting StartedDeployment

Deployment

Deploy A²D to production using Vercel or other hosting platforms.

Overview

A²D is optimized for serverless deployment with automatic scaling and global distribution.

Recommended platform: Vercel (native Next.js support)

Time required: ~15-20 minutes for first deployment


Deployment Options

A²D can be deployed to various platforms:

PlatformDifficultyCostBest For
VercelEasyFree tier availableRecommended - native Next.js
NetlifyEasyFree tier availableAlternative serverless
RailwayMediumPaidSimplified cloud deployment
AWS/GCP/AzureHardVariableEnterprise custom deployment
DockerMediumVariableSelf-hosted containers

This guide focuses on Vercel, the recommended platform.


Prerequisites

Before deploying:

NameTypeDescription
Production Supabaserequired

Separate Supabase project for production with all migrations run

Git Repositoryrequired

Code pushed to GitHub, GitLab, or Bitbucket

Vercel Accountrequired

Free account at vercel.com

Domain (Optional)optional

Custom domain if not using Vercel’s .vercel.app subdomain

Checklist:

  • Production Supabase project created
  • All database migrations run successfully
  • Production API keys copied
  • Code pushed to Git repository
  • Vercel account created

Option 1: One-Click Deploy ⚡

The fastest way to deploy A²D to Vercel.

Step 1: Click Deploy Button

Click the deploy button below or visit the repository README:

Deploy with Vercel

Step 2: Connect GitHub

  1. Authorize Vercel to access your GitHub account
  2. Choose repository location:
    • Create new repository, or
    • Use existing repository

Step 3: Configure Project

NameTypeDescription
Project Namestring

Choose a name (e.g., ma2d-production)

Framework Presetauto-detected

Next.js (automatically detected)

Root Directorystring

. (keep default)

Step 4: Add Environment Variables

Enter your production Supabase credentials:

NEXT_PUBLIC_SUPABASE_URL=https://your-prod-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOi...
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOi...
NEXT_PUBLIC_APP_URL=https://your-app.vercel.app

Use production Supabase credentials, not development ones! Create a separate Supabase project for production.

Step 5: Deploy

  1. Click “Deploy”
  2. Wait 2-3 minutes for build to complete
  3. Your app is live! 🎉

Deployment URL: https://your-project.vercel.app


Option 2: Manual Deploy 🛠️

For more control over the deployment process.

Step 1: Push to GitHub

# Initialize git (if not already)
git init
 
# Add remote repository
git remote add origin https://github.com/your-username/ma2d.git
 
# Stage all changes
git add .
 
# Commit
git commit -m "Initial commit - A²D production ready"
 
# Push to GitHub
git push -u origin main

Step 2: Import to Vercel

  1. Go to vercel.com/dashboard
  2. Click “Add New…”“Project”
  3. Select “Import Git Repository”
  4. Choose your A²D repository
  5. Click “Import”

Step 3: Configure Build Settings

Vercel auto-detects Next.js. Verify settings:

NameTypeDescription
Framework Presetauto

Next.js (automatically detected)

Build Commandcommand

npm run build (default)

Output Directorypath

.next (auto-detected)

Install Commandcommand

npm install (default)

Node.js Versionversion

18.x or 20.x (recommended)

Step 4: Add Environment Variables

In project settings, add all required variables:

  1. Go to SettingsEnvironment Variables
  2. Add each variable:
Variable NameValueEnvironments
NEXT_PUBLIC_SUPABASE_URLProduction Supabase URLProduction, Preview, Development
NEXT_PUBLIC_SUPABASE_ANON_KEYProduction anon keyProduction, Preview, Development
SUPABASE_SERVICE_ROLE_KEYProduction service role keyProduction, Preview, Development
NEXT_PUBLIC_APP_URLhttps://your-app.vercel.appProduction
  1. Click “Save” for each variable

The NEXT_PUBLIC_APP_URL will be your Vercel deployment URL. You can update this later if you add a custom domain.

Step 5: Deploy

  1. Click “Deploy” button
  2. Watch build logs in real-time
  3. Wait for deployment to complete (~2-3 minutes)
  4. Visit your deployment URL

Post-Deployment Setup

Step 1: Update Supabase Auth URLs

Configure authentication redirects in your production Supabase project:

  1. Go to AuthenticationURL Configuration
  2. Update these values:
https://your-app.vercel.app
https://your-app.vercel.app/**
https://your-app.vercel.app/auth/callback
  1. Click “Save”

If you add a custom domain later, update these URLs accordingly.


Step 2: Test Authentication

Verify the authentication flow works:

  1. Visit your deployed app
  2. Click “Sign Up”
  3. Create test account:
    • Email: test@yourdomain.com
    • Password: Strong password
    • Organization: Test Organization
  4. Verify redirect to dashboard
  5. Test login/logout

Expected: ✅ Smooth authentication flow


Step 3: Test MCP Endpoints

Verify MCP endpoints are accessible:

  1. Create a test MCP server in the dashboard
  2. Copy the endpoint URL
  3. Test with curl:
curl -X POST https://your-app.vercel.app/api/platform/[server-id]/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list"
  }'

Expected: JSON response with tools list


Step 4: Configure Custom Domain (Optional)

Add your own domain to the deployment:

  1. Go to project SettingsDomains
  2. Click “Add Domain”
  3. Enter your domain:
    • ma2d.yourdomain.com (subdomain), or
    • yourdomain.com (apex domain)
  4. Follow DNS configuration instructions:
Type: CNAME
Name: ma2d
Value: cname.vercel-dns.com
Type: A
Name: @
Value: 76.76.21.21
  1. Wait for DNS propagation (~5-60 minutes)
  2. SSL certificate provisioned automatically

Vercel provides free SSL certificates via Let’s Encrypt for all domains.


Continuous Deployment

Vercel automatically deploys on every git push.

Deployment Workflow

Automatic Deployments:

  • Push to main branch → Production deployment
  • Push to other branches → Preview deployment
  • Pull requests → Preview deployment with unique URL

Example Workflow

# Make changes locally
git add .
git commit -m "feat: Add new MCP tool builder"
 
# Push to GitHub
git push origin main
 
# Vercel automatically:
# 1. Detects push
# 2. Runs build
# 3. Deploys to production
# 4. Sends deployment notification

Deployments typically complete in 2-3 minutes. You’ll receive email notifications for each deployment.


Production Checklist

Before announcing your production deployment:

Infrastructure:

  • Production Supabase project configured
  • All database migrations run
  • Environment variables set correctly
  • Custom domain configured (if using)
  • SSL certificate active

Testing:

  • Authentication tested end-to-end
  • MCP endpoints tested
  • Agent Cards tested (if using)
  • Publishing to Exchange tested (if using)
  • Mobile responsive design verified

Security:

  • Service role key secure (not in git)
  • RLS policies verified in Supabase
  • Auth redirect URLs configured
  • No sensitive data in logs

Monitoring (Optional):

  • Error tracking configured (Sentry, etc.)
  • Analytics enabled (Vercel Analytics, GA)
  • Uptime monitoring (UptimeRobot, etc.)

Monitoring & Maintenance

Vercel Analytics

Enable built-in analytics:

  1. Go to project Analytics tab
  2. Click “Enable Web Analytics”
  3. View real-time metrics:
    • Page views
    • Unique visitors
    • Core Web Vitals
    • Top pages

View Deployment Logs

Access logs for debugging:

  1. Go to Deployments tab
  2. Click on any deployment
  3. View:
    • Build Logs: Compilation output
    • Function Logs: Runtime logs from API routes
    • Static Logs: Static asset serving

Performance Monitoring

Check Core Web Vitals:

  1. AnalyticsWeb Vitals
  2. Monitor:
    • LCP (Largest Contentful Paint)
    • FID (First Input Delay)
    • CLS (Cumulative Layout Shift)
  3. Optimize as needed

Vercel automatically optimizes images, fonts, and static assets for best performance.


Environment Management

Multiple Environments

Set up staging and production environments:

EnvironmentBranchDomainSupabase
Productionmainma2d.yourdomain.comProduction project
Stagingstagingstaging-ma2d.vercel.appStaging project
PreviewFeature branchesAuto-generated URLsDevelopment project

Environment-Specific Variables

Configure different values per environment:

  1. Go to SettingsEnvironment Variables
  2. Click on a variable to edit
  3. Set different values for:
    • Production: Live data
    • Preview: Staging/dev data
    • Development: Local dev data

Example:

# Production
NEXT_PUBLIC_APP_URL=https://ma2d.yourdomain.com

# Preview
NEXT_PUBLIC_APP_URL=https://staging-ma2d.vercel.app

# Development
NEXT_PUBLIC_APP_URL=http://localhost:3000

Troubleshooting Deployment

Build fails with errors

Common causes:

  • TypeScript errors
  • Missing dependencies
  • Environment variables not set

Solutions:

  1. Test build locally: npm run build
  2. Fix TypeScript errors
  3. Verify all dependencies in package.json
  4. Check environment variables are set in Vercel
npm run build
 
# Should complete without errors
npm run type-check
 
# Or
npx tsc --noEmit

500 errors after deployment

Common causes:

  • Service role key incorrect or missing
  • Supabase project paused
  • Database migrations not run

Solutions:

  1. Verify SUPABASE_SERVICE_ROLE_KEY in Vercel settings
  2. Check Supabase project is active (not paused)
  3. Verify all migrations ran successfully
  4. Check function logs in Vercel for detailed errors

Authentication not working

Common causes:

  • Auth redirect URLs not configured
  • Wrong NEXT_PUBLIC_APP_URL
  • Email provider not enabled

Solutions:

  1. Update Supabase auth URLs to include Vercel domain
  2. Verify NEXT_PUBLIC_APP_URL matches deployment URL
  3. Enable email provider in Supabase AuthenticationProviders
  4. Check Supabase auth logs

MCP endpoints returning errors

Common causes:

  • Server not enabled
  • Tools/resources disabled
  • Database query errors

Solutions:

  1. Verify server exists and is enabled
  2. Check tools/resources/prompts are enabled
  3. Test database queries in Supabase SQL editor
  4. Check Vercel function logs for errors

Slow cold starts

Cause: Serverless functions have cold start latency

Solutions:

  1. Upgrade to Vercel Pro for faster cold starts
  2. Minimize bundle size:
    npm run build -- --analyze
  3. Use edge functions for critical paths (Vercel Pro)
  4. Keep functions warm with uptime monitoring

Scaling Considerations

Automatic Scaling

Vercel handles scaling automatically:

  • Unlimited serverless function instances
  • Global CDN for static assets
  • Automatic load balancing
  • No configuration needed

Database Scaling

As usage grows, consider:

Supabase Free Tier (~100 concurrent users):

  • 500 MB database
  • 2 GB bandwidth
  • 50,000 monthly active users

Supabase Pro (~1,000 concurrent users):

  • 8 GB database
  • 50 GB bandwidth
  • 100,000 monthly active users
  • Database backups
  • Read replicas

Supabase Enterprise (unlimited):

  • Custom resources
  • Dedicated support
  • SLA guarantees

Performance Optimization

Frontend:

  • Leverage Next.js image optimization
  • Use static generation where possible
  • Minimize JavaScript bundle size
  • Enable caching headers

Backend:

  • Add database indexes
  • Use connection pooling (Supabase automatic)
  • Optimize complex queries
  • Cache frequently accessed data

Cost Optimization

Vercel Free Tier Limits

  • 100 GB bandwidth per month
  • 6,000 build minutes per month
  • Unlimited team seats
  • Automatic HTTPS

Typical usage: Free tier covers small to medium applications

When to Upgrade to Pro

Consider Pro ($20/month per user) when you need:

  • More bandwidth (1 TB)
  • Faster builds (concurrent builds)
  • Edge functions
  • Analytics
  • Password protection
  • Commercial use support

Supabase Costs

Free tier: Sufficient for development and small production

Pro tier ($25/month): Upgrade when you need:

  • More database storage
  • More bandwidth
  • Daily backups
  • Better performance

Next Steps

Your A²D instance is deployed! 🎉

Configure the application:

Create content:


Need Help? See Deployment Troubleshooting or open an issue.