Skip to content

Start a ReactJS Web App, SPA, website or landing page using JavaScript, Tailwind CSS, ESLint, Husky Vite, SWC and much more, in JUST 30 seconds, without the hassle of setting up your dev environment.

License

doinel1a/vite-react-js-starter

Repository files navigation

Vite React JavaScript β€” Starter template

Are you looking for a way to supercharge your development experience and build stunning web applications with ease? You are in the right place! This development starter template is the ultimate solution to help you getting started on your project in no time, without the hassle of setting up and configuring your development environment from scratch each time you start working. This template is ideal for front-end developers who want to build modern, fast and reliable web applications with the latest cutting edge technologies such as React JS, JavaScript, Tailwind CSS, ESLint, Prettier, Husky, Vite and much more!

Demo β€” Bug(label: bug) β€” Feature(label: enhancement)

πŸ”– Table of contents


πŸ“¦ Features

This development starter template comes fully equipped with all the necessary tools to create modern, responsive and fast web applications, including:

  • React JS: A library for building user interfaces that uses a declarative approach and provides a way to create reusable UI components;
  • JavaScript: A programming language used primarily for creating dynamic web content and interactive user interfaces;
  • Tailwind CSS: A utility-first CSS framework that provides predefined classes for common styles and layout patterns, allowing quick styling without writing custom CSS;
  • SASS: A CSS preprocessor that adds features such as variables, nesting, and mixins to CSS, making it easier to write and maintain large CSS codebases;
  • PostCSS: A tool for transforming CSS with JavaScript plugins, allowing to add new features to CSS and improve the development process:
    • Autoprefixer: A PostCSS plugin that adds vendor prefixes to CSS properties, ensuring cross-browser compatibility;
    • CSSnano: A PostCSS plugin that minifies CSS code, reducing file size and improving page load times;
  • Fontawesome: A library with over 5000 free icons that can be easily customized and used in web applications;
  • Playwright: A library for automating web browser interactions, allowing the writing of end-to-end tests and perform browser automation tasks;
  • Vite: A build tool and development server that provides fast and efficient development and production builds for modern web applications:
    • SWC: An extensible Rust-based platform used for both compilation and bundling both JavaScript and TypeScript into cross-browser supported code;
    • Partytown: A lazy-loaded library to help relocate resource intensive scripts into a web worker, and off of the main thread. Its goal is to help speed up sites by dedicating the main thread to your code, and offloading third-party scripts to a web worker;

And with tools that enhance the development experience:

  • ESLint: A tool for enforcing coding standards and identifying potential errors in the code;
  • Prettier: A code formatter that automatically formats code to conform to a consistent style, making it easier to read and maintain;
  • Husky: A Git hook manager that allows easy set up and configuration of Git hooks, which are scripts that run at certain points in the Git workflow;
  • Commitlint: A tool for enforcing commit message conventions in Git repositories, helping to ensure consistent and informative commit messages;

Back to:arrow_up:


πŸ’» Getting started

Prerequisites:

  • JavaScript runtime Node;
  • (OPTIONAL)
    Yarn package manager: npm install --global yarn;

To get started with this template:

  • Get the repository:

    • click "Use this template" button
      or
    • click the "Fork" button
      or
    • clone the repository git clone https://github.com/doinel1a/vite-react-js-starter/ YOUR-PROJECT-NAME;
  • Open the terminal or the code editor, to the path your project is located, and run:

    • With NPM :
      • To install the dependencies: npm install;
      • To run the development server: npm run dev;
      • To build your app for production: npm run build;
      • To preview your production optimized app: npm run preview;
    • With Yarn :
      • To install the dependencies: yarn install;
      • To run the development server: yarn dev;
      • To build your app for production: yarn build;
      • To preview your production optimized app: yarn preview;
  • Keep in mind:

    • The playwright package needs specific versions of browser binaries to operate, you can install them by running:
      • With NPM : npx playwright install;
      • With Yarn : yarn playwright install;

Back to:arrow_up:


πŸ”ƒ Versions

Webpack and Vite are popular build tools for web applications, but they differ in terms of build speed and configuration. Vite is faster than Webpack, especially for large projects, and has a more "zero-config" approach. Both tools support SWC as a compiler, but Vite is optimized for it out of the box, making it even faster. If you prioritize speed and ease of use, go with the Vite versions. If you need more control over your build process, choose the Webpack version.

Vite:

React - TypeScript React - JavaScript Vanilla TypeScript Vanilla JavaScript
React & TS
Repo
React & JS
This repo
TS
Soon!
JS
Soon!

Webpack:

React - TypeScript React - JavaScript Vanilla TypeScript Vanilla JavaScript
React & TS
Repo
React & JS
Soon!
TS
Soon!
JS
Repo

Back to:arrow_up:


🌐 Browsers support

The provided configuration ensures 92.3 % of global browsers , especially it supports the last three versions of the following browsers:

Chrome Firefox Edge Opera Safari
Google Chrome Mozilla Firefox Microsoft Edge Opera Apple Safari

In order to support a wider percentage of browsers and meet your project requirements, update the ./.browserslistrc configuration file:

  1. last 3 versions: the versions of each browser;
  2. > 0.2%: the browsers usage statistics;
  3. not dead: the browsers official support or updates;

You can play with the configurations here and check in real-time the global browsers support .

The more versions to support, larger JS and CSS bundles size will be.

Back to:arrow_up:


πŸ‘₯ Contribute

Contributions are what make the open source community such an amazing place to learn, inspire, and create.
Any contribution is greatly appreciated: big or small, it can be documentation updates, adding new features or something bigger.
Please check the contributing guide for details on how to help out and keep in mind that all commits must follow the conventional commit format.

How to contribute:

  1. Get started;
  2. For a new feature:
    1. Create a new branch: git checkout -b feat/NEW-FEATURE;
    2. Add your changes to the staging area: git add PATH/TO/FILENAME.EXTENSION;
    3. Commit your changes: git commit -m "feat: NEW FEATURE";
    4. Push your new branch: git push origin feat/NEW-FEATURE;
  3. For a bug fix:
    1. Create a new branch: git checkout -b fix/BUG-FIX;
    2. Add your changes to the staging area: git add PATH/TO/FILENAME.EXTENSION;
    3. Commit your changes: git commit -m "fix: BUG FIX";
    4. Push your new branch: git push origin fix/BUG-FIX;
  4. Open a new pull request;
  5. Once your pull request has been merged, you can delete the branch;

Back to:arrow_up:


πŸ“‘ License

All logos and trademarks are the property of their respective owners.
Everything else is distributed under the MIT License .
See the LICENSE file for more informations.

Back to:arrow_up:


πŸ’Ž Acknowledgements

Special thanks to:

Back to:arrow_up: