This boilerplate SaaS template stack is designed for developers seeking a streamlined, high-performance setup with minimal dependencies, and super lightweight. Perfect for modern web applications 🚀
- ☁️ Cloudflare Pages and Cloudflare D1 SQLite serverless deployment with
- 🔥 Hono, the fastest JS server framework
- 📚 Automagically generated SwaggerUI + OpenApi v3 spec
- ⚛️ React 18 SPA ( <80kb gzip! )
- 🪛 Nanostores State Management, Router and Query lightweight multitool
- 🌧 Drizzle as SQLite ORM
- 🛡 Zod validator
- 🦄 Tailwind styles
- 🔐 Username + password JWT Auth Example
- 🎨 The best linter and formatter, BiomeJS
- 💄 Commit nomenclature rules following Conventional Commit Format and Commitizen CLI (emoji powered)
- 🚀 Release management policy with commit-and-tag-version, including automagically CHANGELOG.md generation, GitTags, and version bumping
- 🐶 Pre-Commit Husky hooks
- 🔦 Included npm-check to check for outdated, incorrect, and unused dependencies.
- 🥷🏻 Included better-npm-audit to check for dependency vulnerabilities
First, create your production & preview databases, and update your wrangler configuration file:
npm i -g wrangler # Install Cloudflare Wrangler CLI
wrangler login # Login to Cloudflare
wrangler d1 create cloudfire-prod-db # Create Prod database, and don't forget to update [[d1_databases]] section in wrangle.toml with your database_id and database_name
wrangler d1 create cloudfire-preview-db # Create Preview database, and don't forget to update [[env.preview.d1_databases]] section in wrangle.toml with your database_id and database_name
cp .dev.vars.example .dev.vars # Create a .dev.vars and don't forget to fill it with your secret variables
Then, simply install dependencies, run the migrations and launch it!
npm ci # Install dependencies
npm run db:migrate:local # Run database migrations locally
npm run dev # Launch project locally
git add . # Add files
npm run cz # Commit with Commitizen CLI
npm run biome # Run BiomeJS
- (optional) First, generate a new release:
npm run release # (default) Bump version, generate CHANGELOG.md and push GitTag to origin
commit-and-tag-version --first-release --release-as 1.0.0 # First release and Release as a Target Type Imperatively
- Then, add environment variables vía dashboard (docs), run migrations and deploy it:
npm run db:migrate:preview # Run database migrations (preview environment)
npm run deploy:preview # Deploy (preview environment)
npm run db:migrate:prod # Run database migrations (prod environment)
npm run deploy:prod # Deploy (prod environment)
Generate new migrations:
npm run db:generate
Launch database studio:
npm run db:studio:local
npm run db:studio:preview
npm run db:studio:prod
npm run npm:audit # Check dependency vulnerabilities
npm run npm:check # Check outdated dependencies