Challenges

Deploying Our App

Grab Environment Variables

Our app needs a few environment variables to function correctly. Before we add those environment variables, let's grab those:

GitHub Data Repository

For our app, we keep data inside a GitHub repository. For that, we need to add the following environment variables.

  • GITHUB_PAT
  • GITHUB_REPO_OWNER
  • GITHUB_REPO_NAME

You might already have this information since you use these for local development.

šŸ’” But it's a good practice to create a new repository & a new Private Access Token (PAT) for the production environment.

So, follow through the lesson 3 to create those & get above environment variables.

Social Authentication

For social authentication, we need to create a new GitHub OAuth application. For that, you can follow this step.

šŸ‘‹ But make sure to use the following URL as the callback URL:
<production-domain-of-your-app>/api/auth/callback

After this step, you will have values for the following environment variables:

  • GITHUB_CLIENT_ID
  • GITHUB_CLIENT_SECRET

Next Auth Configuration

Finally, we need one more environment variable showing our app's root URL to next-auth. So, we need to create another environment variable with:

NEXTAUTH_URL=<production-domain-of-your-app>

Lastly, you will have a set of environment variables similar to this:

GITHUB_PAT=8d332c80e58d33f0796df8ef598a54c5f7547501
GITHUB_REPO_OWNER=arunoda-local
GITHUB_REPO_NAME=bna-prod-data

GITHUB_CLIENT_ID=887396e795fc6cf83ebe
GITHUB_CLIENT_SECRET=b614f3f5022f7df87eca96afutdd7a9674dcdd1e

NEXTAUTH_URL=https://arunoda-bna.vercel.app

We will add these environment variables into our Vercel app in the next step.

šŸ™ We need your help

We need your help to keep maintain & add new content to this course. Here's how you can support us: