Deployment

This guide will walk you through setting up hosting with Vercel and GitHub.

Note that AirBadge works with almost any hosting provider, including Fly, Railway, Netlify, Docker, and many more.

Before you start

Here’s what you’ll need:

Create a database

The production database can be migrated via your local machine. Just specify your production DATABASE_URL on the command line:

DATABASE_URL=... pnpm prisma db push

Setup OAuth Credentials

This step is optional and only required if you are using OAuth.

See Auth.js’s Guide for more information about setting up OAuth providers.

Setup hosting

The easiest way to set up hosting with Vercel is via a GitHub connection.

  1. Create a new project.
  2. Import a GitHub repo.
  3. Setup environment variables (detailed below).

Environment Variables

Select the project in Vercel, and go to Settings -> Environment Variables.

Then you’ll need the following variables:

  • DOMAIN: The base url of your app. For example: https://example.tld
  • DATABASE_URL: The URL to the database. For example: postgresql://user:password@host:5432/dbname?schema=public.
  • SECRET_STRIPE_KEY: Your secret Stripe key. Starts with sk_prod_.... Can be found in the Stripe Dashboard under Developers -> API Keys
  • STRIPE_WEBHOOK_SECRET:
  • AUTH_SECRET: Generate it with openssl rand -base64 33
  • AUTH_*: OAuth provider credentials. For example, GitHub would need AUTH_GITHUB_ID & AUTH_GITHUB_SECRET.

Deploy

Now anytime you push code to GitHub, it will automatically be deployed to Vercel.