A modern React boilerplate uses the latest React and integrates a series of excellent development tools and best practices. This project is aim to porvide another option for people who prefer not to use React Server Component.
- 🚀 Fast development and building with Vite
- ⚛️ Latest React 19 with React Router
- 🎨 Styling with Tailwind CSS and Class Variance Authority
- 📝 Full TypeScript support
- 🧪 Testing with Vitest
- 🎯 Code quality with ESLint and Prettier
- 📊 Bundle analysis
- 🌐 Internationalization with i18next
- 🚦 Git hooks and commit lint
- Node.js >= 20.0.0
- pnpm >= 10.0.0
# Clone the repository
git clone https://github.com/your-username/react-boilerplate.git
cd react-boilerplate
# Install dependencies
pnpm install# Start the development server
pnpm devVisit http://localhost:5173 to view your application.
# Build for production
pnpm build
# Preview the build
pnpm preview# Run tests
pnpm test# Run ESLint
pnpm lintsrc/
├── assets/ # Static assets
├── components/ # Reusable components
├── pages/ # Page components
├── shared/ # Shared utilities and types
│ └── i18n/ # Internationalization configuration
├── App.tsx # Root component
├── AppRoutes.tsx # Route configuration
└── main.tsx # Application entry point
- Framework: React 19
- Build Tool: Vite
- Routing: React Router
- Styling: Tailwind CSS, Class Variance Authority
- Testing: Vitest, Testing Library
- Code Quality: ESLint, Prettier
- Type Checking: TypeScript
- Package Manager: pnpm
- Internationalization: i18next, react-i18next
The project uses Tailwind CSS for styling, combined with Class Variance Authority for reusable component variants.
Route configuration is located in src/AppRoutes.tsx, implemented using React Router.
The project uses i18next for internationalization. Language files are located in src/shared/i18n/locales/. To add a new language:
- Create a new language folder in
src/shared/i18n/locales/ - Add translation files following the existing structure
- Update the language list in
src/components/LanguageSwitcher.tsx
Currently supported languages:
- English (en-US)
- Chinese (zh-CN)
- Vitest as the test runner
- React Testing Library for component testing
- Test files use the
.test.tsxextension
The project supports the following environment configurations:
.env.development- Development environment settings.env.production- Production environment settings.env.test- Test environment settings
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Thanks to all the developers who have contributed to this project!