An open API service indexing awesome lists of open source software.

https://github.com/mst-mkt/vite-react-template

React Template with Vite, @tanstack/resct-router, TailwindCSS
https://github.com/mst-mkt/vite-react-template

react tanstack-router vite

Last synced: 3 months ago
JSON representation

React Template with Vite, @tanstack/resct-router, TailwindCSS

Awesome Lists containing this project

README

        

# Vite and React template

Template for Vite and React projects.

> [!NOTE]
> This Template is basically for my personal use, but you can use it if you want. \
> If you have any suggestions or improvements, feel free to open an issue or a pull request.

## Tech Stack

| Name | Purpose |
| ---------------------- | ------------------------- |
| Vite | Build tool |
| React | UI library |
| Tailwind CSS | CSS framework |
| @tanstack/react-router | Routing library |
| valibot | Schema validation library |
| react-helmet-async | Dynamic meta tags |
| @tabler/icons-react | Icon component library |

### For development

| Name | Purpose |
| -------- | -------------------- |
| pnpm | Package manager |
| biome | Formatter and linter |
| lefthook | Git hooks |

## Development

### Install dependencies

```sh
pnpm i
```

### Run development server

```sh
pnpm dev
```

### Build

```sh
pnpm build
```

### Lint and format

```sh
pnpm check
```

with applying fixes:

```sh
pnpm fix
```

## Deployment

1. Create cloudflare pages project

```bash
pnpm wrangler pages project create
```

> [!NOTE]
> When deploying with GitHub Actions, the repository name and project name must be the same. \
> If you want to change it, edit the workflow yml.

2. Set secrets about cloudflare

Set some secrets in the repository secrets ([https://github.com/\[username\]/\[your-repo\]/settings/secrets/actions](https://github.com/username/your-repo/settings/secrets/actions)). \
Or you can use the gh cli.

```bash
gh secret set CLOUDFLARE_ACCOUNT_ID --body ""
gh secret set CLOUDFLARE_API_TOKEN --body ""
```

3. Deploy

Run the workflow manually or push to the main branch.