Overview
The React Template is TailStack’s frontend-only architecture, providing a modern, high-performance foundation for building client-side applications. It’s perfect for SPAs, dashboards, and applications that consume external APIs.This template is located at
packages/react/ in the TailStack repository.When to Use This Template
Choose the React template when you:Separate Backend
Your backend is:
- A separate service/microservice
- Third-party API (Firebase, Supabase)
- Different tech stack (Go, Python, Java)
- Managed by another team
Frontend Focus
Your project is:
- Client-side web application
- Admin dashboard
- Marketing or landing page
- Static site with dynamic features
Independent Deployment
You want to:
- Deploy frontend separately
- Use CDN for static hosting
- Scale frontend independently
- Faster deployment cycles
Specialized Hosting
You’re deploying to:
- Vercel, Netlify, Cloudflare Pages
- S3 + CloudFront
- GitHub Pages
- Any static hosting
Directory Structure
Technology Stack
Core Dependencies
- React Ecosystem
- Build Tools
- Styling
- UI Components
package.json
- React Server Components ready
- Improved Suspense boundaries
- Automatic batching
- New
use()hook for async data
- File-based routing option
- Improved data loading
- Type-safe route params
- Nested layouts
Shadcn UI Integration
The template comes with shadcn/ui components pre-installed insrc/components/ui/:
Button
File:
button.tsxVariants: default, destructive, outline, secondary, ghost, linkSizes: default, sm, lg, iconCard
File:
card.tsxComponents: Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooterBadge
File:
badge.tsxVariants: default, secondary, destructive, outlineInput
File:
input.tsxAccessible form inputs with proper typesComponent Pattern
All shadcn components follow this pattern:src/components/ui/button.tsx
CVA Pattern: Components use Class Variance Authority for type-safe variant handling. Variants are defined in
src/constants/ui-variants.ts for centralized management.Weather App Demo
The template includes a fully functional weather application atsrc/pages/weather.tsx:
Features
Real-Time Data
Fetches weather data from external API
- Current conditions
- Temperature and humidity
- Wind speed and direction
- Weather descriptions
Search & Location
Location-based weather lookup
- City name search
- Auto-complete suggestions
- Geolocation support
- Recent searches history
Responsive UI
Beautiful on all devices
- Mobile-first design
- Tablet optimized
- Desktop layouts
- Dark mode support
Error Handling
Graceful error states
- Loading skeletons
- Error boundaries
- Retry mechanisms
- User-friendly messages
Code Example
src/pages/weather.tsx (simplified)
Routing Architecture
React Router 7 configuration insrc/App.tsx:
src/App.tsx
Layout System
Nested layouts insrc/components/layout/:
- Header: Navigation, logo, theme toggle
- Sidebar: Secondary navigation for nested routes
- Footer: Links, copyright, social media
API Client Architecture
Centralized API functions insrc/api/:
src/api/weather.ts
Environment Variables: Use
VITE_ prefix for environment variables in .env files. They’re statically replaced at build time.Agent Skills
The React template includes two agent skills:- Vercel React Best Practices
- Tailwind v4 + shadcn/ui
Location:
.agent/skills/vercel-react-best-practices/Categories:- Component Architecture
- Performance Optimization
- State Management
- Data Fetching
- Error Boundaries
- Accessibility
- Testing Strategies
- Build Optimization
- Use React.memo() for expensive components
- Implement code splitting with lazy()
- Avoid inline functions in JSX
- Use Suspense boundaries for async data
Development Workflow
Starting Development
http://localhost:5173
Build for Production
dist/:
index.html- Entry HTMLassets/*.js- JavaScript bundlesassets/*.css- CSS bundles- All files have content hashes for caching
Preview Production Build
Deployment Options
- Vercel
- Netlify
- Static Hosting
Deploy to Vercel
Automatic:- Connect GitHub repository
- Vercel auto-detects Vite
- Deploys on every push
vercel.jsonComparison with Core Monorepo
| Feature | React Template | Core Monorepo |
|---|---|---|
| Backend | ❌ External | ✅ Included (Express) |
| Frontend | ✅ Vite + React | ✅ Vite + React |
| Deployment | Static hosting | Full-stack or split |
| Complexity | Lower | Higher |
| Use Case | Frontend-only | Full-stack |
| Skills | 2 skills | 3 skills |
| File Size | Smaller | Larger |
Next Steps
Core Monorepo
Compare with full-stack architecture
Project Structure
Explore detailed directory layout
Getting Started
Set up your first React project
Deployment Guide
Deploy your React application