Skip to content

πŸ”₯ CLOUDFIRE πŸ”₯ a Hono + React + Cloudflare (Pages & D1 SQLite) + DrizzleORM template

Notifications You must be signed in to change notification settings

JorgeCoke/cloudfire

Repository files navigation

πŸ”₯ CLOUDFIRE πŸ”₯

a Hono + React + Cloudflare (Pages & D1 SQLite) + DrizzleORM template

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 πŸš€

✨ Features

πŸ›  Getting Started

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 Commit with Commitizen

git add .            # Add files
npm run cz           # Commit with Commitizen CLI

🎨 Linter & Formatter

npm run biome         # Run BiomeJS

πŸš€ Release and deploy a new version

  1. (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
  1. 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)

πŸ–₯ Drizzle Migrations & Studio

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

πŸ”¦ Check vulnerabilities and update outdated dependencies

npm run npm:audit     # Check dependency vulnerabilities
npm run npm:check     # Check outdated dependencies