Skip to main content
This guide covers deploying Dependify to production. The system uses three separate platforms:
  • Vercel - Frontend hosting with edge optimization
  • Render - Backend API hosting with auto-scaling
  • Modal - Serverless containers for parallel processing

Architecture Overview

User → Vercel (Frontend) → Render (Backend API) → Modal Containers → Groq AI
                              ↓                      ↓
                         Supabase (Real-time)   GitHub API

Prerequisites

1

Create accounts

Sign up for the following services:
2

Prepare environment variables

Have all your API keys and secrets ready. See the Environment Variables page for the complete list.
3

GitHub repository

Ensure your code is pushed to a GitHub repository that Vercel and Render can access.

Deploy Modal Containers

Deploy the serverless containers first, as the backend depends on them.
1

Install Modal CLI

pip install modal
modal setup
Follow the prompts to authenticate with your Modal account.
2

Create Modal secrets

modal secret create GROQ_API_KEY
modal secret create SUPABASE_URL
modal secret create SUPABASE_KEY
Enter the values when prompted.
3

Deploy analysis container

From the backend/ directory:
modal deploy containers.py
This deploys the groq-read app for analyzing repository files.
4

Deploy refactoring container

modal deploy modal_write.py
This deploys the groq-write app for refactoring code with AI.
5

Verify deployment

Check your Modal dashboard to confirm both apps are deployed:
  • groq-read with run_script function
  • groq-write with process_file function
Modal apps are serverless and will auto-scale from 0 to 100+ containers based on load.

Deploy Backend to Render

The backend API runs on Render’s Python environment.
1

Create new Web Service

  1. Go to Render Dashboard
  2. Click “New +” → “Web Service”
  3. Connect your GitHub repository
  4. Select the repository containing Dependify
2

Configure build settings

Use the following settings:
Name
string
dependify-api (or your preferred name)
Region
string
Choose closest to your users (e.g., Oregon, Frankfurt)
Branch
string
master or main
Root Directory
string
Leave empty (repo root)
Environment
string
Python 3
Build Command
string
cd backend && pip install -r requirements.txt
Start Command
string
cd backend && python3 server.py
These values match the configuration in render.yaml.
3

Set environment variables

In the Render dashboard, add all backend environment variables:
# AI & Processing
GROQ_API_KEY=gsk_...

# Database
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=eyJ... # Service role key

# GitHub
GITHUB_CLIENT_ID=Iv1...
GITHUB_CLIENT_SECRET=abc...
GITHUB_TOKEN=ghp_... # Personal access token with 'repo' scope

# Security
API_SECRET_KEY=your-random-secret

# Frontend CORS
FRONTEND_URL=https://your-app.vercel.app

# Python version
PYTHON_VERSION=3.11.0
Update FRONTEND_URL with your actual Vercel domain after deploying the frontend.
4

Deploy

Click “Create Web Service”. Render will:
  1. Clone your repository
  2. Install dependencies
  3. Start the FastAPI server
  4. Provide you with a URL like https://dependify-api.onrender.com
Monitor the deployment logs for any errors.
5

Verify deployment

Once deployed, test the API:
curl https://your-render-url.onrender.com/health
Expected response:
{
  "status": "healthy",
  "version": "2.0.0",
  "message": "Dependify API is running"
}

Deploy Frontend to Vercel

The frontend is deployed to Vercel for optimal Next.js performance.
1

Import project

  1. Go to Vercel Dashboard
  2. Click “Add New…” → “Project”
  3. Import your GitHub repository
  4. Select the repository containing Dependify
2

Configure project

Framework Preset
string
Next.js (auto-detected)
Root Directory
string
frontend
Build Command
string
pnpm build
Output Directory
string
.next (default)
Install Command
string
pnpm install
3

Set environment variables

Add the following environment variables in Vercel:
NEXT_PUBLIC_GITHUB_CLIENT_ID=Iv1...
NEXT_PUBLIC_API_URL=https://your-render-url.onrender.com
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ... # Anon key, not service role
Make sure NEXT_PUBLIC_API_URL points to your Render backend URL.
4

Deploy

Click “Deploy”. Vercel will:
  1. Build your Next.js app with Turbopack
  2. Deploy to their edge network
  3. Provide you with URLs like:
    • Production: https://dependify.vercel.app
    • Preview: https://dependify-git-branch.vercel.app
5

Update CORS configuration

After deployment, update your backend’s FRONTEND_URL on Render:
  1. Go to Render dashboard → Your service → Environment
  2. Update FRONTEND_URL to your Vercel production URL
  3. Save changes and wait for redeployment

Configure GitHub OAuth

Update your GitHub OAuth app with production URLs.
2

Edit your OAuth app

Update:
  • Homepage URL: https://your-app.vercel.app
  • Authorization callback URL: https://your-app.vercel.app/auth/callback
The callback URL must match exactly. No trailing slashes.
3

Test authentication flow

Visit your production site and test GitHub login to ensure OAuth is working.

Domain Configuration (Optional)

Set up custom domains for professional URLs.

Frontend Domain (Vercel)

1

Add custom domain

In Vercel project settings:
  1. Go to “Settings” → “Domains”
  2. Add your domain (e.g., dependify.yourdomain.com)
  3. Follow DNS configuration instructions
2

Update DNS records

Add the following records to your DNS provider:
Type: CNAME
Name: dependify
Value: cname.vercel-dns.com
3

Update environment variables

Update FRONTEND_URL on Render to use your custom domain.

Backend Domain (Render)

1

Add custom domain

In Render service settings:
  1. Go to “Settings” → “Custom Domains”
  2. Add your domain (e.g., api.yourdomain.com)
2

Update DNS records

Add the provided CNAME record to your DNS:
Type: CNAME
Name: api
Value: your-service.onrender.com
3

Update frontend configuration

Update NEXT_PUBLIC_API_URL on Vercel to use your custom domain.

Monitoring and Logs

Render Logs

View backend logs in real-time:
  1. Go to Render dashboard → Your service → “Logs”
  2. Monitor for errors or performance issues
  3. Set up log alerts for critical errors

Vercel Logs

View frontend logs:
  1. Go to Vercel project → “Deployments” → Select deployment
  2. Click “Functions” tab for serverless function logs
  3. Use Vercel Analytics for performance monitoring
View container execution logs:
  1. Go to Modal dashboard → Your app
  2. Click on function name (run_script or process_file)
  3. View recent executions and error traces

Continuous Deployment

Both Vercel and Render support automatic deployments.
1

Enable auto-deploy on Vercel

Automatic by default. Every push to your main branch triggers a deployment.
2

Enable auto-deploy on Render

In Render service settings:
  1. Go to “Settings” → “Build & Deploy”
  2. Enable “Auto-Deploy”
  3. Select branch (e.g., master or main)
3

Preview deployments

  • Vercel creates preview deployments for all branches and PRs
  • Render can be configured for preview environments with separate services

Scaling Configuration

Render Scaling

Instance Type
string
  • Free: Limited hours, cold starts
  • Starter: Always-on, 0.5 GB RAM
  • Standard: Auto-scaling, 2+ GB RAM (recommended for production)
Modal auto-scales by default:
  • Min containers: 3 (configured in modal_write.py)
  • Max containers: 100 (configurable)
  • Timeout: 300 seconds per file (5 minutes)
To adjust scaling:
# backend/modal_write.py
@app.function(
    timeout=300,
    max_containers=100,  # Increase for larger scale
    min_containers=3,    # Keep warm for faster response
    secrets=[...]
)

Environment-Specific Secrets

Development

Use .env files locally. Never commit to git.

Production

Use platform-native secret management:
  • Render: Environment Variables
  • Vercel: Environment Variables
  • Modal: modal secret CLI

Security Checklist

1

API keys are secret

  • ✅ All secrets stored in platform environment variables
  • ✅ No secrets in git repository
  • ✅ Different keys for dev and production
2

CORS is configured

  • FRONTEND_URL points to production domain
  • ✅ No wildcard CORS origins in production
3

Rate limiting is enabled

  • RATE_LIMIT_PER_HOUR set appropriately
  • ✅ Monitor rate limit violations in logs
4

HTTPS is enforced

  • ✅ Vercel provides automatic HTTPS
  • ✅ Render provides automatic HTTPS
  • ✅ GitHub OAuth callback uses HTTPS

Troubleshooting

Render free tier has cold starts. Solutions:
  1. Upgrade to Starter plan for always-on service
  2. Add health check pings to keep service warm
  3. Check Render logs for startup errors
  1. Verify FRONTEND_URL on Render matches Vercel URL exactly
  2. No trailing slashes in URLs
  3. Restart Render service after changing environment variables
  4. Check browser console for specific CORS error
  1. Verify OAuth app callback URL matches Vercel URL
  2. Ensure GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET are correct
  3. Test OAuth flow in incognito mode
  4. Check Render logs for authentication errors

Next Steps

Monitor Performance

Set up monitoring with Vercel Analytics and Render metrics

Set Up Alerts

Configure email alerts for deployment failures and errors

Review Logs

Regularly check logs for errors and optimization opportunities

Scale Resources

Monitor usage and upgrade plans as traffic grows

Build docs developers (and LLMs) love