vite-flare-starter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vite Flare Starter

Vite Flare Starter

Clone and configure Jez's batteries-included Cloudflare starter into a standalone project. Produces a fully rebranded, deployable full-stack app.
克隆并配置Jez的一站式Cloudflare启动模板,将其转换为独立项目,生成可重新品牌化、可部署的全栈应用。

What You Get

你将获得的技术栈

LayerTechnology
FrontendReact 19, Vite, Tailwind v4, shadcn/ui
BackendHono (on Cloudflare Workers)
DatabaseD1 (SQLite at edge) + Drizzle ORM
Authbetter-auth (Google OAuth + optional email/password)
StorageR2 (S3-compatible object storage)
AIWorkers AI binding
Data FetchingTanStack Query
DeploymentCloudflare Workers with Static Assets
See
references/tech-stack.md
for the full dependency list.
层级技术栈
前端React 19, Vite, Tailwind v4, shadcn/ui
后端Hono(基于Cloudflare Workers)
数据库D1(边缘SQLite)+ Drizzle ORM
身份验证better-auth(支持Google OAuth + 可选邮箱/密码登录)
存储R2(兼容S3的对象存储)
人工智能Workers AI 绑定
数据获取TanStack Query
部署带静态资源的Cloudflare Workers
完整依赖列表请查看
references/tech-stack.md

Workflow

操作流程

Step 1: Gather Project Info

步骤1:收集项目信息

Ask for:
RequiredOptional
Project name (kebab-case)Admin email
Description (1 sentence)Google OAuth credentials
Cloudflare account (Jezweb Team or Personal)Custom domain
需要收集以下信息:
必填项可选项
项目名称(短横线分隔格式)管理员邮箱
项目描述(一句话)Google OAuth 凭证
Cloudflare账号(Jezweb团队账号或个人账号)自定义域名

Step 2: Run Setup Script

步骤2:运行安装脚本

bash
bash skills/vite-flare-starter/scripts/setup.sh
The script will:
  1. Clone the repo and remove
    .git
  2. Find-replace
    vite-flare-starter
    with project name (7 locations)
  3. Generate
    BETTER_AUTH_SECRET
  4. Create
    .dev.vars
    from template
  5. Optionally create Cloudflare D1 + R2 resources
  6. Run
    pnpm install
  7. Run local database migration
  8. Report remaining manual steps
bash
bash skills/vite-flare-starter/scripts/setup.sh
脚本将完成以下操作:
  1. 克隆仓库并移除
    .git
    目录
  2. 将所有出现
    vite-flare-starter
    的位置替换为项目名称(共7处)
  3. 生成
    BETTER_AUTH_SECRET
  4. 基于模板创建
    .dev.vars
    文件
  5. (可选)创建Cloudflare D1和R2资源
  6. 运行
    pnpm install
    安装依赖
  7. 执行本地数据库迁移
  8. 列出剩余需要手动完成的步骤

Step 3: Manual Configuration

步骤3:手动配置

After the script completes:
  1. Google OAuth (if using):
    • Go to Google Cloud Console
    • Create OAuth 2.0 Client ID
    • Add redirect URI:
      http://localhost:5173/api/auth/callback/google
    • Copy Client ID and Secret to
      .dev.vars
  2. Favicon: Replace
    public/favicon.svg
    with your own
  3. CLAUDE.md: Update project description and remove vite-flare-starter references
  4. index.html: Update
    <title>
    and meta description
脚本执行完成后,需完成以下手动配置:
  1. Google OAuth(若使用):
    • 访问Google Cloud Console
    • 创建OAuth 2.0客户端ID
    • 添加重定向URI:
      http://localhost:5173/api/auth/callback/google
    • 将客户端ID和密钥复制到
      .dev.vars
      文件中
  2. 网站图标:替换
    public/favicon.svg
    为自定义图标
  3. CLAUDE.md:更新项目描述并移除所有与vite-flare-starter相关的引用
  4. index.html:更新
    <title>
    标签和元描述

Step 4: Verify Locally

步骤4:本地验证

bash
pnpm dev
Check:
  • http://localhost:5173 loads
  • Shows YOUR app name, not "Vite Flare Starter"
  • Sign-up/sign-in works (if Google OAuth configured)
bash
pnpm dev
检查以下内容:
  • http://localhost:5173 可正常加载
  • 显示你的应用名称,而非“Vite Flare Starter”
  • 注册/登录功能正常(若已配置Google OAuth)

Step 5: Deploy to Production

步骤5:部署到生产环境

bash
undefined
bash
undefined

Set production secrets

设置生产环境密钥

openssl rand -base64 32 | npx wrangler secret put BETTER_AUTH_SECRET echo "https://PROJECT_NAME.SUBDOMAIN.workers.dev" | npx wrangler secret put BETTER_AUTH_URL echo "http://localhost:5173,https://PROJECT_NAME.SUBDOMAIN.workers.dev" | npx wrangler secret put TRUSTED_ORIGINS
openssl rand -base64 32 | npx wrangler secret put BETTER_AUTH_SECRET echo "https://PROJECT_NAME.SUBDOMAIN.workers.dev" | npx wrangler secret put BETTER_AUTH_URL echo "http://localhost:5173,https://PROJECT_NAME.SUBDOMAIN.workers.dev" | npx wrangler secret put TRUSTED_ORIGINS

If using Google OAuth

若使用Google OAuth

echo "your-client-id" | npx wrangler secret put GOOGLE_CLIENT_ID echo "your-client-secret" | npx wrangler secret put GOOGLE_CLIENT_SECRET
echo "your-client-id" | npx wrangler secret put GOOGLE_CLIENT_ID echo "your-client-secret" | npx wrangler secret put GOOGLE_CLIENT_SECRET

Migrate remote database

迁移远程数据库

pnpm run db:migrate:remote
pnpm run db:migrate:remote

Build and deploy

构建并部署

pnpm run build && pnpm run deploy

**Critical**: After first deploy, update BETTER_AUTH_URL with your actual Worker URL. Also add the production URL to Google OAuth redirect URIs.
pnpm run build && pnpm run deploy

**重要提示**:首次部署后,需将BETTER_AUTH_URL更新为实际的Worker URL。同时需将生产环境URL添加到Google OAuth的重定向URI列表中。

Common Issues

常见问题

SymptomCauseFix
Auth silently fails (redirect to homepage)Missing TRUSTED_ORIGINSSet TRUSTED_ORIGINS secret with all valid URLs
"Not authorized" on deployWrong account_idRemove account_id from wrangler.jsonc or set yours
Database operations failUsing original database_idCreate YOUR database, use YOUR database_id
localStorage shows "vite-flare-starter"Missing VITE_APP_IDSet
VITE_APP_ID=yourapp
in .dev.vars
Auth fails in productionBETTER_AUTH_URL mismatchMust match actual Worker URL exactly
症状原因解决方法
身份验证静默失败(重定向到首页)缺少TRUSTED_ORIGINS配置设置TRUSTED_ORIGINS密钥,包含所有有效URL
部署时提示“未授权”account_id错误从wrangler.jsonc中移除account_id或设置为你的账号ID
数据库操作失败使用了原始的database_id创建你自己的数据库,并使用对应的database_id
localStorage中显示"vite-flare-starter"缺少VITE_APP_ID配置在.dev.vars中设置
VITE_APP_ID=yourapp
生产环境中身份验证失败BETTER_AUTH_URL不匹配必须与实际的Worker URL完全一致

What Gets Rebranded

品牌化修改内容

The setup script handles these automatically:
FileWhat Changes
wrangler.jsonc
Worker name, database name, bucket names
package.json
Package name, database references in scripts
.dev.vars
App name, secret, URL
index.html
Title, meta tags
These need manual attention:
  • CLAUDE.md
    — project description
  • public/favicon.svg
    — your favicon
  • Google OAuth — redirect URIs
  • Production secrets — via
    wrangler secret put
See
references/customization-guide.md
for the complete rebranding checklist.
安装脚本将自动完成以下修改:
文件修改内容
wrangler.jsonc
Worker名称、数据库名称、存储桶名称
package.json
包名称、脚本中的数据库引用
.dev.vars
应用名称、密钥、URL
index.html
标题、元标签
以下内容需要手动修改:
  • CLAUDE.md
    —— 项目描述
  • public/favicon.svg
    —— 自定义网站图标
  • Google OAuth —— 重定向URI
  • 生产环境密钥 —— 通过
    wrangler secret put
    设置
完整的品牌化修改清单请参考
references/customization-guide.md