Skip to content
stackbase-labsPublic

About

The open-source full-stack monorepo framework. Scaffold Next.js 16, Express, Better Auth, Prisma, and Docker/K8s in one command.

Topics

Resources

Contributing

Security policy

Stars

43 stars

Watchers

0 watching

Forks

Latest commit

 

History

266 Commits

Folders and files

Repository files navigation

Stackbase

CI npm version npm downloads build-elevate downloads License: MIT Docs GitHub

The open-source full-stack monorepo framework.

Stackbase Banner

Tip

Built for SaaS teams, startups, and developers who want a production-ready foundation without rebuilding the same setup.

Stackbase is an open-source, production-ready full-stack monorepo framework. Stop rebuilding auth, databases, Docker configs, and API middleware. Scaffold a complete Turborepo in minutes with authentication, database, email templates, UI components, rate limiting, and deployment configs already wired together.

Built with Turborepo, Next.js 16, Express, Better Auth, Prisma, and shadcn/ui, it gives you a cohesive base for shipping real products faster.

Who It's For

Stackbase is built for teams and builders who want a real application foundation before they start product work.

  • Founders and solo builders who want to ship an MVP without spending the first week wiring auth, database, email, and deployment basics.
  • SaaS and agency teams that need consistent project structure, shared packages, and repeatable setup across client or product work.
  • Developers learning production architecture who want to study a full-stack monorepo with real auth, database, API, UI, and deployment patterns.

Contents

Quick Start

Requirements

  • Node.js 24+
  • pnpm, npm, or Bun
  • Docker Desktop, if you enable Docker-based workflows

1. Create a Project

pnpm dlx stackbase@latest init my-app

2. Configure Environment Variables

Navigate into your project and update the generated .env.local files with your database credentials and secrets:

cd my-app

Key environment files:

File Purpose
packages/db/.env.local PostgreSQL connection string
packages/auth/.env.local Better Auth secret & OAuth credentials
apps/web/.env.local Web app and auth callback URLs
apps/api/.env.local API server, CORS, and auth setup
packages/email/.env.local Email provider credentials
packages/storage/.env.local S3-compatible storage settings
packages/rate-limit/.env.local Redis rate-limit settings

The CLI automatically initializes .env.local files from .env.example templates during project creation.

3. Start Development

pnpm dev

Default local services:

Service URL
Web app http://localhost:3000
API http://localhost:4000
Email preview http://localhost:3002
Prisma Studio http://localhost:5555

For complete CLI commands, flags, and options, see the CLI Documentation.

Templates

Stackbase provides dedicated standalone templates in templates/:

Template Best For Includes
base Complete application starter Web, API, auth, database, email, storage, Docker, Observability, Kubernetes
web Frontend-led products Web app, UI, auth, database, email, storage packages, Docker
api Backend services API, database, auth, storage, contracts, rate limiting, Docker, Observability

fullstack is supported as a backwards-compatible alias for base.

Generated Project

The full generated project uses this structure after stackbase init:

my-app/
├── apps/
│   ├── web/              # Next.js frontend
│   ├── api/              # Express API
│   ├── email/            # React Email preview
│   └── studio/           # Prisma Studio wrapper
├── packages/
│   ├── auth/             # Better Auth setup
│   ├── db/               # Prisma schema and client
│   ├── ui/               # shadcn/ui component package
│   ├── email/            # Transactional email package
│   ├── storage/          # Object storage helpers
│   ├── rate-limit/       # Upstash Redis rate limits
│   ├── contracts/        # Shared validation schemas
│   ├── logger/           # Shared logging
│   ├── utils/            # Shared utilities
│   ├── eslint-config/
│   ├── prettier-config/
│   ├── typescript-config/
│   └── vitest-presets/
├── docker-compose.yml
├── pnpm-workspace.yaml
├── turbo.json
└── package.json

Each template contains only the applications and packages relevant to its target architecture.

What's Included

Area Stackbase Includes
Frontend Next.js 16, React, Tailwind CSS, shadcn/ui, dashboard patterns
API Express, typed middleware, CORS, errors, health checks
Auth Better Auth, sessions, OAuth-ready structure, 2FA flows
Database Prisma, PostgreSQL, generated client, Studio workflow
Email React Email templates with Resend integration
Storage S3-compatible upload and delete helpers
Rate limiting Upstash Redis limiters for API and auth flows
Observability Prometheus metrics and Grafana dashboard provisioning
Deployment Docker Compose, production Dockerfiles, Kubernetes manifests
Quality TypeScript, ESLint, Prettier, Vitest, shared workspace config
Updates .stackbase.json, stackbase migrate, upgrades, conflict diffs

Repository Layout

This repository is both the product source and the template registry.

stackbase/
├── apps/
│   └── docs/                  # Documentation site
├── packages/
│   └── stackbase/             # Public CLI package
├── templates/
│   ├── base/                  # Full-stack application template
│   ├── web/                   # Web application template
│   └── api/                   # API application template
├── assets/                    # Repository assets
├── CHANGELOG.md
├── pnpm-workspace.yaml
└── package.json

The CLI downloads the chosen template from templates/ via the repository archive downloader and applies project-name replacement, package-manager configuration, environment setup, optional feature configuration, and manifest generation.

Development

Install dependencies:

pnpm install

Run the docs app from the repository root:

pnpm dev

Work on the CLI:

pnpm --filter ./packages/stackbase check-types
pnpm --filter ./packages/stackbase build
node packages/stackbase/dist/index.js --help

Run checks:

pnpm lint
pnpm check-types
pnpm test
pnpm format:check

Template packages live under templates/base, but they are still part of the pnpm workspace so docs and CLI verification can resolve shared packages locally.

Deployment

Generated projects include deployment assets:

  • Docker Compose for local and production workflows
  • Production Dockerfiles for apps/web and apps/api
  • Kubernetes manifests under k8s/
  • Prometheus and Grafana config under deploy/observability/

Deployment docs:

Build Elevate

Stackbase is the successor to Build Elevate.

  • New projects should use stackbase.
  • Existing Build Elevate projects can preview the move with pnpm dlx stackbase@latest migrate --dry-run.
  • Run pnpm dlx stackbase@latest migrate to convert .build-elevate.json, update safe files, and preserve local changes.
  • The original manifest is saved as .build-elevate.json.bak and can be deleted after the migrated project passes its checks.
  • See the migration guide for conflict handling and verification.

Contributing

Contributions are welcome.

  1. Fork the repository and create a branch from main.
  2. Install dependencies with pnpm install.
  3. Make your changes.
  4. Run pnpm lint, pnpm check-types, and pnpm test.
  5. Open a pull request with a clear description.

Please read CONTRIBUTING.md for the full workflow.

Security

Please do not open public issues for vulnerabilities. Review SECURITY.md for responsible disclosure.

Links

License

MIT. See LICENSE.

About

The open-source full-stack monorepo framework. Scaffold Next.js 16, Express, Better Auth, Prisma, and Docker/K8s in one command.

Topics

Resources

Contributing

Security policy

Stars

43 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages