StackbaseStackbase
Getting Started

Installation

Step-by-step guide to create your new project

Installation

Get your Stackbase project up and running in minutes.

Prerequisites

Before you begin, make sure you have the following installed on your system:

Node.js 24+

Download from nodejs.org

pnpm (Recommended)

Fast, disk space efficient package manager

Verify Your Installation

Check that Node.js is installed correctly:

node --version
# Should output: v20.x.x or higher

While pnpm is recommended for its speed and efficiency, you can also use npm or bun. The CLI will detect your preferred package manager during setup.

Create Your Project

Run the following command and follow the prompts:

pnpm dlx stackbase@latest init

You'll be asked:

  1. Project name - Enter your project name (e.g., my-saas-app)
  2. Template - Choose between base (full-stack), web (frontend-only), or api (backend services)
  3. Package manager - Choose between pnpm, npm, or bun
  4. Docker - Opt to include Dockerfile and Docker Compose configurations
  5. Kubernetes - Opt to include production Kubernetes manifests and Ingress rules (Docker required)
  6. Observability - Choose to include Prometheus and Grafana metrics monitoring stack
  7. Prisma Studio - Choose to include Prisma Studio for database management

The CLI will scaffold your selected template, configure environment files, and install all dependencies. This usually takes under a minute.

Option 2: Direct Installation

You can also specify non-interactive flags directly for rapid setups and CI/CD:

# Full-stack default project
pnpm dlx stackbase@latest init my-project -y

# Explicit feature flags with Bun
pnpm dlx stackbase@latest init my-app -t base -p bun --docker --obs --studio

What Gets Created?

After scaffolding the base template, you'll have this complete structure:

my-project/
├── apps/
│   ├── web/              # Next.js frontend
│   ├── api/              # Express backend
│   ├── email/            # React Email preview server
│   └── studio/           # Prisma Studio database UI
├── packages/
│   ├── auth/             # Better Auth configuration
│   ├── contracts/        # Shared Zod validation contracts
│   ├── db/               # Prisma ORM & database migrations
│   ├── email/            # React Email components & templates
│   ├── logger/           # Pino structured logging
│   ├── rate-limit/       # API rate limiting
│   ├── storage/          # S3-compatible cloud object storage
│   ├── ui/               # shadcn/ui React components
│   └── utils/            # Shared utilities & helpers
├── package.json
├── turbo.json
└── pnpm-workspace.yaml

Post-Installation Steps

1. Navigate to Your Project

cd my-project

2. Open in Your Editor

code .  # VS Code
# or
cursor .  # Cursor

3. Review the Files

Take a moment to explore:

  • README.md - Project overview and commands
  • turbo.json - Turborepo pipeline configuration
  • package.json - Available scripts and dependencies

Environment Configuration

Before running the project, you need to configure environment variables. We'll cover this in detail in the next section.

Alternative Installation Methods

Clone the Repository

If you want to contribute or explore the source code:

# Clone the repository
git clone https://github.com/stackbase-labs/stackbase.git

# Navigate to the directory
cd stackbase

# Install dependencies
pnpm install

# Copy environment files
cp apps/web/.env.example apps/web/.env.local
cp apps/api/.env.example apps/api/.env.local
cp packages/db/.env.example packages/db/.env.local

Use as Template

You can also use it as a GitHub template:

  1. Visit github.com/stackbase-labs/stackbase
  2. Click "Use this template"
  3. Create your repository
  4. Clone and install dependencies

Quick tip: Run pnpm dev from the root to start all applications simultaneously. We'll cover this in detail in the next section.

On this page