Skip to content
/ vite-template Public template

πŸš€ Kickstart your React projects with this ⚑️ Vite-powered template! Simplify your workflow by reducing repetitive tasks and focus on building high-quality apps. Ideal for both beginners and pros, this template is your go-to for a fast, efficient start. πŸ”₯

License

Notifications You must be signed in to change notification settings

deepumandal/vite-template

Repository files navigation

React Logo Vite Logo TypeScript Logo

React Vite Template

πŸš€ Modern React Template: 2024-Ready and Pre-Configured! πŸš€


Live!

πŸ“– Documentation | πŸš€ Getting Started | πŸ™Œ Join Us

Build License Prettier Vite TypeScript React Redux TailwindCSS Contributions Open Issues

Objective

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.

Table of Contents

  1. Introduction
  2. Key Features
  3. Why Vite Template?
  4. Getting Started
  5. Project Structure
  6. Development Workflow
  7. Built-in Tools
  8. Configuration
  9. Pros and Cons
  10. Contribution Guidelines
  11. Flowcharts
  12. FAQ
  13. License

Introduction

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.

Key Features

⚑ Vite + React + TypeScript

  • 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.

🎨 Pre-Built UI Components

  • 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.

πŸ› οΈ Developer Tools

  • 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.

πŸ“š Documentation

  • Comprehensive Docs: In-depth documentation to guide you through the setup and usage.
  • Modern Design: User-friendly and easy-to-navigate documentation structure.

Why Vite Template?

Problem

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.

Solution

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.

Impact

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

Getting Started

Prerequisites

  • Node.js (version 14.0.0 or higher)
  • npm or yarn or pnpm

Note: This is suggested use pnpm over npm and yarn.

Installation

  1. Use this Template:

    • click on use this template
  2. Clone the repository:

    git clone https://github.com/your-username/vite-template.git
    cd vite-template
  3. Install dependencies:

    npm install
    # or
    yarn install
    # or
    pnpm install
  4. Start the development server:

    npm run dev
    # or
    yarn dev
    # or
    pnpm install

Project Structure

πŸ“‚ .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.

Development Workflow

Commands

  • 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

Recommended Extensions

VSCode Extensions:

  • ESLint
  • Prettier - Code formatter
  • TailwindCSS

Built with Tools

TypeScript React React Hook Form Radix UI clsx
Lucide React Prettier Tailwind CSS React DOM Zod
cspell Vite ESLint Husky ts-node

Contribution Guidelines

We welcome contributions from the community. Please follow these steps to contribute:

  1. Fork the repository and clone your fork.
  2. Create a new branch: git checkout -b my-feature
  3. Make your changes and commit them: git commit -m 'Add some feature
  4. Push to the branch:git push origin my-feature
  5. Open a pull request.

Flowcharts

Development Workflow

graph TD
    A[Clone Repository]
    A --> B[Install Dependencies]
    B --> C[Start Dev Server]
    C --> D[Develop & Test]
    D --> E[Build for Production]

Loading

Contribution Process

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]

Loading

FAQ

Why use Vite over traditional build tools like Webpack?

Vite offers a faster development experience due to its instant server start and fast HMR, leveraging native ES modules.

Can I use this template with TypeScript?

Yes, TypeScript support is built-in. You can easily switch to TypeScript by renaming your files to .ts and .tsx.

How do I add a new dependency?

You can add a new dependency using npm or yarn:

npm install <dependency-name>
# or
yarn add <dependency-name>

How do I customize the ESLint or Prettier configuration?

You can modify the configuration files .eslintrc.js to fit your preferences.

License

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! πŸš€

About

πŸš€ Kickstart your React projects with this ⚑️ Vite-powered template! Simplify your workflow by reducing repetitive tasks and focus on building high-quality apps. Ideal for both beginners and pros, this template is your go-to for a fast, efficient start. πŸ”₯

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published