π Modern React Template: 2024-Ready and Pre-Configured! π
π Documentation | π Getting Started | π Join Us
This template is designed to supercharge your frontend development experience by providing a pre-configured setup that reduces the repetitive tasks you often face when starting a new project. Whether you're a seasoned developer or just getting started, this template has everything you need to kickstart your next project with minimal hassle.
- Introduction
- Key Features
- Why Vite Template?
- Getting Started
- Project Structure
- Development Workflow
- Built-in Tools
- Configuration
- Pros and Cons
- Contribution Guidelines
- Flowcharts
- FAQ
- License
Welcome to the Vite Template project! π
This Vite template aims to streamline the process of setting up a new frontend project. With modern tools and best practices built-in, you can focus more on developing your application and less on configuring your environment.
- Fast Build System: Leverage the speed of Vite with the flexibility of React and TypeScript.
- Hot Module Replacement (HMR): Instant updates during development for a seamless experience.
- TailwindCSS Integration: Responsive, utility-first CSS framework for rapid UI development.
- Pre-Configured Components: A set of reusable UI components to get you started quickly.
- Custom Color Palette: Easily adjustable to match your brand or project theme.
- Husky: Pre-commit hooks to ensure code quality.
- Prettier + ESLint: Automated code formatting and linting for a consistent codebase.
- YAML Workflows: Pre-configured GitHub Actions for CI/CD pipelines.
- Redux Integration: State management with minimal setup.
- Comprehensive Docs: In-depth documentation to guide you through the setup and usage.
- Modern Design: User-friendly and easy-to-navigate documentation structure.
Starting a new React application often involves repetitive tasks such as setting up Vite, configuring linting rules, integrating Tailwind CSS, building UI components, setting up lint-staged, and more. These steps can be time-consuming and prone to errors, slowing down your development process.
This Vite template is designed to supercharge your frontend development experience by providing a pre-configured setup that reduces these repetitive tasks. It includes the latest tech stacks and configurations, ensuring you have everything you need to kickstart your next project with minimal hassle:
- ESLint: Pre-configured linting rules to maintain code quality.
- Prettier: Code formatting setup to ensure consistency across your codebase.
- Husky: Pre-commit hooks to run tasks such as linting and tests before committing code.
- Predefined UI Components: A set of reusable UI components to accelerate your development.
Adopting this Vite template brings several significant benefits
- Enhanced Developer Experience: Spend less time on setup and more time on building features, thanks to the pre-configured setup.
- Improved Productivity: With essential tools and configurations already in place, you can quickly start coding without worrying about the boilerplate setup.
- Consistency and Quality: Pre-configured linting and formatting tools ensure a consistent and high-quality codebase.
- Future-Proof: The template includes the latest best practices and technologies, keeping your project up-to-date with minimal effort.
Whether you're a seasoned developer or just getting started, this Vite template provides a robust foundation for your project, allowing you to focus on what matters most: building amazing applications
- Node.js (version 14.0.0 or higher)
- npm or yarn or pnpm
Note: This is suggested use pnpm over npm and yarn.
-
Use this Template:
- click on use this template
-
Clone the repository:
git clone https://github.com/your-username/vite-template.git cd vite-template
-
Install dependencies:
npm install # or yarn install # or pnpm install
-
Start the development server:
npm run dev # or yarn dev # or pnpm install
π .github # GitHub actions and CI/CD pipelines
βββ π workflows
βββ π codeql.yml # Configuration for GitHub CodeQL analysis
π .husky
βββ π pre-commit # Husky pre-commit hook script
π docs # Documentation files for the template
π public # Publicly accessible static files
π src # Source folder
βββ π @types # TypeScript type definitions
βββ π assets # Static assets
β βββ π fonts # Custom font files
β βββ π styles # All CSS files for components
β βββ π svg # SVG media files
βββ π components # components
β βββ π HOC # Higher-Order Components
β βββ π config # Configuration for components
β β βββ π ui # UI component configurations
β β βββ π index.ts # Entry point for config
β βββ π hooks # Custom React hooks
β β βββ π useTheme # Hook for theme management
β β βββ π index.ts # Entry point for hooks
β βββ π shared # Shared components and utilities
β β βββ π Form # Form component files
β β βββ π Label # Label component files
β β βββ π index.ts # Entry point for shared components
β βββ π ui # UI components
β β βββ π Accordion # Accordion component files
β β βββ π Avatar # Avatar component files
β β βββ π Badge # Badge component files
β β βββ π Block # Block component files
β β βββ π Breadcrumb # Breadcrumb component files
β β βββ π Button # Button component files
β β βββ π CheckBox # CheckBox component files
β β βββ π Common # Common UI components
β β βββ π ConfirmationDialog # Confirmation Dialog component files
β β βββ π Container # Container component files
β β βββ π ContextMenu # Context Menu component files
β β βββ π DropDownMenu # DropDown Menu component files
β β βββ π Flex # Flex component files
β β βββ π Grid # Grid component files
β β βββ π HoverCard # HoverCard component files
β β βββ π Model # Model component files
β β βββ π Separator # Separator component files
β β βββ π Skeleton # Skeleton component files
β β βββ π ToolTip # ToolTip component files
β β βββ π Typography # Typography component files
β β βββ π index.ts # Entry point for UI components
βββ π utils # Utility functions and helpers
β βββ π className # Utility functions for class names
βββ π App.tsx # Main application component
βββ π main.tsx # Entry point of the application
βββ π tailwind.css # Tailwind CSS configuration
βββ π vite-env.d.ts # TypeScript environment definitions for Vite
π .eslintignore # List of files and directories ignored by ESLint
π .eslintrc.cjs # ESLint configuration file
π .gitignore # List of files and directories ignored by Git
π LICENCE.md # License information
π README.md # Main README file with project overview
π SECURITY.md # Security policies and guidelines
π cspell.json # Configuration for cspell (spell checker)
π index.html # Main HTML file for the application
π package.json # Project dependencies and scripts
π pnpm-lock.yaml # Lockfile for pnpm package manager
π postcss.config.js # PostCSS configuration
π tailwind.config.js # Tailwind CSS configuration
π tsconfig.json # TypeScript configuration
π tsconfig.node.json # TypeScript configuration for Node.js
π vite.config.ts # Vite configuration file
Here is the basic overview of folder structure.
-
Start Development Server:
npm run start
yarn start
pnpm start
-
Build for Production:
npm run build
yarn build
pnpm build
-
Lint Code:
npm run lint
yarn lint
pnpm lint
-
Format Code:
npm run prettier:write
yarn prettier:write
pnpm prettier:write
-
Check Types:
npm run check-types
yarn check-types
pnpm check-types
-
Spell Check:
npm run spellcheck
yarn spellcheck
pnpm spellcheck
- ESLint
- Prettier - Code formatter
- TailwindCSS
TypeScript | React | React Hook Form | Radix UI | clsx |
---|---|---|---|---|
Lucide React | Prettier | Tailwind CSS | React DOM | Zod |
---|---|---|---|---|
cspell | Vite | ESLint | Husky | ts-node |
---|---|---|---|---|
We welcome contributions from the community. Please follow these steps to contribute:
- Fork the repository and clone your fork.
- Create a new branch:
git checkout -b my-feature
- Make your changes and commit them:
git commit -m 'Add some feature
- Push to the branch:
git push origin my-feature
- Open a pull request.
graph TD
A[Clone Repository]
A --> B[Install Dependencies]
B --> C[Start Dev Server]
C --> D[Develop & Test]
D --> E[Build for Production]
graph TD
A[Fork Repository]
A --> B[Create Branch]
B --> C[Make Changes]
C --> D[Commit Changes]
D --> E[Push to Branch]
E --> F[Open Pull Request]
Vite offers a faster development experience due to its instant server start and fast HMR, leveraging native ES modules.
Yes, TypeScript support is built-in. You can easily switch to TypeScript by renaming your files to .ts
and .tsx
.
You can add a new dependency using npm or yarn:
npm install <dependency-name>
# or
yarn add <dependency-name>
You can modify the configuration files .eslintrc.js
to fit your preferences.
This project is licensed under the MIT License. See the LICENSE file for more details.
Thank you for using our Vite template! If you have any questions or feedback, feel free to open an issue or contribute to the project. Happy coding! π