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
-
Clone the repository:
git clone https://github.com/your-username/next-saas.git cd next-saas -
Install dependencies:
We use
bunfor fast installations, but standardnpmworks as well.bun install # or npm install
Environment Setup
-
Copy the example environment file:
cp .env.simple .env -
Configure basic variables:
Open
.envand 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 devVisit 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).