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:
- A Stripe account. It’s free to create.
- A Vercel account. There’s a free plan.
- A database. Create a free one using Neon or Vercel.
- OAuth credentials (optional). See Auth.js Instructions.
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.
- Create a new project.
- Import a GitHub repo.
- 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 withsk_prod_...
. Can be found in the Stripe Dashboard under Developers -> API KeysSTRIPE_WEBHOOK_SECRET
:AUTH_SECRET
: Generate it withopenssl rand -base64 33
AUTH_*
: OAuth provider credentials. For example, GitHub would needAUTH_GITHUB_ID
&AUTH_GITHUB_SECRET
.
Deploy
Now anytime you push code to GitHub, it will automatically be deployed to Vercel.