This boilerplate provides a robust setup to kickstart React applications with TypeScript, Vite, and a modern development environment. It includes essential tools and configurations to streamline development, enforce code quality, and ensure scalability.
- React 18 with TypeScript for type-safe development.
- Vite for fast builds and Hot Module Replacement (HMR).
- ESLint with type-aware linting and React-specific rules.
- Prettier for consistent code formatting.
- Tailwind CSS for utility-first styling.
- Recharts for building customizable charts.
- pnpm for efficient dependency management.
├── .env # Environment variables
├── .prettierrc # Prettier configuration
├── eslint.config.js # ESLint configuration
├── tailwind.config.ts # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
├── tsconfig.app.json # App-specific TypeScript configuration
├── tsconfig.node.json # Node-specific TypeScript configuration
├── vite.config.ts # Vite configuration
├── src/ # Source code
│ ├── components/ # Reusable UI components
│ │ └── ui/ # UI-specific components (e.g., charts)
│ └── lib/ # Utility functions
├── public/ # Static assets
└── README.md
Ensure you have the following installed:
- Clone the repository:
git clone <repository-url> cd <repository-name>
- Install dependencies:
pnpm install
- Start the development server:
pnpm dev
- Open your browser and navigate to http://localhost:5173 to see the app running.
To build the app for production, run:
pnpm buildThe production-ready files will be generated in the dist directory.
This project uses ESLint with type-aware linting and React-specific rules. The configuration is located in eslint.config.js. Key features include:
- TypeScript-aware linting with
@typescript-eslint. - React-specific linting with
eslint-plugin-react. - Recommended and stylistic rules for consistent code quality.
To enable stricter linting rules for production:
- Update the
parserOptionsineslint.config.js
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},:-
Replace
tseslint.configs.recommendedwithtseslint.configs.recommendedTypeCheckedortseslint.configs.strictTypeChecked. -
Optionally, add
...tseslint.configs.stylisticTypeChecked.
Prettier is configured in .prettierrc and includes plugins for sorting imports, organizing attributes, and more. Key plugins include:
prettier-plugin-tailwindcssfor Tailwind class sorting.prettier-plugin-sort-importsfor import organization.
Tailwind CSS is configured in tailwind.config.ts. It provides utility-first styling and integrates seamlessly with your React components.
This project is licensed under the MIT License. See the LICENSE file for details.
This updated README.md reflects the libraries and files in your workspace, providing clear instructions and highlighting the key features of your boilerplate.