Skip to content

Quick Start

Follow these steps to get your development environment set up.

Clone the repository

Clone the NuxSaaS repository to your local machine:

bash
git clone https://github.com/NuxSaaS/NuxSaaS.git
cd NuxSaaS

Use Node.js v22 LTS

use nvm to install Node.js v22 LTS:

bash
nvm use

This command reads the .nvmrc file and switches to the specified Node.js version (v22 LTS).

Install dependencies

Install the project dependencies using npm, or use whatever package manager you prefer:

bash
npm install

Setup environment variables

Copy the example environment file and configure your local settings:

bash
cp .env.example .env

You'll need to edit the .env file to add your database credentials, API keys (e.g., Stripe, Resend), and other necessary configurations.

bash
# Description: Example of .env file
NUXT_NITRO_PRESET=node-server # node-server or cloudflare-module

# Cloudflare Hyperdrive ID, Required when using cloudflare-module
NUXT_CF_HYPERDRIVE_ID=cloudflare-hyperdrive-id

# App
NUXT_APP_URL=http://localhost:3000 # Base URL of your app
NUXT_APP_NAME=NuxSaaS
NUXT_APP_ENV=development
NUXT_APP_NOTIFY_EMAIL="[email protected]"
NUXT_APP_CONTACT_EMAIL="[email protected]"
NUXT_APP_REPO=https://github.com/NuxSaaS/NuxSaaS

NUXT_BETTER_AUTH_SECRET='' # Secret key for JWT

# Database, Required when using node-server preset
# Your need to create a database named nuxsaas or other name you want
NUXT_DATABASE_URL=postgres://postgres:@localhost:5432/nuxsaas 
# Redis, Required when using node-server preset
NUXT_REDIS_URL=redis://localhost:6379

# GitHub
NUXT_GH_CLIENT_ID=your-github-client-id
NUXT_GH_CLIENT_SECRET=your-github-client-secret

# Google
NUXT_GOOGLE_CLIENT_ID=your-google-client-id
NUXT_GOOGLE_CLIENT_SECRET=your-google-client-secret

# Resend
NUXT_RESEND_API_KEY=your-resend-api-key

# Stripe
NUXT_STRIPE_SECRET_KEY=your-stripe-secret-key
NUXT_STRIPE_WEBHOOK_SECRET=your-stripe-webhook-key
NUXT_STRIPE_PRICE_ID_PRO_MONTH=your-stripe-price-id-pro-month
NUXT_STRIPE_PRICE_ID_PRO_YEAR=your-stripe-price-id-pro-year

Generate and apply database migrations

Generate the database schema based on your models and apply the migrations:

bash
npm run db:generate
npm run db:migrate

Start development server

bash
npm run dev

Your application should now be running locally, typically at http://localhost:3000.