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-tailwindInstall dependencies
bun installπ Development
Start development server
bun run dev
# The application will be available at http://localhost:8000Build 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_urlTypeScript
The project includes two TypeScript configurations:
tsconfig.app.json- Application configurationtsconfig.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
Create a new JSON file in the
src/i18n/translationsdirectory with the language code as the filename (e.g.,fr.jsonfor French).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>
)
}