Vercel Logo

Getting Started

After purchase you should have access to a zip file that includes all of the code in this project. If you wish to have direct access to the repository on GitHub, join our Discord and contact an admin.

Start by going into the root directory of the project and installing all of the dependencies of Build To Deploy using the npm run install command.

Next create a file named .env.local in the root directory.

Setting up Supabase

In this tutorial we are going to assume that you already have a Supabase account and have already created a organization/project within Supabase. If not, take a few minutes and set that up.

Creating Users table in Supabase

There is a database.sql file in the root directory of the project which handles creating the users table and setting up triggers within Supabase.

Here are the steps for running that database file:

  • Navigate to SQL Editor → New query.
  • Copy and Paste all of the SQL code within the database.sql into the SQL Editor and hit Run.

Once you have set up the users table, navigate to it by going to the Table Editor → users. Once there you must enable Row Level Security by clicking the button labeled as RLS.

If you don't see the users table make sure you have the public schema selected from the dropdown menu.

Adding Supabase environment variables

There are a couple environment variables that we must set for our frontend to work correctly. You can find those environment variables in the .env.local file in the root directory of this project. The variables we are looking to set at the moment are NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY.

Here is where you can find these variables:

  • NEXT_PUBLIC_SUPABASE_URL: Project Settings → API → Project URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY: Project Settings → API → Project API Keys

Social Login

Setting up the social login feature requires you to follow the steps found on Supabase. Navigate to Authentication → Providers to configure social authentication for different providers. In Build To Deploy we have setup buttons for Google and GitHub by default, just follow the steps provided by Supabase.

Payments

This project handles payments using Lemonsqueezy. Get started by creating an account and setting up a store by following their Documentation.

Webhooks

If you wish to update your frontend after a payment has been received you may do so using Webhooks provided by Lemonsqueezy. To create a new webhook, navigate to Settings → Webhooks and create a new webhook with the desired events. Once you have created your new webhook, copy your Webhook Secret and update the LEMON_SQUEEZY_WEBHOOK_SECRET into the .env.local file. Build To Deploy has a API route for handling webhooks recieved by Lemonsqueezy and you can find that in the app → payment → callback → route.ts.

Adding Lemonsqueezy environment variables

There are a couple environment variables that we must set for our payment integration to work correctly. You can find those environment variables in the .env.local file in the root directory of this project. The variables we are looking to set at the moment are LEMON_SQUEEY_URL, LEMON_SQUEEZY_API_KEY, and LEMON_SQUEEZY_WEBHOOK_SECRET.

  • LEMON_SQUEEY_URL: https://api.lemonsqueezy.com
  • LEMON_SQUEEZY_API_KEY: Settings → API → Create new API key
  • LEMON_SQUEEZY_WEBHOOK_SECRET: Set in the Webhook section
Each file contains helpful comments about the features it contains.