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.
React Starter Kit is proudly supported by these amazing sponsors:
| 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 7.0, Vite, Vitest, Oxlint, Oxfmt |
├── apps/
│ ├── web/ Astro marketing site (edge router, serves static + proxies to app/api)
│ ├── app/ React 19 SPA (TanStack Router, Jotai, Tailwind CSS v4)
│ ├── api/ Hono + tRPC API server (Better Auth, Cloudflare Workers)
│ └── email/ React Email templates
├── packages/
│ ├── ui/ shadcn/ui components (new-york style)
│ ├── core/ Shared types and utilities
│ └── ws-protocol/ WebSocket protocol with type-safe messaging
├── db/ Drizzle ORM schemas, migrations, and seed data
├── infra/ Terraform (Hyperdrive connection pools, R2 storage)
├── docs/ VitePress documentation
└── scripts/ Build automation and dev tools
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.
Generate a new repository from this template, then clone it locally:
git clone https://github.com/your-username/your-project-name.git
cd your-project-name
bun install
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 .envcp .env .env.local # then replace placeholder values with real ones
Also check wrangler.jsonc for Worker configuration and bindings.
# 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
Ensure DATABASE_URL is configured in your .env.local file, then set up the schema:
bun db:push # Push schema directly (quick dev setup)
bun db:seed # Seed with sample data (optional)
bun db:studio
Thoughts on replacing ESLint and Prettier with Biome/Ultracite
https://github.com/kriasoft/react-starter-kit/issues/2116
Labels: 없음
Facing issues with bun --filter @repo/db migrate
https://github.com/kriasoft/react-starter-kit/issues/2114
Labels: 없음
Getting started instructions no longer are accurate
https://github.com/kriasoft/react-starter-kit/issues/2108
Labels: 없음
Implement Jotai atoms for global state management
https://github.com/kriasoft/react-starter-kit/issues/2093
Labels: help wanted, good first issue
GitHub Codespaces fails when using template - requires manual clone/fork
https://github.com/kriasoft/react-starter-kit/issues/2030
Labels: 없음
Thank you for your interest in contributing! Whether you're fixing bugs, improving documentation, or proposing new features — we appreciate your efforts.
All contributors are expected to follow our Code of Conduct.
Look for issues labeled good first issue or help wanted.
Before starting work on a significant change, open an issue to discuss your proposal and wait for feedback from maintainers.
Fork and clone the repository:
git clone https://github.com/<your-username>/react-starter-kit.git
cd react-starter-kit
git remote add upstream https://github.com/kriasoft/react-starter-kit.git
Install dependencies:
bun install
Start the development server:
bun dev # Start all apps (web + api + app)
# Or individually:
bun web:dev # Marketing site
bun app:dev # Main application
bun api:dev # API server
Verify your setup:
bun run test --run # Run tests (Vitest)
bun lint # Oxlint
bun run format:check # Oxfmt
bun typecheck # TypeScript
See AGENTS.md for the full monorepo layout, tech stack, and available commands.
This repository keeps a single squashed migration, so a schema change regenerates db/migrations/0000_init.sql rather than adding to it. Plain bun db:generate would append 0001_* against the existing snapshot, so:
# from db/migrations/meta/_journal.json, note the entry's `when` value,
# then set "entries" to []
rm db/migrations/0000_init.sql db/migrations/meta/0000_snapshot.json
bun db:generate --name init
# restore the original `when` so the entry keeps its identity
meta/0000_snapshot.json must keep top-level "version": "7". At "1" drizzle-kit reports data is malformed, writes nothing, and bun db:check exits non-zero — a silent no-op that is easy to miss. The journal entry's own version is not read.
This convention is specific to the starter kit. A project generated from it should follow docs/database/migrations.md and never edit an applied migration.
Create a feature branch from main:
git checkout main
git pull upstream main
git checkout -b feature/your-feature-name
Make focused changes — one PR per concern. Follow existing patterns in the codebase.
Verify before pushing:
bun run test --run && bun lint && bun run format:check && bun typecheck
Write clear commit messages using conventional commits:
type: description
type(scope): description
The scope is optional. pr-title.yml lists the accepted types.
Open a pull request against main with a clear description. Reference related issues and include screenshots for UI changes. Give the pull request a title in the same form – CI validates that one, and it is what a squash merge records on main.
mainany and unnecessary type assertionsAGENTS.md for the full design philosophyThis project uses the Developer Certificate of Origin (DCO) version 1.1.
By contributing, you certify that you wrote the contribution yourself (or have the right to submit it) and agree to license it under the MIT License.
All commits must include a sign-off line:
git commit -s -m "feat(auth): add passkey support"
Nothing in this repository checks for it – install GitHub's DCO app and make its status required if you want it enforced – so until then a maintainer may ask you to amend a commit that is missing the line.
AI tools may be used to help produce contributions. By submitting, you certify that you have reviewed and understand the code and that it does not include material you lack the right to submit under the MIT License.
The use of AI tools does not change the DCO requirements. The contributor remains the author of record and is responsible for the contribution.
By contributing, you agree that your contributions will be licensed under the MIT License.