ViteReactStarter

vite-react-tailwind-starter — Vite Starter Template

By agustinusnathaniel

A starter template based on Vite, React, TypeScript, and Tailwind CSS, integrating TanStack Router file-based routing, TanStack Query, Zod environment variable validation, Biome, Vitest, and Git hooks.

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

File-based routing: define routes in src/routes/, and TanStack Router automatically generates the route tree

02

Tailwind CSS integration with dark/light/system theme switching

03

Environment variables are validated at build time using Zod and provide type-safe access in code

04

Built-in Biome code checking and formatting, Vitest testing, and TypeScript type checking

05

Husky and Commitlint are configured to run code quality checks at commit and push stages

06

Deployment configuration instructions for Vercel, Netlify, and Cloudflare Workers

Template Details

This is a starter template for initializing React applications, with the repository described as "template to initialize TanStack router app with TailwindCSS setup". The technology stack includes Vite, React, TypeScript, Tailwind CSS, TanStack Router, and TanStack Query, along with development tools such as Biome, Vitest, Husky, and Commitlint.

The template provides file-based routing (routes are defined under src/routes/ and the route tree is generated automatically), page components organized by route (src/lib/pages/), an application shell layout (src/lib/layout/), reusable components (src/lib/components/, including theme switching and a theme provider), global styles (src/lib/styles/globals.css), and utility functions with example tests. Environment variables are validated at build time via a Zod schema in env.ts and accessed in code through import.meta.env.

For the development workflow, the README lists commands such as pnpm dev, pnpm build, pnpm test, pnpm biome:check, and pnpm type:check, and explains that Git hooks run formatting and linting before commits, validate commit message format, and run full checks before pushes. Deployment configuration covers Vercel, Netlify, and Cloudflare Workers, with the build output directory set to dist/client.

The template does not include a backend API, authentication or authorization logic, database integration, state management libraries beyond TanStack Query, or a UI component library beyond the base layout components. Before use, note the Node.js and pnpm version requirements stated in the README.

ViteReactStarter

Is it right for your project?

Use Cases

  • Quickly setting up a React single-page application with file-based routing and Tailwind CSS
  • Wanting to use TypeScript strict mode and type-safe environment variables directly in a new project
  • Needing TanStack Query to manage server state and TanStack Router to organize pages
  • Wanting to replace ESLint/Prettier with Biome and enforce commit conventions with Git hooks
  • Needing deployable build configurations for Vercel, Netlify, or Cloudflare Workers

Suitable For

  • Frontend developers familiar with React, TypeScript, and Vite
  • Projects that need file-based routing and a Tailwind CSS starter configuration
  • Teams that want to unify code checking, formatting, and testing workflows
  • Static frontend projects preparing to deploy to Vercel, Netlify, or Cloudflare Workers

Getting started & customization

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

  1. 1

    The README states that Node.js ^24.11.x and pnpm 10.24.0 are required

  2. 2

    You can obtain the code via GitHub's Use this template or npx degit, then run pnpm install

  3. 3

    The development server runs at http://localhost:3000 by default, and the production build outputs to dist/client

  4. 4

    Environment variables must be defined with the VITE_ prefix, and the Zod schema must be added in env.ts

  5. 5

    To add a route, create a file under src/routes/ and export the Route generated by createFileRoute

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

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

Must comply with when using

  • You are allowed to use, modify, commercialize, and distribute the code of this version for free.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • 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

  • Using this template requires Node.js version ^24.11.x; Node.js environments below or above this range may not run properly.
  • The project specifies pnpm 10.24.0 as the package manager; using other package managers such as npm or yarn may not guarantee consistent dependency installation and script execution.
  • During deployment, the build command must be pnpm build, and the output directory is dist/client; incorrect configuration will cause deployment failure.
  • Environment variables must be defined in env.ts with a Zod schema and validated at build time; variables not declared this way cannot have type-safe access.
  • Custom environment variables must be named with the VITE_ prefix and written into the .env file; otherwise they cannot be accessed via import.meta.env.
  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses; they cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

**Node.js**: ^24.11.x (specified in `engines`)

Original README

**pnpm**: 10.24.0 (specified in `packageManager`)

Original README

- **Build command**: `pnpm build` - **Output directory**: `dist/client`

Original README

Environment variables are validated at build time using Zod. Define your schema in `env.ts`:

Original README

2. Create `.env` file with your variables (prefixed with `VITE_`)

Original README
https://github.com/agustinusnathaniel/vite-react-tailwind-starter/blob/main/LICENSEhttps://github.com/agustinusnathaniel/vite-react-tailwind-starter/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-02. 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-28
Screenshot last checked
2026-10-02

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.

Automatically checked against source and license rules; no manual editorial review.

Inspect the recorded source material

SHA-256: bb149437e395e1de667c57670ff165b8a731bc9b0c9c64b61e933b33b4ce93d3

2026-10-02T18:14:02.883Z

Source file / repository
# Vite React Tailwind Starter

<img src="https://og.sznm.dev/api/generate?heading=vite-react-tailwind-starter&text=React+vite+template+with+TailwindCSS+and+TypeScript+setup.&template=color&center=true&height=330" />

A production-ready starter template for React applications built with Vite, TypeScript, and Tailwind CSS v4. This template provides a modern development experience with file-based routing, type-safe environment variables, and comprehensive tooling for code quality and testing.

[**Live Demo**](https://vite-react-tailwind-starter.sznm.dev/)

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https://github.com/agustinusnathaniel/vite-react-tailwind-starter) [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/agustinusnathaniel/vite-react-tailwind-starter)

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/agustinusnathaniel/vite-react-tailwind-starter)

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=sozonome_vite-react-tailwind-starter&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=sozonome_vite-react-tailwind-starter) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=sozonome_vite-react-tailwind-starter&metric=bugs)](https://sonarcloud.io/summary/new_code?id=sozonome_vite-react-tailwind-starter) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=sozonome_vite-react-tailwind-starter&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=sozonome_vite-react-tailwind-starter) [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=sozonome_vite-react-tailwind-starter&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=sozonome_vite-react-tailwind-starter) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=sozonome_vite-react-tailwind-starter&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=sozonome_vite-react-tailwind-starter) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=sozonome_vite-react-tailwind-starter&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=sozonome_vite-react-tailwind-starter) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=sozonome_vite-react-tailwind-starter&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=sozonome_vite-react-tailwind-starter) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=sozonome_vite-react-tailwind-starter&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=sozonome_vite-react-tailwind-starter) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=sozonome_vite-react-tailwind-starter&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=sozonome_vite-react-tailwind-starter)

## Overview

This template solves the problem of bootstrapping a modern React application with:
- **Fast development**: Vite-based HMR and build pipeline
- **Type safety**: Full TypeScript coverage with strict mode
- **Routing**: File-based routing via TanStack Router
- **Styling**: Tailwind CSS v4 with dark mode support
- **State management**: TanStack Query for server state
- **Code quality**: Biome for linting/formatting, TypeScript checking, and testing
- **Developer experience**: DevTools integration, environment validation, and PWA support

### What This Template Provides

- Production-ready build configuration
- Type-safe environment variable validation
- File-based routing with code splitting
- Theme system with dark/light/system modes
- Testing setup with Vitest
- Git hooks for code quality enforcement
- Deployment configurations for Vercel, Netlify, and Cloudflare Workers

### What This Template Does Not Provide

- Backend API implementation
- Authentication/authorization logic
- Database integration
- State management library (beyond TanStack Query)
- UI component library (beyond basic layout components)

## Architecture

```mermaid
graph TB
    subgraph "Build Time"
        A[Vite Config] --> B[TypeScript Compiler]
        A --> C[Tailwind CSS v4]
        A --> D[TanStack Router Plugin]
        A --> E[React Compiler]
        D --> F[Route Tree Generation]
    end
    
    subgraph "Runtime"
        G[main.tsx] --> H[QueryClientProvider]
        H --> I[RouterProvider]
        I --> J[__root.tsx]
        J --> K[Layout Component]
        K --> L[ThemeProvider]
        K --> M[Header/Footer]
        J --> N[Route Components]
        N --> O[Page Components]
    end
    
    subgraph "Development"
        P[Vite Dev Server] --> Q[HMR]
        R[Biome] --> S[Linting/Formatting]
        T[Vitest] --> U[Test Runner]
        V[Husky Hooks] --> W[Pre-commit Checks]
    end
    
    F --> I
    B --> G
    C --> G
```

### Core Modules

| Module | Location | Responsibility |
|--------|----------|----------------|
| **Routing** | `src/routes/` | File-based route definitions, auto-generated route tree |
| **Pages** | `src/lib/pages/` | Page-level components organized by route |
| **Layout** | `src/lib/layout/` | Application shell (Header, Footer, Layout wrapper) |
| **Components** | `src/lib/components/` | Reusable UI components (ThemeProvider, ThemeToggle) |
| **Services** | `src/lib/services/` | Shared services and constants (QueryClient) |
| **Utils** | `src/lib/utils/` | Pure utility functions |
| **Styles** | `src/lib/styles/` | Global CSS and Tailwind configuration |

## Tech Stack

### Core Dependencies

- **React 19.2.0**: UI library
- **Vite 7.1.20** (rolldown-vite): Build tool and dev server
- **TypeScript 5.9.3**: Type system
- **Tailwind CSS 4.1.17**: Utility-first CSS framework
- **TanStack Router 1.135.2**: Type-safe file-based routing
- **TanStack Query 5.90.7**: Server state management
- **Zod 4.1.12**: Runtime type validation

### Development Tools

- **Biome 2.3.4**: Linter and formatter (replaces ESLint/Prettier)
- **Vitest 4.0.8**: Test runner
- **Husky 9.1.7**: Git hooks
- **Commitlint**: Conventional commit validation
- **Turbo**: Task runner for parallel execution

### Build Plugins

- `@vitejs/plugin-react`: React support with Fast Refresh
- `@tanstack/router-plugin`: File-based route generation
- `@tailwindcss/vite`: Tailwind CSS v4 integration
- `vite-plugin-pwa`: PWA manifest and service worker
- `@julr/vite-plugin-validate-env`: Environment variable validation
- `vite-plugin-checker`: TypeScript checking in dev mode

## Repository Structure

```
vite-react-tailwind-starter/
├── src/
│   ├── lib/
│   │   ├── components/          # Reusable UI components
│   │   │   ├── theme-provider.tsx
│   │   │   └── theme-toggle.tsx
│   │   ├── layout/              # Layout components
│   │   │   ├── components/
│   │   │   │   ├── header.tsx
│   │   │   │   └── footer.tsx
│   │   │   └── index.tsx
│   │   ├── pages/               # Page components
│   │   │   ├── 404/
│   │   │   └── home/
│   │   ├── services/             # Shared services
│   │   │   └── constants.ts
│   │   ├── styles/               # Global styles
│   │   │   └── globals.css
│   │   └── utils/                # Utility functions
│   │       ├── sample.ts
│   │       └── sample.test.ts
│   ├── routes/                   # TanStack Router routes
│   │   ├── __root.tsx           # Root route with layout
│   │   └── index.tsx            # Home route
│   ├── main.tsx                  # Application entry point
│   ├── routeTree.gen.ts         # Auto-generated route tree
│   └── env.d.ts                  # Environment type definitions
├── public/                       # Static assets
├── dist/                         # Build output
├── vite.config.ts                # Vite configuration
├── tsconfig.json                 # TypeScript configuration
├── biome.json                    # Biome linter/formatter config
├── vitest.config.ts              # Vitest test configuration
├── env.ts                        # Environment variable schema
└── package.json
```

## Getting Started

### Prerequisites

- **Node.js**: ^24.11.x (specified in `engines`)
- **pnpm**: 10.24.0 (specified in `packageManager`)

### Installation

You can either click [`Use this template`](https://github.com/agustinusnathaniel/vite-react-tailwind-starter/generate) button on this repository and clone the repo or use npx degit:

```bash
npx degit agustinusnathaniel/vite-react-tailwind-starter <app_name>
cd <app_name>
pnpm install
```

### Development

Start the development server:

```bash
pnpm dev
```

The application will be available at `http://localhost:3000` with HMR enabled.

### Building

Build for production:

```bash
pnpm build
```

Output will be in the `dist/client/` directory.

### Testing

Run tests:

```bash
pnpm test              # Run tests once
pnpm test:ui           # Run tests with UI and coverage
pnpm test:coverage     # Run tests with coverage report
```

### Code Quality

```bash
pnpm biome:check       # Check code style and linting
pnpm biome:fix         # Auto-fix code style issues
pnpm type:check        # TypeScript type checking
pnpm check:turbo       # Run all checks in parallel (biome, type, test)
```

## Configuration

### Environment Variables

Environment variables are validated at build time using Zod. Define your schema in `env.ts`:

```typescript
// env.ts
export default defineConfig({
  schema: {
    VITE_API_BASE_URL: z.string().optional(),
  },
});
```

Access variables in code with type safety:

```typescript
import.meta.env.VITE_API_BASE_URL
```

### TypeScript Paths

Path aliases are configured in `tsconfig.json`:

```json
{
  "paths": {
    "@/*": ["./src/*"]
  }
}
```

Use in imports:

```typescript
import { Layout } from '@/lib/layout';
```

### Tailwind CSS

Tailwind CSS v4 is configured via the `@tailwindcss/vite` plugin. Global styles and customizations are in `src/lib/styles/globals.css`.

### Routing

Routes are defined as files in `src/routes/`. TanStack Router automatically generates the route tree. See [TanStack Router documentation](https://tanstack.com/router) for advanced patterns.

## Deployment

### Build Configuration

- **Build command**: `pnpm build`
- **Output directory**: `dist/client`
- **Node version**: ^24.11.x

### Platform-Specific Guides

- **Vercel**: https://vercel.com/docs/frameworks/vite
- **Netlify**: https://docs.netlify.com/frameworks/vite/
- **Cloudflare Workers**: Configuration in `wrangler.toml`

## Development Workflows

### Adding a New Route

1. Create a file in `src/routes/` (e.g., `src/routes/about.tsx`)
2. Export a `Route` using `createFileRoute`
3. The route tree will auto-regenerate

### Adding a New Page Component

1. Create directory in `src/lib/pages/` (e.g., `src/lib/pages/about/`)
2. Create `index.tsx` with your page component
3. Import and use in the corresponding route file

### Adding Environment Variables

1. Add schema definition in `env.ts`
2. Create `.env` file with your variables (prefixed with `VITE_`)
3. Access via `import.meta.env.VITE_*` with full type safety

### Git Workflow

- **Pre-commit**: Runs Biome formatting/linting on staged files
- **Commit-msg**: Validates commit message format (Conventional Commits)
- **Pre-push**: Runs full check suite (biome, type-check, tests)

## References

- [Vite](https://vitejs.dev)
  - [Avoid manual import](https://vitejs.dev/guide/features.html#jsx)
- [TailwindCSS](https://tailwindcss.com/)
- [TypeScript](https://www.typescriptlang.org)
- [TanStack Router](https://tanstack.com/router)
- [TanStack Query](https://tanstack.com/query)

## License

See [LICENSE](./LICENSE) file.
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