Vite Flare Starter
Authenticated starter kit for Cloudflare Workers. better-auth, shadcn/ui, D1 database, dashboard layout, and theme system.
Overview
A minimal, production-ready starter kit for building authenticated applications on Cloudflare Workers. Skip weeks of boilerplate and start building features immediately.
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:
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
Cloudflare Workers
React 19, Vite, TanStack
Hono, Drizzle ORM
D1 (SQLite)
better-auth
Tailwind v4, shadcn
Features
Email/PasswordSignup, signin, password reset with email verificationGoogle OAuthOne-click Google sign-in with domain restriction optionSession ManagementView active sessions, revoke devices, log out everywhereRate LimitingProtection against brute force on sensitive endpointsProject 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:
| Feature | Variable | Description |
|---|---|---|
| App Name | VITE_APP_NAME | Displayed in sidebar |
| Default Theme | VITE_DEFAULT_THEME | blue, green, orange, etc. |
| Theme Picker | VITE_FEATURE_THEME_PICKER | Show/hide theme selector |
| API Tokens | VITE_FEATURE_API_TOKENS | Show/hide token management |
| Email Signup | DISABLE_EMAIL_SIGNUP | Restrict 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