This commit is contained in:
giancarlo
2024-03-24 02:23:22 +08:00
parent 648d77b430
commit bce3479368
589 changed files with 37067 additions and 9596 deletions

View File

@@ -0,0 +1,85 @@
---
title: Installing Makerkit
label: Installing Makerkit
description: Learn how to install Makerkit on your local machine
---
If you have bought a license for MakerKit, you have access to all the
repositories built by the MakerKit team. In this document, we will learn how
to fetch and install the codebase.
### Requirements
To get started with the Next.js and Supabase SaaS template, we need to ensure
you install the required software.
- Node.js
- Git
- Docker
### Getting Started with MakerKit
You have two choices for cloning the repository:
1. forking the original repository and cloning it from your fork
2. cloning it manually from the original repository
#### Clone the repository
To get the codebase on your local machine using the original repository, clone the repository with the
following command:
```
git clone --depth=1 git@github.com:makerkit/next-supabase-saas-kit-lite.git my-saas
```
The command above clones the repository in the folder `my-saas` which
you can rename it with the name of your project.
If you forked the repository, point it to your fork instead of the original.
#### Initializing Git
Now, run the following commands for:
1. Moving into the folder
2. Reinitialize your git repository
Personally I re-initialize the Git repository, but it's not required.
```
cd my-saas
rm -rf .git
git init
```
### Setting the Upstream repository, and fetching updates
Now, we can add the original Makerkit repository as "upstream" so we can fetch updates from the main repository:
```
git remote add upstream git@github.com:makerkit/next-supabase-saas-kit-lite.git
git add .
git commit -a -m "Initial Commit"
```
In this way, to fetch updates (after committing your files), simply run:
```
git pull upstream main --allow-unrelated-histories
```
You'll likely run into conflicts when running this command, so carefully choose the changes (sorry!).
### Installing the Node dependencies
Finally, we can install the NodeJS dependencies with `npm`:
```
npm i
```
While the application code is fully working, we now need to set up your Supabase
project.
So let's jump on to the next step!

View File

@@ -0,0 +1,85 @@
---
title: Clone the MakerKit SaaS boilerplate repository
label: Clone the repository
description: Learn how to clone the MakerKit repository and install the NodeJS dependencies.
---
If you have bought a license for MakerKit, you have access to all the
repositories built by the MakerKit team. In this document, we will learn how
to fetch and install the codebase.
### Requirements
To get started with the Next.js and Supabase SaaS template, we need to ensure
you install the required software.
- Node.js
- Git
- Docker
### Getting Started with MakerKit
You have two choices for cloning the repository:
1. forking the original repository and cloning it from your fork
2. cloning it manually from the original repository
#### Clone the repository
To get the codebase on your local machine using the original repository, clone the repository with the
following command:
```
git clone --depth=1 git@github.com:makerkit/next-supabase-saas-kit-lite.git my-saas
```
The command above clones the repository in the folder `my-saas` which
you can rename it with the name of your project.
If you forked the repository, point it to your fork instead of the original.
#### Initializing Git
Now, run the following commands for:
1. Moving into the folder
2. Reinitialize your git repository
Personally I re-initialize the Git repository, but it's not required.
```
cd my-saas
rm -rf .git
git init
```
### Setting the Upstream repository, and fetching updates
Now, we can add the original Makerkit repository as "upstream" so we can fetch updates from the main repository:
```
git remote add upstream git@github.com:makerkit/next-supabase-saas-kit-lite.git
git add .
git commit -a -m "Initial Commit"
```
In this way, to fetch updates (after committing your files), simply run:
```
git pull upstream main --allow-unrelated-histories
```
You'll likely run into conflicts when running this command, so carefully choose the changes (sorry!).
### Installing the Node dependencies
Finally, we can install the NodeJS dependencies with `npm`:
```
npm i
```
While the application code is fully working, we now need to set up your Supabase
project.
So let's jump on to the next step!

View File

@@ -0,0 +1,17 @@
---
title: Running the Next.js Server
label: Next.js
description: Learn how to run the Next.js server on your local machine.
---
First, we can run the Next.js Server by running the following command:
```bash
npm run dev
```
If everything goes well, your server should be running at
[http://localhost:3000](http://localhost:3000).
With the server running, we can now set up our Supabase containers using
Docker. Jump to the next section to learn how to do that.

View File

@@ -0,0 +1,88 @@
---
title: Running the Supabase Containers
label: Supabase
description: Running the Supabase containers locally for development
---
Before we can run the Supabase local environment, we need to run Docker, as Supabase uses it for running its local environment.
You can use Docker Desktop, Colima, OrbStack, or any other Docker-compatible solution.
### Running the Supabase Environment
First, let's run the Supabase environment, which will spin up a local
instance using Docker. We can do this by running the following command:
```bash
npm run supabase:start
```
Additionally, it imports the default seed data. We use it this data to
populate the database with some initial data and execute the E2E tests.
After running the command above, you will be able to access the Supabase
Studio UI at [http://localhost:54323/](http://localhost:54323/).
### Adding the Supabase Keys to the Environment Variables
If this is the first time you run this command, we will need to get the
Supabase keys and add them to our local environment variables configuration
file `.env`.
When running the command, we will see a message like this:
```bash
> supabase start
Applying migration 20221215192558_schema.sql...
Seeding data supabase/seed.sql...
Started supabase local development setup.
API URL: http://localhost:54321
DB URL: postgresql://postgres:postgres@localhost:54322/postgres
Studio URL: http://localhost:54323
Inbucket URL: http://localhost:54324
JWT secret: super-secret-jwt-token-with-at-least-32-characters-long
anon key: ****************************************************
service_role key: ****************************************************
```
Now, we need to copy the `anon key` and `service_role key` values and add
them to the `.env` file:
```
NEXT_PUBLIC_SUPABASE_ANON_KEY=****************************************************
SUPABASE_SERVICE_ROLE_KEY=****************************************************
```
### Running the Stripe CLI
Run the Stripe CLI with the following command:
```bash
npm run stripe:listen
```
#### Add the Stripe Webhooks Key to your environment file
If this is the first time you run this command, you will need to copy the Webhooks key printed on the console and add it to your development environment variables file:
```bash title=".env.development"
STRIPE_WEBHOOKS_KEY=<PASTE_KEY_HERE>
```
#### Signing In for the first time
You should now be able to sign in. To quickly get started, use the following credentials:
```
email = test@makerkit.dev
password = testingpassword
```
#### Email Confirmations
When signing up, Supabase sends an email confirmation to a testing account. You can access the InBucket testing emails [using the following link](http://localhost:54324/monitor), and can follow the links to complete the sign up process.

View File

@@ -0,0 +1,19 @@
---
title: Running the Stripe CLI for Webhooks
label: Stripe
description: How to run the Stripe CLI for Webhooks in a local development environment
---
Run the Stripe CLI with the following command:
```bash
npm run stripe:listen
```
#### Add the Stripe Webhooks Key to your environment file
If this is the first time you run this command, you will need to copy the Webhooks key printed on the console and add it to your development environment variables file:
```bash title=".env.development"
STRIPE_WEBHOOKS_KEY=<PASTE_KEY_HERE>
```

View File

@@ -0,0 +1,20 @@
---
title: Running the Application
label: Running the Application
description: How to run the application in development mode
---
After installing the modules, we can finally run the
application in development mode.
We need to execute two commands (and an optional one for Stripe):
1. **Next.js Server**: the first command is for running the Next.js server
2. **Supabase Environment**: the second command is for running the Supabase
environment with Docker
3. **Stripe CLI**: finally, the Stripe CLI is needed to dispatch webhooks to
our local server (optional, only needed when interacting with Stripe)
## About this Documentation
This documentation complements the Supabase one and is not meant to be a replacement. We recommend reading the Supabase documentation to get a better understanding of the Supabase concepts and how to use it.

View File

@@ -0,0 +1,12 @@
---
title: Getting Started
label: Getting Started
description: Getting started with the Makerkit Kit
---
Makerkit is a Next.js/Remix SaaS Starter that helps you build your own SaaS in minutes. It comes with a fully integrated Stripe billing system, a landing page, and a dashboard.
In this section, we learn how to install and run the SaaS kit on your local
machine.
Buckle up and let's get started!