Scaffold a modern Nuxt 4 SaaS Starter
npm install create-nuxt4-saas-starter> This is the CLI installer for the Nuxt 4 SaaS Starter.
``bash`
npx create-nuxt4-saas-starter my-saas-app
---






A structured, production-ready SaaS boilerplate built with Nuxt 4, NuxtHub, and Nuxt UI v4. Designed for speed, scalability, and ease of deployment to Cloudflare.
- Full-Stack Power: Built on Nuxt 4 with a server-first approach.
- Database: SQLite (D1) managed via Drizzle ORM for type-safe database interactions.
- Authentication: Secure, session-based authentication using Nuxt Auth Utils.
- UI Framework: Beautiful, accessible components with Nuxt UI v4 (Tailwind CSS under the hood).
- Serverless Ready: Pre-configured with NuxtHub for Cloudflare Workers (Blob Storage, KV, Database, Cache).
- Real-time Chat: End-to-end encrypted messaging with WebSocket support.
- Email: Transactional email support configured for ZeptoMail.
- Testing: Unit and integration testing setup with Vitest.
- Type Safety: End-to-end TypeScript support.
- Framework: Nuxt 4
- Language: TypeScript
- Database: SQLite (Cloudflare D1) via Drizzle ORM
- Styling: Tailwind CSS (via Nuxt UI)
- Deployment: Cloudflare Pages / Workers
- Package Manager: Bun (recommended) or npm/pnpm
- Node.js (v18 or later)
- Bun (recommended) or npm/pnpm
Option 1: CLI (Recommended)
Scaffold a new project in seconds:
`bash`
npx create-nuxt4-saas-starter my-saas-app
Option 2: Manual Clone
1. Clone the repository:
`bash`
git clone https://github.com/bootssecurity/nuxt4-saas-starter.git
cd nuxt-app
2. Install dependencies:
`bash`
bun install
# or
npm install
3. Setup Environment Variables:
Copy the example .env file and update it with your credentials.
`bash`
cp .env.example .env
Update the .env file with your specific configuration:
`bash`
# Cloudflare Turnstile (Get keys from Cloudflare Dashboard)
NUXT_PUBLIC_TURNSTILE_SITE_KEY=your-site-key
NUXT_TURNSTILE_SECRET_KEY=your-secret-key
Update other credentials (e.g., ZEPTOMAIL_API_KEY, NUXT_SESSION_PASSWORD).
Start the development server:
`bash`
bun devor
npm run dev
Visit http://localhost:3000 to see your app running.
To test the production build locally (simulating Cloudflare Pages environment):
`bash`
bun run build
npx wrangler pages dev dist
This ensures your app works exactly as it will on Cloudflare (including _worker.js and bindings).
This project uses Drizzle ORM with SQLite.
- Generate Migrations: Create SQL migrations based on your schema changes.
`bash`
bun db:generate
- Migrate Database: Apply migrations to your local or remote database (managed via NuxtHub in dev).
Note: In development with NuxtHub, migrations are often handled automatically or via the NuxtHub admin interface.
This project is configured for automated deployment to Cloudflare Pages using GitHub Actions.
๐ Read the Full Deployment Guide for step-by-step setup instructions.
branch automatically builds and deploys.
- Secrets: Managed securely via Cloudflare Dashboard (not in git).$3
You can also deploy manually if needed:
`bash
bun run deploy
`๐งช Testing
Run the test suite using Vitest:
`bash
Run all tests
bun testRun in watch mode
bun run test:watchRun with coverage
bun run test:coverage
`๐ Project Structure
-
app/: Frontend Vue components, pages, and layouts.
- server/: Backend API routes, database schema, and server utilities.
- server/database/schema.ts: Drizzle ORM schema definitions.
- server/api/: API endpoints.
- public/: Static assets.
- nuxt.config.ts`: Nuxt configuration.- Security Guide: Comprehensive security architecture and best practices.
- API Documentation: Detailed endpoint documentation with examples.
- Deployment Guide: Step-by-step deployment instructions.
MIT License.