Getting Started
Welcome to React Starter Kit — your shortcut to building modern web apps without the usual setup headaches. This guide will get you from zero to hero faster than you can say "webpack configuration" (which, thankfully, you won't have to).
Quick Start
Just want to dive in? Run these commands and you're good to go:
git clone -o seed -b main --single-branch \
https://github.com/kriasoft/react-starter-kit.git my-app
cd my-app && bun install && bun devPrerequisites
Before diving in, make sure you have these essentials:
- Bun 1.2.0+ (install here) — trust us, it's worth it
- A Cloudflare account for deployment (free tier works great)
- Your favorite code editor (VS Code recommended, but we won't judge)
Node.js Optional
While many developers have Node.js installed, this template runs entirely on Bun. You don't need Node.js unless you're integrating with Node-specific tools.
Create Your Project
You've got two paths to choose from. Pick your adventure:
Option 1: GitHub Template (The Quick Way)
Perfect if you want to get started immediately and keep your project cleanly separated:
- Navigate to github.com/kriasoft/react-starter-kit
- Click the green "Use this template" button
- Choose "Create a new repository"
- Name your project (avoid "my-awesome-app" — be creative!)
- Clone your new repository:
git clone https://github.com/YOUR_USERNAME/YOUR_PROJECT.git
cd YOUR_PROJECT
bun installTIP
This method creates a clean repository history without the template's commit history.
Option 2: Git Clone (The Smart Way)
This approach lets you pull updates from the template later because who doesn't love staying current?
# Clone the template with a custom remote name
git clone -o seed -b main --single-branch \
https://github.com/kriasoft/react-starter-kit.git my-app
# Jump into your project
cd my-app
# Install dependencies (Bun makes this blazing fast)
bun installThe magic here is naming the remote "seed" instead of "origin". This way, you can add your own repository as "origin" later while keeping the template connection alive:
# Add your own repository as origin
git remote add origin https://github.com/YOUR_USERNAME/YOUR_PROJECT.git
git push -u origin main
# Later, when you want template updates
git fetch seed
git merge seed/mainWARNING
Be careful when merging template updates — always review changes and test thoroughly before deploying.
Project Structure
Once you're set up, here's what you're working with:
my-app/
├── apps/
│ ├── app/ # React 19 frontend with TanStack Router
│ ├── web/ # Astro static site (landing/marketing)
│ ├── api/ # tRPC backend (type-safe goodness)
│ └── email/ # React Email templates (authentication & transactional)
├── packages/
│ ├── core/ # Shared modules and utilities
│ ├── ui/ # Shared UI components (shadcn/ui)
│ └── ws-protocol/ # WebSocket protocol template
├── db/ # Database schemas and migrations
├── infra/ # Terraform infrastructure configuration
├── docs/ # Documentation (you are here!)
├── scripts/ # Build and utility scripts
└── package.json # Monorepo rootFirst Steps
1. Start Development Server
Fire up the development environment with two terminals:
Terminal 1 - React App:
bun app:dev # or bun --filter @repo/app devTerminal 2 - API Server:
bun api:dev # or bun --filter @repo/api devThis starts:
- 🚀 App dev server at
http://localhost:5173(React app) - 🔥 API server at
http://localhost:8787(tRPC with hot reload) - 💾 Database connection (Neon PostgreSQL)
Optional - Other services:
bun web:dev # Marketing site (Astro) at http://localhost:4321
bun email:dev # Email preview server at http://localhost:3001What's happening under the hood?
Each command starts its specific development server:
- app:dev: Vite dev server for the React app with HMR
- api:dev: Wrangler dev server for the tRPC API with file watching
- email:dev: React Email preview server for template development
- web:dev: Astro dev server for the marketing site
2. Explore the Stack
Open your browser and check out:
- App:
http://localhost:5173— Your React app with TanStack Router - API:
http://localhost:8787— tRPC API endpoints - Database GUI: Run
bun --filter @repo/db studioto explore your database - Email Templates: Run
bun email:devfor preview athttp://localhost:3001 - Astro Site: Run
bun web:devfor the marketing site athttp://localhost:4321
3. Make It Yours
Time to customize:
- Update branding → Edit
apps/app/index.htmlwith your app's title - Homepage content → Modify
apps/app/routes/index.tsx - API endpoints → Check out
apps/api/routers/for tRPC routes - Data models → Explore
db/schema/for database structure
Database Setup
The template uses Neon PostgreSQL with Drizzle ORM. To set up your database:
# Generate the initial schema
bun --filter @repo/db generate
# Apply migrations to your local database
bun --filter @repo/db push
# (Optional) Seed with sample data
bun --filter @repo/db seedDatabase GUI
Want to explore your data visually? Run bun --filter @repo/db studio to open Drizzle Studio in your browser.
Authentication
Better Auth is pre-configured with multiple authentication methods:
- Email/Password - Traditional authentication
- Passkeys - WebAuthn biometric authentication
- OAuth - Google and other providers
- OTP - One-time passwords via email
- Email Templates - Beautiful transactional emails
Configuration
- Create environment file → Create
.env.local(excluded from Git) - Add OAuth credentials → Google, GitHub, etc.
- Configure email → Set up Resend for email delivery
- Client setup → Check
apps/app/lib/auth.ts - Server config → See
apps/api/lib/auth.ts
Example .env.local
# OAuth Providers
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# Email Service (Resend)
RESEND_API_KEY="re_xxxxxxxxxx"
RESEND_EMAIL_FROM="Your App <[email protected]>"
# Auth Secret (generate with: openssl rand -hex 32)
BETTER_AUTH_SECRET="your-random-secret-here"Email Templates
The template includes React Email templates for authentication:
# Preview email templates
bun email:dev
# Build for production
bun email:build
# Export static HTML
bun email:exportUI Components Management
The template includes powerful shadcn/ui component management utilities:
# Add specific components
bun run ui:add button dialog
# Install essential components (37 pre-selected)
bun run ui:essentials
# List installed components
bun run ui:list
# Update components to latest versions
bun run ui:updateQuick Setup
Running bun run ui:essentials gives you 37 carefully selected components that cover 90% of typical UI needs — forms, layout, navigation, and feedback components.
For detailed component management documentation, see the UI Components Guide.
Development Workflow
Here's your daily routine:
# Start development (in separate terminals)
bun app:dev # Terminal 1: React app
bun api:dev # Terminal 2: API server
# Run tests (yes, we have tests!)
bun test
# Lint your code (keep it clean)
bun lint
# Build for production
bun email:build # Build email templates first
bun app:build # Build React app
bun api:build # Build APIType Checking
TypeScript checking happens automatically in your editor. For CI/CD, run bun --filter @repo/api build to verify types.
💡 Hot Tips for Development
- API Types: After modifying tRPC routes, types auto-generate — no manual sync needed
- Database Changes: Edit
db/schema/, then runbun --filter @repo/db generateandpush - Component Library: shadcn/ui components are ready to use — check
packages/ui/components - UI Components: Add new components with
bun run ui:add <component>or install essentials withbun run ui:essentials - State Management: Global state lives in
apps/app/lib/store.tsusing Jotai
Deploy to Production
Ready to ship? Let's deploy to Cloudflare Workers:
# First, login to Cloudflare
bun wrangler login
# Build packages (order matters!)
bun email:build # Build email templates
bun web:build # Build marketing site
bun app:build # Build React app
# Deploy applications
bun web:deploy # Deploy marketing site
bun api:deploy # Deploy API server
bun app:deploy # Deploy React appEnvironment Configuration
The project includes multiple environments (development, preview, production). Always specify --env=production for production deployments.
Your app will be live at https://your-app.workers.dev in seconds. Yes, really.
⚠️ Common Gotchas
Environment Variables
Remember to set them in Cloudflare dashboard for production — local .env files are NOT deployed!
Database Migrations
Production uses Neon PostgreSQL — ensure your production database is configured:
# Apply migrations to production
bun --filter @repo/db migrate --env=productionAPI Routes
All API calls go through /api/trpc — the client handles this automatically. No need to configure endpoints.
Build Errors
If TypeScript complains, try bun --filter @repo/api build first. This regenerates type definitions.
Next Steps
Now that you're up and running:
- Browse the example components for inspiration
- Check out the deployment guide for advanced Cloudflare setup
- Join our Discord community for help and updates
Remember: This template is intentionally minimal. It's not trying to be everything to everyone — it's a solid foundation that respects your ability to make architectural decisions. Build something amazing!
🆘 Need Help?
Community Support
- 💬 GitHub Discussions
- 🐛 Report Issues
- ⭐ Star us on GitHub (it helps!)
Happy coding! 🚀