8000 GitHub - threeal/react-starter: A minimalist template for starting a new React project
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

threeal/react-starter

Repository files navigation

React Starter

A minimalist template for starting a new React project.

This template provides a basic React project containing a sample web application written in TypeScript, with built-in support for formatting, linting, testing, and continuous integration.

Key Features

  • Minimal React project written in TypeScript with ESM support.
  • Uses pnpm as the package manager.
  • Supports formatting with Prettier, linting with ESLint, and testing with Vitest.
  • Fixes formatting and linting during pre-commit hooks using Lefthook.
  • Preconfigured workflows for Dependabot and GitHub Actions.
  • Supports deployment of the web application to GitHub Pages.

Usage

This guide explains how to use this template to start a new React project, from creation to deployment.

Create a New Project

Follow this link to create a new project based on this template. For more information about creating a repository from a template on GitHub, refer to this documentation.

Alternatively, you can clone this repository locally to begin using this template.

Choose a License

By default, this template is unlicensed. Before modifying this template, it is recommended to replace the LICENSE file with the license that will be used for the new project. For more information about licensing a repository, refer to this documentation.

Alternatively, you can remove the LICENSE file or leave it as is to keep the new project unlicensed.

Set Up Tools

This template uses pnpm as the package manager. If pnpm is not installed, follow this guide to install it. Then, install the project dependencies with:

pnpm install

For more information on pnpm, including how to add dependencies or run tools, refer to this documentation.

Developing the App

Run the development version of the app using:

pnpm dev

While viewing the development version, you can modify the app by updating the source code in the src directory. You can also modify the index.html file to update the app’s metadata, such as the title and icon. If you're new to React, refer to this documentation for guidance.

Testing the App

Test files in this template are named *.test.tsx and typically correspond to the components being tested. This template uses Vitest and Playwright for testing. For more information on testing with Vitest, refer to this documentation.

After writing the tests, run them with:

pnpm test

Deploying the App

To deploy the app, first set up your GitHub repository to enable deployment to GitHub Pages using GitHub Actions (see this guide). Then commit your changes and push them to the main branch. Every change pushed to the main branch will automatically trigger a CI workflow to deploy the app to GitHub Pages.

0