Clone the Next.js Supabase SaaS Kit Turbo Repository

Clone the Next.js Supabase SaaS Kit Turbo repository to your local machine.

Prerequisites

To get started with Makerkit, ensure you have the following prerequisites installed and set up:

  • Node.js 18.x or later
  • Docker
  • Pnpm
  • Supabase account (optional for local development)
  • Payment Gateway account (Stripe or Lemon Squeezy)
  • Email Service account (optional for local development)

Verify your Git username

To verify you have access, you need to check that your local Git username is the same as set up in the Makerkit's Github organization.

Please run the following command to check your Git username:

git config user.username

If the output is not your Github username, or does not match the username registered in Makerkit's Github organization, you can set it using the following command:

git config --global user.username <your-github-username>

NB: You must replace <your-github-username> with your actual Github username in between quotes.

For example, if your Github username is johndoe, you can set it using the following command:

git config --global user.username "johndoe"

This is important to ensure you can run the repository.

Cloning the Repository

Clone the repository using the following command:

git clone git@github.com:makerkit/next-supabase-saas-kit-turbo

Note: If your SSH key isn't set up, use HTTPS instead:

git clone https://github.com/makerkit/next-supabase-saas-kit-turbo

Important: Use HTTPS for All Commands if Not Using SSH

If you are not using SSH, ensure you switch to HTTPS for all Git commands, not just the clone command.

Configuring Git Remotes

After cloning the repository, remove the original origin remote:

git remote rm origin

Add the upstream remote pointing to the original repository to pull updates:

git remote add upstream git@github.com:makerkit/next-supabase-saas-kit-turbo

Once you have your own repository set up, add your repository as the origin:

git remote add origin <your-repository-url>

Keeping Your Repository Up to Date

To pull updates from the upstream repository, run the following command daily (preferably with your morning coffee ☕):

git pull upstream main

This ensures your repository stays up to date with the latest changes.

0.1. Install Pnpm

Install Pnpm globally with the following command:

npm i -g pnpm

1. Setup Dependencies

Install the necessary dependencies for the project:

pnpm i

With these steps completed, your development environment will be set up and ready to go! 🚀

2. Post-merge Hooks

It's very useful to run the following command after pulling updates from the upstream repository:

pnpm i

This ensures that any new dependencies are installed and the project is up to date. We can run this command automatically after pulling updates by setting up a post-merge hook.

Create a new file named post-merge in the .git/hooks directory:

touch .git/hooks/post-merge

Add the following content to the post-merge file:

#!/bin/bash
pnpm i

Make the post-merge file executable:

chmod +x .git/hooks/post-merge

Now, every time you pull updates from the upstream repository, the pnpm i command will run automatically to ensure your project is up to date. This ensures you're always working with the latest changes and dependencies and avoid errors that may arise from outdated dependencies.