Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-starter-kit

> 前端框架
Open source

Modern React starter kit with Bun, TypeScript, Tailwind CSS, tRPC, Stripe, and Cloudflare Workers. Production-ready monorepo for building fast web apps.

23.7K stars0 likes1 views
WebsiteGitHub

About

Modern React starter kit with Bun, TypeScript, Tailwind CSS, tRPC, Stripe, and Cloudflare Workers. Production-ready monorepo for building fast web apps.

A full-stack monorepo template for building SaaS applications with React 19, tRPC, and Cloudflare Workers. Type-safe from database to UI, deployable to the edge in minutes.

Highlights

  • Type-safe full stack – TypeScript, tRPC, and Drizzle ORM create a single type contract from database to UI
  • Edge-native – Three Cloudflare Workers (web, app, api) connected via service bindings
  • Auth + billing included – Better Auth with email OTP, passkey, Google OAuth, organizations, and Stripe subscriptions
  • Modern React – React 19, TanStack Router (file-based), TanStack Query, Jotai, Tailwind CSS v4, shadcn/ui
  • Database ready – Drizzle ORM with Neon PostgreSQL, migrations, and seed data
  • Fast DX – Bun toolchain, Vite, Vitest, ESLint, Prettier, and pre-configured VS Code settings

React Starter Kit is proudly supported by these amazing sponsors:

    

Technology Stack

Layer Technologies
Runtime Cloudflare Workers
Frontend React 19, TanStack Router, Tailwind CSS v4, shadcn/ui, Jotai
Marketing Astro
Backend Hono, tRPC, Better Auth, Stripe
Database Drizzle ORM, Neon PostgreSQL
Toolchain Bun, TypeScript 6.0, Vite, Vitest, ESLint, Prettier

Monorepo Architecture

…

Each app deploys independently to Cloudflare Workers. The web worker routes /api/* to the API worker and app routes to the app worker via service bindings.

Prerequisites

  • Bun v1.4+ (replaces Node.js and npm)
  • VS Code with our recommended extensions
  • React Developer Tools browser extension (recommended)
  • Cloudflare account for deployment

Quick Start

1. Create Your Project

Generate a new repository from this template, then clone it locally:

bash
git clone https://github.com/your-username/your-project-name.git
cd your-project-name

2. Install Dependencies

bash
bun install

3. Configure Environment

This project follows Vite env conventions:

  • .env is committed and contains shared defaults/placeholders only (no real secrets)
  • .env.local is git-ignored and should contain your real credentials
  • .env.local values override .env
bash
cp .env .env.local  # then replace placeholder values with real ones

Also check wrangler.jsonc for Worker configuration and bindings.

4. Start Development

bash
# Launch all apps in development mode (web, api, and app)
bun dev

# Or, start specific apps individually
bun web:dev  # Marketing site
bun app:dev  # Main application
bun api:dev  # API server

5. Initialize Database

Ensure DATABASE_URL is configured in your .env.local file, then set up the schema:

bash
bun db:push              # Push schema directly (quick dev setup)
bun db:seed              # Seed with sample data (optional)
bun db:studio            # Open database GUI

db:push is for local prototyping only. Staging and production apply migrations instead: bun db:migrate:staging, bun db:migrate:production.

App URL
React app http://localhost:5173
Marketing site http://localhost:4321
API server http://localhost:8787

Keep Your Project Updated

When you want to bring in newer React Starter Kit changes, ask your coding agent to run the merge-seed skill (/merge-seed in Claude Code or $merge-seed in Codex). It merges upstream changes while preserving your project's identity and configuration. Start with a clean working tree; the Quick Start guide explains the workflow and its safety boundary.

Production Deployment

The short version. The deployment guide covers each step in full.

1. Provision Infrastructure

Terraform creates the Hyperdrive configurations the API worker connects through:

bash
bun infra:production apply

Paste the two IDs it prints into the hyperdrive block of apps/api/wrangler.jsonc.

2. Environment Setup

Configure your production secrets in Cloudflare Workers:

…

All of these belong to the API worker, which is what --config selects – without it Wrangler has no worker to attach the secret to. Use --env staging for staging; production is the top-level config, selected explicitly with --env="". Non-sensitive vars like RESEND_EMAIL_FROM go in wrangler.jsonc directly.

Set RESEND_EMAIL_FROM to an address on a domain you have verified with Resend. The default [email protected] only delivers to your own inbox, and sign-in is email OTP – leave it and no one else can sign in.

3. Migrate the Production Database

bash
bun db:migrate:production   # reads .env.production.local, and only that file

4. Build and Deploy

bash
# Builds, then deploys api -> app -> web (service-binding targets first)
bun deploy:staging
bun deploy:production

CI runs the same script, so a release from your machine and one from GitHub Actions cannot drift.

Backers

              

Contributors

                        

Need Help?

Documentation covers auth, database, billing, deployment, and more.

Our AI assistant is trained on this codebase – ask it anything on ChatGPT or Gemini. Try these questions:

  • How do I add a new tRPC endpoint?
  • Help me create a database table
  • How does authentication work?
  • Explain the project structure
  • How do I deploy to Cloudflare?
  • Add a new page with routing
  • How do I send emails?

Contributing

See the Contributing Guide to get started. Check good first issues or join Discord for discussion.

License

Copyright © 2014-present Kriasoft. This source code is licensed under the MIT license found in the LICENSE file.


Made with ♥ by Konstantin Tarkus (@koistya, blog) and contributors.

Issues· 9 open

View all issuesOpen on GitHub
  • #2093

    Implement Jotai atoms for global state management

    help wantedgood first issueUpdated Jun 11, 2026
  • #2114

    Facing issues with bun --filter @repo/db migrate

    Updated Dec 5, 2025
  • #2116

    Thoughts on replacing ESLint and Prettier with Biome/Ultracite

    Updated Dec 5, 2025
  • #2108

    Getting started instructions no longer are accurate

    Updated Sep 30, 2025
  • #2030

    GitHub Codespaces fails when using template - requires manual clone/fork

    Updated Jul 31, 2025
  • #1649

    PWA Feature required

    enhancementhelp wantedUpdated Jul 31, 2025

> Tags

TypeScriptbetter-authboilerplatebuncloudflare

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架