This template provides a starting point for building React applications using Vite as the build tool, TypeScript for type safety, Storybook for component development, Radix UI for accessible and customizable UI components, ESLint and Prettier for code formatting and linting, and lint-staged with husky for pre-commit hooks.
- Vite: A fast, modern build tool for web development.
- React: A JavaScript library for building user interfaces.
- TypeScript: A statically typed superset of JavaScript that compiles to plain JavaScript.
- Storybook: An open-source tool for developing UI components in isolation for React, Vue, and Angular.
- Radix UI: A collection of accessible and customizable UI components for React.
- ESLint: A pluggable linting utility for JavaScript and TypeScript.
- Prettier: An opinionated code formatter.
- lint-staged: Run linters on git staged files.
- husky: Git hooks made easy.
To create a new project based on this template, you can use degit to clone it without Git history:
npx degit EmilieLny/react-template my-react-app
After cloning the template, navigate to the newly created directory:
cd my-react-app
Then, install the dependencies:
npm install
# or
yarn
In the project directory, you can run:
Runs the app in development mode. Open http://localhost:3000 to view it in the browser.
Builds the app for production to the dist
folder.
Serves the production build from the dist
folder.
Runs ESLint to lint the TypeScript code.
Runs ESLint with the --fix
option to automatically fix linting issues.
Formats the code using Prettier.
Starts the Storybook server. Open http://localhost:6006 to view it in the browser.
Builds the Storybook as a static site for production to the storybook-static
folder.
The project structure is organized as follows:
my-react-app/
│
├── src/
│ ├── components/
│ │ ├── Button/
│ │ │ ├── Button.tsx
│ │ │ └── Button.stories.tsx
│ │ └── ...
│ ├── App.tsx
│ └── index.tsx
│
├── .storybook/
│ └── main.js
│
├── .eslintrc.js
├── .prettierrc.js
├── .lintstagedrc.js
├── .husky/
│ └── pre-commit
│
├── package.json
└── vite.config.ts
- React: A JavaScript library for building user interfaces.
- Vite: A build tool that aims to provide a faster and leaner development experience for modern web projects.
- TypeScript: A typed superset of JavaScript that compiles to plain JavaScript.
- Storybook: An open-source tool for developing UI components in isolation for React, Vue, and Angular.
- Radix UI: A collection of accessible and customizable UI components for React.
- ESLint: A pluggable linting utility for JavaScript and TypeScript.
- Prettier: An opinionated code formatter.
- lint-staged: Run linters on git staged files.
- husky: Git hooks made easy.
Contributions are welcome! If you'd like to contribute to this project, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.