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 NuxSaaSUse Node.js v22 LTS
use nvm to install Node.js v22 LTS:
bash
nvm useThis 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 installSetup environment variables
Copy the example environment file and configure your local settings:
bash
cp .env.example .envYou'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_NOTIFY_EMAIL="noreply@nuxsaas.com"
NUXT_APP_CONTACT_EMAIL="contact@nuxsaas.com"
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-yearGenerate and apply database migrations
Generate the database schema based on your models and apply the migrations:
bash
npm run db:generate
npm run db:migrateStart development server
bash
npm run devYour application should now be running locally, typically at http://localhost:3000.