A modern React application starter template built with Vite, featuring a comprehensive development setup and best practices.
- ⚡️ [Vite](https://vitejs.dev/) - Next Generation Frontend Tooling
- ⚛️ [React 19](https://react.dev/) - JavaScript library for building user interfaces
- 🎨 [TailwindCSS](https://tailwindcss.com/) - Utility-first CSS framework
- 🧭 [React Router](https://reactrouter.com/) - Client-side routing
- 📦 [Zustand](https://zustand-demo.pmnd.rs/) - State management
- 🔍 [ESLint](https://eslint.org/) - Code linting
- 💅 [Prettier](https://prettier.io/) - Code formatting
- 🐶 [Husky](https://typicode.github.io/husky/) - Git hooks
- 📝 [CommitLint](https://commitlint.js.org/) - Lint commit messages
```plaintext
src/
├── assets/ # Static assets (images, fonts, etc.)
├── components/ # Reusable components
│ ├── common/ # Common components used across pages
│ └── ui/ # UI components (buttons, inputs, etc.)
├── context/ # React context providers
├── hooks/ # Custom React hooks
├── layouts/ # Layout components
├── lib/ # Utils and constant folder
│ ├── utils/ # Utility functions only
│ └── constants/ # Constant functions only
├── pages/ # Page components
├── store/ # Zustand store configurations
└── style/ # Global styles and Tailwind configuration### Prerequisites
- Node.js (version 16 or higher)
- npm or yarn
### Installation
1. Clone the repository:
```bash
git clone [repository-url]
cd react-starter
- Install dependencies:
npm install
# or
yarn installStart the development server:
npm run dev
# or
yarn devBuild the application:
npm run build
# or
yarn buildPreview the production build:
npm run preview
# or
yarn previewThis project uses Husky to enforce code quality and commit message conventions.
Husky is automatically installed and configured when you run npm install. It sets up the following hooks:
- Pre-commit: Runs linting and formatting checks
- Commit-msg: Validates commit messages follow conventional commits
Please initialze the husky using this command:
npx husky initWe follow the Conventional Commits specification. Commit messages should be structured as follows:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types include:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting, etc.)
- refactor: Code refactoring
- test: Adding or modifying tests
- chore: Maintenance tasks
Example:
feat(auth): add login functionality
npm run dev: Start development servernpm run build: Build for productionnpm run preview: Preview production buildnpm run lint: Lint code using ESLintnpm run format: Format code using Prettiernpm run prettier: Check code formatting