With all batteries included in this project, you can start building React apps with Vite.
This project is a starter template using Vite for fast React development with TypeScript, TailwindCSS, and other modern tools for building, linting, formatting, and testing.
# Clone the repository
git clone https://github.com/tejachundru/vite-starter
# Navigate to the project directory
cd vite-starter
# Reset the git repository
rm -rf .git
# Install dependencies
pnpm install
# Setup project
pnpm run bootstrap
# Start development
pnpm run dev
Built with type safety, scalability, and developer experience in mind. A batteries included Vite + React template.
In this project, the following scripts are available:
Script | Description |
---|---|
bootstrap |
Initializes the project with Husky and Playwright |
format |
Formats the code using Prettier |
lint |
Lints the code with ESLint to ensure coding standards are followed |
lint:fix |
Fixes linting issues automatically |
dev |
Starts the development server using Vite |
storybook |
Launches Storybook in development mode to view and test UI components |
storybook:build |
Builds Storybook for production |
test |
Runs unit and end-to-end tests |
test:unit |
Runs only unit tests |
test:unit:coverage |
Runs unit tests with coverage report |
test:e2e |
Runs only end-to-end tests |
test:e2e:report |
Shows the Playwright test report |
build |
Builds the project for production using Vite |
preview |
Starts the preview server with Vite to view the production build locally |
commitlint |
Lints commit messages to ensure they follow the defined conventions |
commitizen |
Initializes Commitizen to assist with conventional commit message formatting |
react-vite-starter/
โโโ .storybook/ # Storybook configuration
โโโ e2e/ # End-to-end tests
โโโ public/ # Static assets
โโโ src/
โ โโโ assets/ # Images, fonts, etc.
โ โโโ components/ # Reusable UI components
โ โโโ hooks/ # Custom React hooks
โ โโโ lib/ # Utility functions
โ โโโ locales/ # i18n translations
โ โโโ pages/ # Page components
โ โโโ router/ # Routing configuration
โ โโโ services/ # API services
โ โโโ store/ # Redux store and slices
โ โโโ App.tsx # Main App component
โ โโโ main.tsx # Entry point
docker build -t my-app -f ./Dockerfile.dev .
This image is production-optimized using a multi-stage build for a minimal footprint with built-in nginx configuration to efficiently serve your application.
docker build -t my-app -f ./Dockerfile .
To run the Docker container:
docker run -p 8080:80 my-app
Create a .env
file in the root directory with the following variables:
VITE_API_URL=https://api.example.com
git checkout -b feature/my-feature
pnpm run commitizen
git push origin feature/my-feature
This project is licensed under the MIT License - see the LICENSE file for details.
Some resources links that can helpful while development