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.
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.
- Who It's For
- Quick Start
- Templates
- Generated Project
- What's Included
- Repository Layout
- Development
- Deployment
- Build Elevate
- Contributing
- Security
- Links
- Node.js 24+
- pnpm, npm, or Bun
- Docker Desktop, if you enable Docker-based workflows
pnpm dlx stackbase@latest init my-appNavigate into your project and update the generated .env.local files with your database credentials and secrets:
cd my-appKey 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.localfiles from.env.exampletemplates during project creation.
pnpm devDefault 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.
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 |
fullstackis supported as a backwards-compatible alias forbase.
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.jsonEach template contains only the applications and packages relevant to its target architecture.
| 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 |
| 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 |
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.jsonThe 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.
Install dependencies:
pnpm installRun the docs app from the repository root:
pnpm devWork on the CLI:
pnpm --filter ./packages/stackbase check-types
pnpm --filter ./packages/stackbase build
node packages/stackbase/dist/index.js --helpRun checks:
pnpm lint
pnpm check-types
pnpm test
pnpm format:checkTemplate packages live under templates/base, but they are still part of the pnpm workspace so docs and CLI verification can resolve shared packages locally.
Generated projects include deployment assets:
- Docker Compose for local and production workflows
- Production Dockerfiles for
apps/webandapps/api - Kubernetes manifests under
k8s/ - Prometheus and Grafana config under
deploy/observability/
Deployment docs:
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 migrateto convert.build-elevate.json, update safe files, and preserve local changes. - The original manifest is saved as
.build-elevate.json.bakand can be deleted after the migrated project passes its checks. - See the migration guide for conflict handling and verification.
Contributions are welcome.
- Fork the repository and create a branch from
main. - Install dependencies with
pnpm install. - Make your changes.
- Run
pnpm lint,pnpm check-types, andpnpm test. - Open a pull request with a clear description.
Please read CONTRIBUTING.md for the full workflow.
Please do not open public issues for vulnerabilities. Review SECURITY.md for responsible disclosure.
- Documentation: stackbase-labs.vercel.app/docs
- npm: stackbase
- Issues: github.com/stackbase-labs/stackbase/issues
- Changelog: CHANGELOG.md
MIT. See LICENSE.
