findly.tools

Deployment

Deploy your directory platform to production on Vercel with Supabase.

This guide assumes your platform is working locally and environment variables are configured.

Preparation: Local to Production

Setup production database (Supabase)

Create Supabase account and project:

  1. Go to supabase.com and create an account
  2. Create a new project
  3. Save your database password — you'll need it.

Connect to your project:

  1. Click "Connect" in the top navigation
  2. Click "ORM" and select "Drizzle"
  3. Copy your database URL from the connection details

Update local environment:

  1. Replace the DATABASE_URL in your .env file with your Supabase database URL.

    DATABASE_URL="postgresql://postgres.xxx:[YOUR-PASSWORD]@aws-0-region.pooler.supabase.com:5432/postgres"
  2. Replace [YOUR-PASSWORD] with your Supabase database password.

  3. Apply your schema to production database:

    bun db:push

Create your admin account:

  1. Visit http://localhost:3000 and sign in with Google/GitHub
  2. Open database studio: bun db:studio
  3. Go to the user table in Supabase
  4. Find your user record and change role from "user" to "admin"
  5. You'll now see an "Admin" button in your profile page that leads to /admin

Deploy to Vercel

Push your code to GitHub

First time? Create a GitHub repository first.

git add .
git commit -m "Ready for production deployment"
git push origin main

Import project to Vercel

  1. Go to vercel.com"New Project"
  2. Import your GitHub repository

Important: Before clicking "Deploy", add your environment variables by copying them from your .env file.

Deploy your project

Click "Deploy" and wait for the build to complete.

Domain configurations

At this point, the site is deployed but not working. You have to configure it to work properly.

Get your domain

Option 1: Use Vercel domain

  • Use the generated .vercel.app domain in the domain configuration section.

Option 2: Use your own domain

  1. Buy a domain (recommended: Spaceship or similar)
  2. Vercel Dashboard → "Domains" → Add your domain
  3. Follow DNS configuration instructions

Update environment variables with your domain

Once you have your final domain, update these variables:

Vercel Dashboard → SettingsEnvironment Variables

NEXT_PUBLIC_APP_URL="https://yourdomain.com"
BETTER_AUTH_URL="https://yourdomain.com"

Update OAuth providers with production URLs

Before redeploying, update your OAuth applications:

Google Cloud Console:

  • Authorized redirect URIs: https://yourdomain.com/api/auth/callback/google

GitHub OAuth App:

  • Authorization callback URL: https://yourdomain.com/api/auth/callback/github

Redeploy with updated configuration

Vercel Dashboard → Your project → Deployments → Click three dots on latest deployment → "Redeploy"

Final verification

Verify your configuration

Before launching, check that your lib/constants/config.ts is up to date:

// lib/constants/config.ts
export const SITE_CONFIG = {
  title: "YourDirectory.tools",
  description: "Find the best tools for your niche",
  tagline: "Your unique value proposition",
  url: "https://yourdomain.com",  // ← Update this
  author: "Your Name",           // ← Update this
  keywords: ["tools", "directory", "your-niche"],
  twitter: "@yourusername",      // ← Update this
  email: "contact@yourdomain.com", // ← Update this
};

Test production functionality

Authentication: Sign in/out with Google and GitHub

Tool submission: Submit a test tool (triggers subscription flow)

Subscription checkout: Complete Stripe payment flow

Image uploads: Test logo and screenshot uploads

Admin dashboard: Verify analytics and management features at /admin

Cron jobs (automated tasks)

The platform includes automated cron jobs configured in vercel.json:

{
  "crons": [
    {
      "path": "/api/cron/check-expired-subscriptions",
      "schedule": "0 0 * * *"
    },
    {
      "path": "/api/cron/process-expired-advertisements", 
      "schedule": "0 1 * * *"
    }
  ]
}

Schedule:

  • Subscriptions: Daily at midnight UTC (checks for expired subscriptions)
  • Advertisements: Daily at 1 AM UTC (processes expired advertisements)

Cron jobs are included in Vercel Pro plans and run automatically once deployed.

Switch to production mode

Stripe live mode (when ready for real payments)

Create live products in Stripe Dashboard matching your test setup

Update environment variables with live keys:

STRIPE_SECRET_KEY="sk_live_..."  # Not sk_test_
# Update all PRICE_ID variables with live price IDs

Configure production webhook:

  • Stripe Dashboard → Webhooks → Add endpoint
  • URL: https://yourdomain.com/api/auth/stripe/webhook
  • Events: checkout.session.completed, customer.subscription.updated, customer.subscription.deleted

Launch checklist

  • Production database (Supabase) configured and connected
  • Custom domain configured and SSL active
  • Environment variables updated with production values
  • OAuth providers updated with production redirect URLs
  • Admin user created and dashboard accessible
  • Site configuration updated in config.ts
  • Stripe products created (test mode initially)
  • Image uploads working with R2
  • All core functionality tested
  • Analytics configured (if using Plausible)

🎉 Your directory platform is now live and ready to generate revenue!


Affiliate Program

Earn $74.50 per sale.

Join affiliate program


Next: Learn how your platform generates money → Features