A simple and fast frontend starter template with delicious defaults.
- Vite (v7) - Lightning fast build tool for modern web dev.
- React (v19) - Everybody's favorite frontend library.
- Tanstack Router - Type-safe router with incredible features.
- Tanstack Query - Powerful data fetching and caching.
- Tailwind (v4) - Everybody's favorite CSS framework.
- shadcn/ui - Beautifully designed components.
- ESLint - Modern flat config and best practices to make you better.
- pnpm - npm but better.
- Press the "Use this template" button at the top of this repository's GitHub page.
- Run
pnpm install(get pnpm: https://pnpm.io/installation). pnpm startfor development.- Use
pnpm testto run tests. pnpm buildfor production builds.pnpm bump:[patch|minor|major]for automatic version bumps with tagging.
Note: You can install pnpm via homebrew on macOS: brew install pnpm.
Auth is handled through an unopinionated hook that can be configured for any provider. The useAuthState hook in src/auth/protected-route/index.tsx currently returns mock data - replace it with your chosen auth provider:
- Clerk: Import
useAuthfrom@clerk/clerk-reactand use{ isSignedIn, isLoaded } - Auth0: Import
useUserfrom@auth0/auth0-reactand use{ user, isLoading } - Firebase: Import
useAuthStatefromreactfireor similar
To simulate authentication for testing, change the return value in useAuthState - set isAuthenticated: false to test redirects.
Use the ProtectedRoute component to guard routes. It automatically redirects unauthenticated users to /login.
This template was originally based on vite-ts-react-tailwind-template. This fork has been updated with my own personal preferences and a better eslint experience (thanks to Antfu's ESLint Config).