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:studo:local
npm run db:studo:preview
npm run db:studo:prod
npm run npm:audit # Check dependency vulnerabilities
npm run npm:check # Check outdated dependencies