Welcome to React Boilerplate!
This boilerplate provides a structured setup for starting React projects with Vite. It includes TypeScript, Tailwind CSS, ESLint, and more, to help you kickstart your development process efficiently.
Make sure you have Node.js and npm (or yarn) installed on your machine.
Clone this repository to your local machine:
git clone https://github.com/sujayk46/react-boilerplate.git
Install dependencies:
npm i
Start the development server, run:
npm run dev
This document provides an overview of the folder structure and content of the React boilerplate project.
This folder contains static assets and the HTML template (index.html
) where your React app is mounted. It's typically used for assets like logos, icons, or other files that need to be publicly accessible.
vite.svg
: An example SVG file used as a static asset.The src
folder is where the main application code resides. It contains various subfolders and files that organize the codebase.
Contains files related to the main application setup.
App.tsx
: The main React component where your application starts rendering.main.tsx
: The entry point of your application.Holds assets used in the application, such as images, JSON files, and SVG files.
images/
: Directory for image assets.jsons/
: Directory for JSON data files.svgs/
: Directory for SVG assets.Contains reusable UI components used across different parts of the application.
layouts/
: Components for defining layout structures.shared/
: Reusable components shared across the application.Contains configuration files for various libraries or frameworks used in the project.
mui/
: Configuration files for Material-UI, if applicable.theme.tsx
: Material-UI theme configuration.Contains environment-specific configuration files.
development.env
: Environment variables specific to the development environment.production.env
: Environment variables specific to the production environment.Contains React components representing different pages or routes in the application.
demo.tsx
: Example page component.landing-page/
: Directory for landing page components.secure/
: Directory for secure area components.Holds service files responsible for interfacing with external APIs or performing other asynchronous tasks.
Contains files related to application state management, such as Redux store setup and slices.
slices/
: Redux slice files.counter.slice.ts
: Example Redux slice file.store.init.ts
: Redux store initialization.Contains CSS files for styling the application.
App.css
: CSS file for styling the main application component.index.css
: CSS file for global styles.Type declaration file for Vite-specific environment variables.
.eslintrc.cjs
: ESLint configuration file..gitignore
: Specifies intentionally untracked files to ignore when using Git.index.html
: HTML template for the React app.LICENSE.md
: License file.package-lock.json
: Lockfile automatically generated for any operations where npm modifies either the node_modules
tree or package.json
.package.json
: Manifest file for Node.js projects, contains project metadata and dependencies.postcss.config.js
: PostCSS configuration file.README.md
: This file, provides an overview of the project structure and content.tailwind.config.js
: Tailwind CSS configuration file.tsconfig.json
: TypeScript configuration file.tsconfig.node.json
: TypeScript configuration file for Node.js environment.vite.config.ts
: Vite configuration file.This will start the development server and open your default web.
Currently, two official plugins are available:
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
parserOptions
property like this:export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
plugin:@typescript-eslint/recommended
to plugin:@typescript-eslint/recommended-type-checked
or plugin:@typescript-eslint/strict-type-checked
plugin:@typescript-eslint/stylistic-type-checked
plugin:react/recommended
& plugin:react/jsx-runtime
to the extends
listFeel free to contribute to this project by forking the repository, making your changes, and submitting a pull request. Any contributions you make are greatly appreciated.