Jez | Jeremy Dawes
Back to projects
open-source active

Vite Flare Starter

Authenticated starter kit for Cloudflare Workers. better-auth, shadcn/ui, D1 database, dashboard layout, and theme system.

Cloudflare WorkersReact 19ViteD1better-authTailwind v4

Overview

A minimal, production-ready starter kit for building authenticated applications on Cloudflare Workers. Skip weeks of boilerplate and start building features immediately.

Yes
Auth Ready
40+
Components
5 min
Setup Time

The Problem

Starting a new Cloudflare Workers project with authentication requires:

  • Auth setup - OAuth providers, session management, password reset flows
  • Database schema - Users, sessions, verification tokens
  • UI components - Login/signup forms, settings pages, navigation
  • Security - Rate limiting, CORS, security headers

This takes weeks to set up properly. Developers needed a complete starting point.

Solution

Built a complete authenticated starter that handles all the fundamentals:

One-Click Deploy

Deploy to Cloudflare Workers in minutes with the included setup scripts. Database, auth, and UI ready to go.

What’s Included

  • Authentication - Email/password + Google OAuth via better-auth
  • User Settings - Profile, password, theme preferences
  • Dashboard Layout - Responsive sidebar navigation
  • UI Components - Full shadcn/ui component library
  • Theme System - Dark/light/system mode + 8 color themes
  • API Structure - Hono backend with auth middleware
  • Database - D1 with Drizzle ORM and migrations

Tech Stack

Platform1

Cloudflare Workers

Frontend3

React 19, Vite, TanStack

Backend2

Hono, Drizzle ORM

Database1

D1 (SQLite)

Auth1

better-auth

UI2

Tailwind v4, shadcn

Features

Email/PasswordSignup, signin, password reset with email verification
Google OAuthOne-click Google sign-in with domain restriction option
Session ManagementView active sessions, revoke devices, log out everywhere
Rate LimitingProtection against brute force on sensitive endpoints

Project Structure

vite-flare-starter/
├── src/
│   ├── client/              # Frontend (React SPA)
│   │   ├── components/ui/   # 40+ shadcn/ui components
│   │   ├── layouts/         # Dashboard layout
│   │   ├── modules/
│   │   │   ├── auth/        # Sign-in/sign-up
│   │   │   └── settings/    # User settings
│   │   └── pages/           # Route pages
│   ├── server/              # Backend (Hono API)
│   │   ├── modules/         # Feature modules
│   │   ├── middleware/      # Auth middleware
│   │   └── db/              # Schema exports
│   └── shared/              # Zod schemas
├── drizzle/                 # Database migrations
└── wrangler.jsonc           # Workers config

Quick Start

# Clone and install
git clone https://github.com/jezweb/vite-flare-starter.git my-app
cd my-app
pnpm install

# Create D1 database
npx wrangler d1 create my-app-db
# Copy database_id to wrangler.jsonc

# Configure and run
cp .dev.vars.example .dev.vars
pnpm db:migrate:local
pnpm dev

Configuration Options

The starter supports extensive customisation through environment variables:

FeatureVariableDescription
App NameVITE_APP_NAMEDisplayed in sidebar
Default ThemeVITE_DEFAULT_THEMEblue, green, orange, etc.
Theme PickerVITE_FEATURE_THEME_PICKERShow/hide theme selector
API TokensVITE_FEATURE_API_TOKENSShow/hide token management
Email SignupDISABLE_EMAIL_SIGNUPRestrict to OAuth only

Use Cases

SaaS Applications - Full auth stack ready for your business logic

Internal Tools - Restrict to Google Workspace domain for team-only access

Client Projects - Lock theme to brand colors, hide power-user features

Prototypes - Go from idea to deployed demo in an afternoon

Interested in a similar solution?

Let's talk about your project