NextSaas
NextSaas
IntroductionGetting StartedConfigurationDatabaseAuthenticationEmailsInternationalizationPaymentsStorageDeploymentChangelog

Getting Started

How to install and run NextSaas locally.

To get started with NextSaas, you'll need to set up your development environment. We recommend using Bun for the best experience, but Node.js + npm/pnpm/yarn works too.

Prerequisites

  • Node.js: v20 or higher.
  • Package Manager: Bun (recommended) or npm/pnpm/yarn.
  • Git: For version control.
  • Editor: VS Code (recommended).

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/next-saas.git
    cd next-saas
  2. Install dependencies:

    We use bun for fast installations, but standard npm works as well.

    bun install
    # or
    npm install

Environment Setup

  1. Copy the example environment file:

    cp .env.simple .env
  2. Configure basic variables:

    Open .env and set the minimal required variables to run the app. For a quick start, you only need:

    • NEXT_PUBLIC_HOST (e.g., http://localhost:3000)
    • DATABASE_URL (PostgreSQL connection string)
    • BETTER_AUTH_SECRET (Generate one: openssl rand -base64 32)

    [!TIP] We will cover detailed configuration for Auth, Stripe, and Email in later sections.

Running Locally

Start the development server:

bun dev
# or
npm run dev

Visit http://localhost:3000 to see your app running.

Project Structure

Here's a quick look at the top-level structure:

  • src/app: Next.js App Router pages and API routes.
  • src/components: Reusable UI components.
  • src/lib: Utility functions and third-party integrations (Stripe, GitHub, etc.).
  • src/db: Database schema and Drizzle ORM configuration.
  • content/docs: Markdown content for this documentation site.
  • messages: Access next-intl translation files (en, zh-CN).

Introduction

Welcome to the NextSaas documentation.

Configuration

Customize your SaaS branding and settings.

On this page

PrerequisitesInstallationEnvironment SetupRunning LocallyProject Structure