ViteReactStarter

vite-react-template — Vite Starter Template

By riipandi

A starter template based on Vite and React, preconfigured with StyleX, the TanStack suite, Vitest, and Testing Library, plus Storybook component browsing and a DummyJSON demo login.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

2 previews
Desktop homepage1 / 2
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 2

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-02View source

What stands out

A quick read of the recorded project description.

01

Starter structure with Vite + React + TypeScript, with absolute path imports preconfigured

02

Styling with StyleX, icons with Keyline Icons

03

Integrates TanStack Router, Form, Query, Store, Table, Virtual, Hotkeys, and Chart

04

Testing with Vitest and React Testing Library, with Oxlint and Oxfmt for linting and formatting

05

Includes a Storybook component browser, viewable online on the demo site

06

Authentication based on the DummyJSON API and ofetch, using a same-origin proxy and HttpOnly cookie session

Template Details

This is a starter template for React projects, built with Vite and written in TypeScript. The styling layer uses StyleX, and it integrates TanStack libraries including Router, Form, Query, Store, Table, Virtual, Hotkeys, and Chart. The template also configures absolute path imports, Oxlint and Oxfmt for linting and formatting, and Vitest with React Testing Library for testing.

Authentication calls the DummyJSON API via ofetch and uses a same-origin proxy with an HttpOnly cookie session, making it easy to replace with your own backend. The project includes Storybook, so you can browse the component library on the demo site. The README states that the template is mainly for the author's personal use, may contain bugs, and that release notes should be read carefully before upgrading.

The build output is a static SPA in .output/build/. Cookie-based authentication requires a same-origin API, so deployment needs a Netlify function proxy, your own backend, or a reverse proxy. The demo account is emilys / emilyspass; checking Remember me extends the session to 30 days.

ViteReactStarter

Is it right for your project?

Use Cases

  • Quickly starting a new frontend project with Vite and React
  • React applications that need the StyleX styling approach and the full TanStack suite
  • Projects that want to browse and develop UI components via Storybook
  • Prototypes that need a demo login flow and plan to replace it with their own backend

Suitable For

  • Developers familiar with React, TypeScript, and Vite
  • Projects that need preconfigured routing, forms, async state, and tables
  • Teams or individuals who want to use StyleX and Storybook
  • Developers who accept that the template may contain bugs and will adjust it themselves

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Create the project with npx tiged riipandi/vite-react-template myapp-name, replacing myapp-name

  2. 2

    After installing dependencies, run npm run dev (or the corresponding yarn/pnpm command); the app runs at http://localhost:3000 by default

  3. 3

    The demo login uses DummyJSON users, for example emilys / emilyspass; checking Remember me extends the session to 30 days

  4. 4

    Cookie authentication requires a same-origin API: Netlify can use its built-in function proxy, your own backend needs PUBLIC_API_URL set and auth endpoints implemented, or a reverse proxy can map /api to the backend

  5. 5

    When deploying to Cloudflare Pages, set NODE_VERSION to 18.17.1 or 20.9.0; for preview branches you can set PUBLIC_SITE_URL=${CF_PAGES_URL}

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version in the public repository under the Apache-2.0 license; the free scope is that version's code and does not mean external services or third-party assets are free.

Must comply with when using

  • Free use, modification, commercial use, and distribution are permitted; when distributing, include the Apache-2.0 license.
  • Modified files must be prominently marked as changed, and relevant copyright, patent, trademark, and attribution notices must be retained.
  • If the original project includes a NOTICE file, applicable attribution notices in it must be retained when distributing derivative works.
  • The license includes an applicable contributor patent grant; initiating patent litigation as described in the license terminates that patent grant, and no trademark rights are granted.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • The template's login authentication relies on the third-party DummyJSON demo API and does not include its own backend; for real projects, replace it with your own backend and implement the corresponding auth endpoints.
  • Cookie-based authentication requires a same-origin API; deployment must configure a Netlify function proxy, your own backend, or a reverse proxy, otherwise the login session will not work.
  • When deploying to Cloudflare Pages, you must set NODE_VERSION to 18.17.1 or 20.9.0 in environment variables, otherwise the build may fail.
  • The author states that the template is for personal use only, may contain bugs, and does not guarantee production readiness; evaluate and test it yourself before use.
  • Read the release notes carefully before upgrading, because version updates may introduce breaking changes.
  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses; do not judge them solely by the code's Apache-2.0 license.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis

no-charge, royalty-free, irrevocable copyright license

Original License Text

Authentication is implemented using [DummyJSON](https://dummyjson.com) API

Original README

Cookie auth needs a same-origin API.

Original README

You need to add `NODE_VERSION` with value `18.17.1` or `20.9.0` on the environment variables setting.

Original README

This project just a template that I use for my personal use, so you may encounter bugs.

Original README

Please review the release notes thoroughly before updating, as breaking changes can occur!

Original README
https://github.com/riipandi/vite-react-template/blob/main/LICENSE-APACHEhttps://github.com/riipandi/vite-react-template/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-03. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 92 / 100
Technologies
Vite · React
Website type
Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2026-09-21
Screenshot last checked
2026-10-03

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Vite as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Review declaration: [email protected] · 2026-10-04

Inspect the recorded source material

SHA-256: b27202598bc3acfb5a37616c200be61716c2fb46a6007e4b0f86a6535c2b48db

2026-10-03T19:16:21.503Z

Source file / repository
<p align="center"><img src="./public/images/vite.svg" width="500" height="120" alt="Project Logo"></p>
<p align="center">
    <a href="https://github.com/riipandi/vite-react-template/pulse">
        <img src="https://img.shields.io/badge/Contributions-welcome-blue.svg?style=flat-square" alt="Contribution welcome">
    </a>
    <a href="https://github.com/riipandi/vite-react-template">
        <img src="https://img.shields.io/github/languages/top/riipandi/vite-react-template?style=flat-square" alt="Top language">
    </a>
    <a href="https://aris.mit-license.org">
        <img src="https://img.shields.io/github/license/riipandi/vite-react-template?style=flat-square" alt="License">
    </a>
    <a href="https://app.netlify.com/sites/reactivite/deploys">
        <img src="https://api.netlify.com/api/v1/badges/47668315-f674-4560-8f83-52852dae2593/deploy-status" alt="Netlify Status">
    </a>
</p>

## Introduction

A starter project for [React](https://reactjs.org/) with [Vite](https://vitejs.dev/), [StyleX](https://stylexjs.com),
and [Typescript](https://www.typescriptlang.org/). This starter kit is already pre-configured
and [Typescript](https://www.typescriptlang.org/). This starter kit is already pre-configured
with [absolute import](https://jsdev.org/env/nodejs/absolute-path-imports/), [TanStack Router](https://tanstack.com/router),
[TanStack Form](https://tanstack.com/form), [TanStack Query](https://tanstack.com/query),
[TanStack Store](https://tanstack.com/store), [Oxlint](https://oxc.rs/docs/guide/usage/linter),
and [other goodies](./package.json). Authentication is implemented using [DummyJSON](https://dummyjson.com) API
with [ofetch](https://github.com/unjs/ofetch), easily replaceable with your own backend.

Browse the component library live in [Storybook](https://reactivite.netlify.app/storybook/).

> [!NOTE]
> This project just a template that I use for my personal use, so you may encounter bugs.
> Please review the release notes thoroughly before updating, as breaking changes can occur!

## The Complete Stack

- [x] [Vite](https://vitejs.dev/) - Next Generation Frontend Tooling.
- [x] [React](https://reactjs.org) - A JavaScript library for building user interfaces.
- [x] [StyleX](https://stylexjs.com) - The styling system for ambitious user interfaces.
- [x] [Keyline Icons](https://github.com/keyline-icons/keyline-icons) - Consistent 24×24 stroke, duotone, and fill icons.
- [x] [Typescript](https://www.typescriptlang.org) - Strongly typed programming language.
- [x] [TanStack Router](https://tanstack.com/router) - Type-safe routing for React.
- [x] [TanStack Form](https://tanstack.com/form) - Headless, type-safe form state management.
- [x] [TanStack Query](https://tanstack.com/query) - Powerful asynchronous state management.
- [x] [TanStack Store](https://tanstack.com/store) - Lightweight, type-safe state management.
- [x] [TanStack Table](https://tanstack.com/table) - A powerful engine for building Data Grids.
- [x] [TanStack Virtual](https://tanstack.com/virtual) - A headless UI utility for virtualizing long lists of elements.
- [x] [TanStack Hotkeys](https://tanstack.com/hotkeys) - A type-safe, framework-agnostic library for handling keyboard shortcuts.
- [x] [TanStack Chart](https://tanstack.com/charts) - A typed, tree-shakable chart grammar for SVG and Canvas.
- [x] [React Testing Library](https://testing-library.com/) - Light-weight solution for testing React components.
- [x] [Vitest](https://vitest.dev/) - Blazing Fast Unit Test Framework.
- [x] [Oxlint](https://oxc.rs/docs/guide/usage/linter) - High-performance JavaScript linter.
- [x] [Oxfmt](https://oxc.rs/docs/guide/usage/formatter) - High-performance code formatter.
- [x] [Storybook](https://storybook.js.org/) - UI component explorer for frontend developers.

## Quick Start

### Installation

```bash
npx tiged riipandi/vite-react-template myapp-name
```

> Don't forget to change `myapp-name` with your real application name.

### Up and Running

| NPM               | Yarn           | PNPM           | Description              |
|-------------------|----------------|----------------|--------------------------|
| `npm install`     | `yarn`         | `pnpm install` | install the dependencies |
| `npm run dev`     | `yarn dev`     | `pnpm dev`     | serve with hot reload    |
| `npm run build`   | `yarn build`   | `pnpm build`   | build for production     |
| `npm run preview` | `yarn preview` | `pnpm preview` | launch generated build   |

Application will run at `http://localhost:3000`

For detailed explanation on how things work, check out [Vite documentation](https://vitejs.dev/guide).

### Demo Account

Authentication hits the [DummyJSON](https://dummyjson.com) API through a same-origin proxy,
using HttpOnly cookie sessions. Use any valid [DummyJSON user](https://dummyjson.com/users) to sign in, e.g.:

| Username | Password     |
|----------|--------------|
| `emilys` | `emilyspass` |

Tick **Remember me** to extend the session lifetime to 30 days.

> [!IMPORTANT]
> Cookie auth needs a same-origin API. `pnpm dev`, `pnpm preview`, and `pnpm start`
> all ship with the same-origin proxy (`start`/`preview` serve the production
> build via Vite). See [Deploying the SPA](#deploying-the-spa).

## Deploy your own

Fork this repository, connect it to Netlify, and pushing to master will deploy to production! 🚀

<p>
  <a href="https://vercel.com/new/clone?repository-url=https://github.com/riipandi/vite-react-template&project-name=vite-react-template&repo-name=my-vite-react-app&env=PUBLIC_SITE_URL">
    <img src="https://vercel.com/button" alt="Deploy to Vercel" height="32" />
  </a>
  <a href="https://app.netlify.com/start/deploy?repository=https://github.com/riipandi/vite-react-template">
    <img src="https://www.netlify.com/img/deploy/button.svg" alt="Deploy to Netlify" height="32" />
  </a>
  <a href="https://deploy.workers.cloudflare.com/?url=https://github.com/riipandi/vite-react-template">
    <img src="https://deploy.workers.cloudflare.com/button" alt="Deploy to Cloudflare" height="32" />
  </a>
</p>

### Deploying the SPA

The build output is a static SPA (`.output/build/`). Cookie-based auth requires a **same-site API** —
browsers do not send `SameSite=Lax` cookies on cross-site requests. Pick one:

- **Netlify** — works out of the box: [`netlify/functions/api.ts`](./netlify/functions/api.ts)
  transparently proxies every `/api/*` request (all HTTP methods) to the demo backend on the
  site's own origin, so the HttpOnly session cookies stick. The deploy also publishes
  Storybook under `/storybook/` (relative asset URLs, no extra base config needed).
- **Own backend** (recommended for production) — set `PUBLIC_API_URL` to your API on the same
  parent domain (e.g. `https://api.example.com`) and implement the auth endpoints
  (`POST /auth/login`, `GET /auth/me`, `POST /auth/refresh`, `POST /auth/logout`,
  `GET /auth/session`).
- **Reverse proxy** — map `/api` to your backend server-side (nginx, Caddy, …) and keep
  `PUBLIC_API_URL=/api`.

### Cloudflare Deployment

You need to add `NODE_VERSION` with value `18.17.1` or `20.9.0` on the environment variables setting.
Visit [Cloudflare pages docs](https://developers.cloudflare.com/pages/platform/build-configuration/)
for more information.

For the preview branch:

```env
PUBLIC_SITE_URL=${CF_PAGES_URL}
```

## Development

This project uses TypeScript for type checking, [Oxlint](https://oxc.rs/docs/guide/usage/linter) for linting
and [Oxfmt](https://oxc.rs/docs/guide/usage/formatter) for code formatting which are configured in
[`.oxlintrc.json`](./.oxlintrc.json) and [`.oxfmtrc.json`](./.oxfmtrc.json). It's recommended
to get TypeScript set up for your editor and install an editor plugin (like the
[VSCode Oxc plugin](https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode)) to get
auto-formatting on saving and get a really great in-editor experience with type checking and auto-complete.

## Thanks to

In general, I'd like to thank every single one who open-sources their source code for their effort
to contribute something to the open-source community. Your work means the world! 🌍 ❤️

### Attribution

- [MadeUI](https://madeui.com/) — the Base UI + StyleX components in this template are based on its components.
- [Reshaped](https://www.reshaped.so/) — the design system in this template is built on its design system.
- [ReUI](https://reui.io) — the Data Grid, Input Phone, Sortable, and Kanban components are ports of ReUI.
- [Flavio Copes](https://flaviocopes.com/stylex) - A deep dive into StyleX.

## Notice

Why using web workers for auth? [Keep React Responsive with Web Workers and useRef](https://reactdevelopment.substack.com/p/keep-react-responsive-with-web-workers)

## License

Licensed under either of [Apache License 2.0][license-apache] or [MIT license][license-mit] at your option.

> Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you,
> as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Copyrights in this project are retained by their contributors.

See the [LICENSE-APACHE](./LICENSE-APACHE) and [LICENSE-MIT](./LICENSE-MIT) files for more information.

---

<sub>🤫 Psst! If you like my work you can support me via [GitHub sponsors](https://github.com/sponsors/riipandi).</sub>

<!-- link reference definition -->

[license-mit]: https://choosealicense.com/licenses/mit/
[license-apache]: https://choosealicense.com/licenses/apache-2.0/
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.

react-starter-kit

react-starter-kit

A full-stack SaaS monorepo starter built on Vite and React, with Bun, TypeScript, tRPC, Drizzle ORM, Better Auth, Stripe, and Cloudflare Workers. It includes email OTP, passkey, Google OAuth, organizations, subscription billing, Drizzle migrations, seed scripts, and Terraform infrastructure.

Vite · SaaS

cove

cove

Cove is a minimal TanStack Start starter template maintained by mugnavo, integrating React, TanStack Router/Query, Tailwind CSS, shadcn/ui, Drizzle ORM with PostgreSQL, Better Auth, Vite Plus, and Nitro.

Vite · SaaS

vite-react-boilerplate

vite-react-boilerplate

A production-ready Vite + React starter template with TypeScript, Tailwind CSS, TanStack Router/Query/Table, Storybook, React Hook Form + Zod, Vitest and Playwright testing, plus Husky/Commitizen/Commitlint commit conventions.

Vite · Starter

react-vite-admin

react-vite-admin

A backend management starter built on Vite and React, integrating Recoil, React Query, TypeScript, and Axios, with Ant Design-style interface screenshots. Suitable as a starting point for management-side projects, licensed under MIT, with Chinese documentation and common scripts.

Vite · Admin dashboard

typescript-react_best_practices-vite_template

typescript-react_best_practices-vite_template

A Vite + React + TypeScript starter template by CodelyTV, preconfigured with Jest and React Testing Library unit tests, Cypress end-to-end tests, ESLint and Prettier using Codely's shared configuration, GitHub Actions workflows, a Makefile, and Sass.

Vite · Starter

cloudflare-starter-kit

cloudflare-starter-kit

A Cloudflare Workers project scaffolding template maintained by kriasoft, using Vite and TypeScript, with three built-in workspaces: api, app, and edge, and preconfigured local testing, multiple environments, and a GitHub Actions deployment workflow.

Vite · Starter