This guide will walk you through setting up supastarter. We will go through the process of cloning the project, installing dependencies, setting up your database and running the local development server. ## Prerequisites Before you can get started, you will need to have the following installed on your machine. - [Node.js](https://nodejs.org/en/) (v20 or higher) - [Git](https://git-scm.com/) - [pnpm](https://pnpm.io/) - [VSCode](https://code.visualstudio.com/) (recommended, or any other code editor) ## Project setup ### Create a new database supastarter uses [Prisma](https://www.prisma.io/) as the default ORM (database access layer). This means you can use any database supported by Prisma, including PostgreSQL, MySQL and SQLite. You can find all supported databases [here](https://www.prisma.io/docs/reference/database-reference/supported-databases). Before creating a new supastarter project, make sure to have created a new database and have the connection string ready. For example when using PostgreSQL, the connection string will look something like this: ```bash copy postgresql://user:password@host:port/database ``` ### Initialize a new supastarter project During the setup process you will be asked to provide the following information: - **Project name** - The name of your project - **Database provider** - The database provider you are using - **Database connection string** - The connection string of your database To create a new supastarter project all you need to do is run the following command _(replace `my-awesome-project` with the name of your project)_: ```bash copy npx supastarter new my-awesome-project ``` This will clone and configure the supastarter repository, install all the dependencies and set up the database for you. **If you encounter any errors during the setup process, please try the manual setup instead.** First you need to clone the supastarter repository: ```bash git clone https://github.com/supastarter/supastarter-nuxt.git ``` Next, we are going to install all the dependencies. Make sure you have installed [pnpm](https://pnpm.io/) before running the following command: ```bash copy pnpm install ``` Now, we need to set up the environment variables. To do this, copy the .env.local.example file in the root of your project and rename it to .env.local. Then open the .env.local file and set at least the `DATABASE_URL`: ```bash copy title=".env.local" # Database DATABASE_URL="YOUR_DATABASE_CONNECTION_STRING" ``` This is also the place to set the variables for your mailing provider. Here are the necessary variables for each provider: - Resend -> `RESEND_API_KEY` - Postmark -> `POSTMARK_SERVER_TOKEN` - Mailgun -> `MAILGUN_DOMAIN`, `MAILGUN_API_KEY` - Nodemailer -> `MAIL_HOST`, `MAIL_PORT`, `MAIL_USER`, `MAIL_PASS` Next, we need to link the correct providers for payments and mailing. In the `packages/mail/provider/index.ts` file, set the export to the provider you want to use: ```ts copy export * from "./resend"; // or export * from './postmark'; // or export * from './mailgun'; // or export * from './nodemailer'; ``` Do the same for the payment provider in the `packages/payments/provider/index.ts` file: ```ts copy export * from "./stripe"; // or export * from './lemonsqueezy'; // or export * from './creem'; // or export * from './polar'; // or export * from './dodopayments'; ``` Next step is to migrate your database. Make sure to check your schema in `packages/database/prisma/schema.prisma` before. To push the schema to the database, run the following command: ```bash copy pnpm --filter database push ``` Then, to generate the Prisma client, run the following command: ```bash copy pnpm --filter database generate ``` The last step is to set the supastarter repository as the upstream origin for your project, so you can pull in updates in the future. Run the following commands: ```bash copy rm -rf .git git init git remote add upstream https://github.com/supastarter/supastarter-nuxt.git git add . git commit -m "Initial commit" ``` ### Set up your storage provider Storage is necessary to upload and serve files like images for example for the avatars of users and organizations. supastarter supports all S3-compatible storage providers like AWS S3, DigitalOcean Spaces, Cloudflare R2, MinIO, etc. [Storage setup guide](/docs/nuxt/storage/overview) ### Start your development server Now your app should be ready to go. To start the local development server, navigate into your project root folder and run the following command. ```bash copy pnpm dev ``` Open [http://localhost:3000](http://localhost:3000) in your browser to see the SaaS app and [http://localhost:3001](http://localhost:3001) for the marketing site.