GigPilot AI SaaS Deployment Guide
Overview: This production deployment guide provides step-by-step instructions for provisioning Supabase database migrations, deploying the Fastify API backend to Render.com, deploying the Astro SSR frontend to Cloudflare Pages / Workers, and setting up Upstash Redis caching.
1. Database Setup (Supabase)
- Create a new project in the Supabase Dashboard.
- Open the SQL Editor in your Supabase project.
- Paste and run the SQL migration script from
apps/backend/supabase_schema.sqlto initialize:- Primary and foreign keys
- Indexes for search optimization
- Row Level Security (RLS) policies
- Automated profile triggers on user registration
- Create a bucket in the Storage section named
gigpilot-assetsand configure it to be private (the backend generates signed URLs to control access).
2. Backend Server Deployment (Render)
Deploy the Fastify API application to Render as a Web Service:
- Connect your Github repository to Render.
- Select the
apps/backenddirectory as the Root Directory of the service. - Configure the build settings:
- Environment:
Node - Build Command:
npm install && npm run build - Start Command:
npm start
- Environment:
- Add the following Environment Variables in the Render dashboard:
NODE_ENV:productionPORT:10000(or leave default)SUPABASE_URL:<your-supabase-project-url>SUPABASE_ANON_KEY:<your-supabase-client-anon-key>SUPABASE_SERVICE_ROLE_KEY:<your-supabase-service-role-key>(used for admin syncs, keep secret!)JWT_SECRET:<a-secure-random-string>REDIS_URL:rediss://default:<password>@<endpoint>:<port>(from Upstash console)FRONTEND_URL:https://your-domain.cloudflare.workers.dev(the URL of your deployed CF frontend, used for CORS configuration)
3. Frontend Deployment (Cloudflare Workers)
Deploy the Astro application to Cloudflare Workers using Wrangler:
- Log into your Cloudflare account from the command line:
Terminal window npx wrangler login - Navigate to
apps/frontendand editwrangler.tomlif you need custom route rules. - Add environmental variables for frontend compilation inside
apps/frontend/.env:PUBLIC_API_URL:https://your-backend-url.onrender.comPUBLIC_SUPABASE_URL:<your-supabase-project-url>PUBLIC_SUPABASE_ANON_KEY:<your-supabase-client-anon-key>
- Build and deploy the Astro application:
Terminal window npm run buildnpx wrangler deploy
4. Cache & Queue Setup (Upstash Redis)
- Log in to Upstash and create a new Serverless Redis database.
- Locate the connection details:
- Copy the Redis URL starting with
rediss://...and input it asREDIS_URLin the Render environment settings. - For HTTP REST connections, copy the REST URL and token for cache clients.
- Copy the Redis URL starting with
- Enable SSL support (
rediss://) to encrypt cached traffic in transit.

