Turbo Setup: React 19.2.3 + React Compiler, TypeScript & TailwindCSS v4 Boilerplate

Launch your next React project with a robust, production-ready starter powered by React 19.2.3, TypeScript, and TailwindCSS v4. Enjoy rapid UI development, type safety, and a suite of modern tools for code quality, state management, and productivity. Build smarter, ship faster, and scale with confidence.

πŸš€ Features

  • βš›οΈ React 19.2.3 + TypeScript - Modern React with full TypeScript support.
  • βš›οΈ React Compiler - Automatic optimization via Babel plugin for better performance.
  • 🎨 Tailwind CSS v4 - Utility-first CSS for rapid UI development.
  • ⚑ Vite 7.2.7 - Next-generation frontend tooling for fast builds.
  • πŸ” ESLint - Code linting for consistent code quality.
  • 🧹 Prettier - Automated code formatting for style consistency.
  • πŸͺ Husky & lint-staged - Pre-commit hooks for linting and formatting your code.
  • 🏷️ Commitlint - Enforces conventional commit messages.
  • πŸ“¦ Zustand - Simple and fast state management.
  • πŸ—ΊοΈ React Router - Declarative routing for React apps.
  • πŸ“… Day.js - Lightweight date manipulation library.
  • 🌐 Axios - Promise-based HTTP client for the browser.
  • πŸ”„ Custom useFetch Hook - Lightweight data fetching with loading and error states (replaces SWR).
  • πŸ”— nuqs - Type-safe URL state management with React hooks.
  • 🌍 i18next - Internationalization support (English & Korean).

πŸ› οΈ Prerequisites

  • Node.js (v18 or higher)
  • Bun (latest version)

πŸ“¦ Installation

Install command

npx turbo-setup react-tailwind

Install dependencies

bun install

πŸš€ Development

Start development server

bun run dev

# The application will be available at http://localhost:8000

Build command

bun run build

# Preview production build
bun run preview

πŸ“ Development

src/
β”œβ”€β”€ assets/           # Static assets (images, fonts, icons)
β”œβ”€β”€ components/       # Reusable UI components
β”œβ”€β”€ configs/          # Configuration files (env, http, app urls)
β”œβ”€β”€ constants/        # Application constants and shared values
β”œβ”€β”€ hooks/            # Custom React hooks (useFetch, useMutation, useKeyPress)
β”œβ”€β”€ layouts/          # Layout components and templates
β”œβ”€β”€ pages/            # Page components
β”œβ”€β”€ providers/        # React context providers
β”œβ”€β”€ router/           # Routing configuration
β”œβ”€β”€ services/         # Browser services (cookies, localStorage)
β”œβ”€β”€ store/            # State management with Zustand
β”œβ”€β”€ styles/           # Global styles and Tailwind imports
β”œβ”€β”€ types/            # TypeScript type definitions
β”œβ”€β”€ utils/            # Utility functions
└── views/            # View components

πŸ”§ Configuration

Environment Variables

Create .env files for different environments:

VITE_ENV=development
VITE_API_URL=your_api_url

TypeScript

The project includes two TypeScript configurations:

  • tsconfig.app.json - Application configuration
  • tsconfig.node.json - Node.js configuration

ESLint & Prettier

  • ESLint is configured with TypeScript and React rules
  • Prettier is set up with custom formatting rules
  • Pre-commit hooks ensure code quality

React Compiler

The project uses React Compiler via babel-plugin-react-compiler for automatic optimization of React components. The compiler is configured in vite.config.ts using @vitejs/plugin-react (Babel-based) to support Babel plugins.

The compiler automatically optimizes your React code during the build process, analyzing components and hooks to determine when memoization is beneficial, eliminating the need for manual useMemo, useCallback, and React.memo in most cases.

🌍 Internationalization (i18n)

This project uses i18next with react-i18next for internationalization support. The translations are stored in JSON files located in the src/i18n/translations directory.

Adding a New Language

  1. Create a new JSON file in the src/i18n/translations directory with the language code as the filename (e.g., fr.json for French).

  2. Add your translations in the new JSON file. For example:

{
  "translation": {
    "welcome": "Bienvenue Γ  React, tailwindcss et plus"
  }
}

Switching Languages

The SwitchLanguage component allows users to switch between available languages. It uses the useTranslation hook from react-i18next to change the language dynamically.

Example usage in a component:

import { useTranslation } from 'react-i18next'
import SwitchLanguage from '@/components/SwitchLanguage/SwitchLanguage'

const HomeView = () => {
  const { t } = useTranslation()
  return (
    <div>
      <p>{t('welcome')}</p>
      <SwitchLanguage />
    </div>
  )
}