Back
59/65
Lesson 59
8 min
Cloud & Database Tools
Deploy with PostgreSQL, Supabase, Vercel, and Wrangler
Ready to level up?
Mark complete to track your learning progress.
Deploy with PostgreSQL, Supabase, Vercel, and Wrangler
Mark complete to track your learning progress.
Deploy and manage cloud infrastructure with PostgreSQL, Supabase, Vercel, and Wrangler — the cloud stack that powers modern web applications.
ACFS installs CLI tools for the major cloud platforms used in modern web development. From local databases to edge computing, everything is configured and ready to go.
Production database with JSONB, full-text search
Auth, real-time, storage — Firebase alternative
Deploy Next.js with zero config
Cloudflare Workers, R2, D1 at the edge
Local database for development, testing, and direct production use.PostgreSQL 18 gives you JSONB document storage, full-text search, and row-level security out of the box.
1# Check PostgreSQL status2sudo systemctl status postgresql34# Connect to local database5psql -U postgres67# Create a database for your project8createdb myproject910# Common psql commands11\l -- List databases12\dt -- List tables13\d+ table -- Describe table with details14\q -- Quit1516# Run SQL from command line17psql -U postgres -d myproject -c "SELECT version();"1819# Dump a database20pg_dump myproject > backup.sql2122# Restore from dump23psql -U postgres -d myproject < backup.sql2425# PostgreSQL 18 features26# - JSONB for document storage27# - Full-text search built in28# - Row-level security (RLS) for multi-tenant
Backend-as-a-service with auth, database, storage, and real-time — all managed through the Supabase CLI.
1# Headless VPS auth: create an access token in the browser first2export SUPABASE_ACCESS_TOKEN="your-token-here"3supabase login --token "$SUPABASE_ACCESS_TOKEN"45# Initialize in your project6supabase init78# Link to a remote project9supabase link --project-ref <ref>1011# Start local development stack12supabase start13# → Starts local Postgres, Auth, Storage, Realtime1415# Run migrations16supabase db push1718# Generate TypeScript types from schema19supabase gen types typescript --linked > types/supabase.ts2021# Pull remote schema changes22supabase db pull2324# Reset local database25supabase db reset2627# Check project status28supabase status
supabase login --token ... or export SUPABASE_ACCESS_TOKEN for later commands.supabase gen types generates TypeScript types from your database schema. Run it after every migration to keep your types in sync.Deploy Next.js apps with zero configuration. Vercel handles builds, CDN, serverless functions, and preview deployments automatically.
1# Headless VPS auth: start the device flow from the VPS2vercel login34# Deploy current directory5vercel67# Deploy to production8vercel --prod910# Link to existing project11vercel link1213# Pull environment variables14vercel env pull .env.local1516# List deployments17vercel ls1819# View deployment logs20vercel logs <url>2122# Set environment variables23vercel env add STRIPE_KEY production2425# Preview deployment (creates unique URL)26vercel --prebuilt
vercel login now supports a device-login flow on headless terminals. Use VERCEL_TOKEN only when you specifically need non-interactive automation or CI auth.vercel and it handles the build configuration. Use vercel --prod for production deployments.Cloudflare Workers, R2 object storage, D1 database, and KV store — deploy serverless code to the edge in seconds.
1# Headless VPS auth: create a Cloudflare API token in the browser first2export CLOUDFLARE_API_TOKEN="your-token-here"3export CLOUDFLARE_ACCOUNT_ID="your-account-id"4wrangler whoami56# Initialize a Worker project7wrangler init my-worker89# Run Worker locally10wrangler dev1112# Deploy to Cloudflare13wrangler deploy1415# Manage KV namespaces16wrangler kv namespace list17wrangler kv key put --namespace-id <id> "key" "value"1819# R2 object storage20wrangler r2 bucket list21wrangler r2 object put my-bucket/file.txt --file ./file.txt2223# D1 database24wrangler d1 list25wrangler d1 execute my-db --command "SELECT * FROM users"2627# Tail production logs28wrangler tail
wrangler login expects a browser session. On a headless VPS, use CLOUDFLARE_API_TOKEN instead, and add CLOUDFLARE_ACCOUNT_ID for workflows that need an explicit account.How these tools work together in practice — from local development to production deployment:
PostgreSQL + Supabase local stack for development
Run against local database, generate types
Vercel deploys Next.js frontend
Wrangler deploys API routes to Cloudflare Workers