In this guide, we will walk you through setting up account creation using Clerk for authentication. Follow these steps to get started.
First, use the provided use template button to generate your new repository for the SaaS project.
Once your repo is generated, clone the project to your local environment:
git clone https://github.com/your-username/your-repo.git
Navigate to the project folder and install all necessary dependencies:
yarn install
.env.local
FileIn the root of your project, create a .env.local file to store environment variables. This file will contain sensitive information required for your project.
First, go to Clerk and sign up for an account.
Once signed in, create a new project and choose the authentication providers you wish to enable (Google, GitHub, etc.).
After setting up your project on Clerk, copy the required environment variables to your .env.local file. These variables can be found in your Clerk project dashboard.
Your .env.local file should look something like this:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_**************
CLERK_SECRET_KEY=sk_test_**
Now that everything is set up, run the project locally:
yarn dev
This will start the development server, and you should be able to see the landing page like this screenshot.
Click on the Sign In button and choose the provider you configured in Clerk. Once authenticated, you will be successfully signed in to the platform !
You can now connect and see your user to the clerk dashboard, Congratulation ! 🎉
However, we want to handle the user in our Supabase database to also manage his subscription. Let's dive into the next page to connect the database to the project !