GithubHelp home page GithubHelp logo

ts-vite-react-template's Introduction

Modern Tooling React Templates

This repository contains two React templates for starting a project with modern tooling, including Vite, SWC, Vitest, Redux Toolkit, etc. The templates are organized into separate folders and are available on the branch. These templates can be used as a solid starting point for building a React application with the latest tooling and best practices.

πŸ“Templates

1. Base Template

This template contains the following:

  • Vite
  • React
  • SWC
  • Styled Components
  • svgr
  • Vitest
  • Testing Library
  • Eslint
  • Prettier
  • lint-staged

2. With Redux Toolkit Template

This template contains the following:

  • Vite
  • React
  • SWC
  • Styled Components
  • svgr
  • Vitest
  • Testing Library
  • Eslint
  • Prettier
  • lint-staged
  • Redux Toolkit

πŸ”§ Installation

To use the templates, follow the steps below:

  1. Install degit:

    pnpm add -g degit
    
  2. Clone the repository:

    • Base Template:
      degit  https://github.com/dragenet/ts-vite-react-template.git/base <target-dir>
      
    • With Redux Toolkit:
      degit  https://github.com/dragenet/ts-vite-react-template.git/with-redux-toolkit <target-dir>
      
  3. Change directory to the desired template:

    cd <target-dir>
    
  4. Initialize git:

    git init
    
  5. Install dependencies:

    pnpm install
    
  6. Start the development server:

    pnpm dev
    

πŸ“ Template Structure

Each template has the following file and folder structure (excluding store directory):

β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
β”œβ”€β”€ pnpm-lock.yaml
β”œβ”€β”€ public
β”‚Β Β  └── vite.svg
β”œβ”€β”€ src
β”‚Β Β  β”œβ”€β”€ main.tsx
β”‚Β Β  β”œβ”€β”€ App.tsx
β”‚Β Β  β”œβ”€β”€ assets
β”‚Β Β  β”œβ”€β”€ components
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ molecules
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Helmet
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── RootProvider
β”‚Β Β  β”‚Β Β  └── templates
β”‚Β Β  β”‚Β Β      └── HomePageTemplate
β”‚Β Β  β”œβ”€β”€ pages
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Home.tsx
β”‚Β Β  β”œβ”€β”€ router
β”‚Β Β  β”œβ”€β”€ store (*only for with-redux-toolkit template)
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ apis
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ hooks
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ useAppDispatch.ts
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── useAppSelector.ts
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ rootStore.ts
β”‚Β Β  β”‚Β Β  └── slices
β”‚Β Β  β”œβ”€β”€ theme
β”‚Β Β  β”œβ”€β”€ types
β”‚Β Β  β”‚Β Β  └── env.d.ts
β”‚Β Β  └── utils
β”‚Β Β      └── test
β”‚Β Β          β”œβ”€β”€ renderTest.tsx
β”‚Β Β          └── withTestRouter.tsx
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ tsconfig.node.json
β”œβ”€β”€ vite.config.ts
└── vitest.setup.ts

πŸ“ Contribution

If you find any bug or have any suggestion, feel free to open an issue or submit a pull request.

πŸ” License

This project is licensed under the MIT License - see the LICENSE.md file for details.

ts-vite-react-template's People

Contributors

dragenet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.