English | 中文
This is a continuously updated React project starter template designed to streamline the process of initiating new projects. It provides a foundation with essential configurations and best practices, allowing you to focus on building your application without the hassle of setting up the basics.
Technologies Used
- React: A JavaScript library for building user interfaces
- TypeScript: A typed superset of JavaScript
- pnpm: Fast, disk space-efficient package manager
- tailwindcss: Utility-first CSS framework
- Zustand: A small, fast, and scaleable state management for React
- React Query: Data fetching and caching library for React
- shadcn/ui: UI components library
- swagger-typescript-api: Generate TypeScript client for any API defined by OpenAPI Specification
- Storybook: frontend workshop for building UI components and pages in isolation
- react-i18next: Internationalization for react done right. Using the i18next i18n ecosystem.
Tools for Development
- biome:A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
- vitest: Next generation testing framework powered by Vite
- react-testing-library: Simple and complete React DOM testing utilities that encourage good testing practices
- CommitLint: Linting for conventional commit messages
- Husky: Git hooks made easy
- Lint-Staged: Run linters on pre-committed files
- knip: Find unused files, dependencies and exports in your JavaScript and TypeScript projects
Reference the .env.example file in the env folder, and create .env.development and .env.production files
This project uses pnpm as package manager
npm install --global pnpm
Clone the project
git clone https://github.com/wojiangkuanglong/react-fresh-starter.git
Go to the project directory
cd react-fresh-starter
Install dependencies
# node ^22.x.x,pnpm ^9.x.x
pnpm install
Start the server
pnpm start
or
pnpm dev
Other
# Check for unused files, export, and manage dependencies
pnpm knip
# Automatically generate API based on swagger.json, default location is src/services
pnpm api
-
- Configure server proxy in vite.config.ts
- Create a .env.development.local file in the env directory based on .env.example, with VITE_PROXY_TARGET set to the backend address.
-
Set VITE_PROXY_COOKIE, It is recommended to use whistle with Proxy SwitchyOmega browser extension.
To deploy this project run
pnpm release
- Open an MR (Merge Request) against the 'publish' branch.
- After successful deployment and completion of online regression, locally execute git checkout publish and pull the latest code.
- Run pnpm run release to automatically update the CHANGELOG and create a tag based on commits.
- Execute git push --follow-tags origin publish.
- Initiate an MR from 'publish' to 'master' on Github.
- i18n
- storybook
- test