English | δΈζ
TanVite is a production-grade React 19 starter system designed as a reusable frontend engineering foundation for serious product teams. It combines a publishable create-tanvite scaffolder, Vite, TypeScript, OpenSpec, .agents/skills for Codex, .claude/skills plus OPSX commands for Claude Code, TanStack Router, TanStack Query, OpenAPI tooling, Tailwind CSS, automated testing, code-quality enforcement, and GitHub Pages-ready delivery into a polished, high-standard stack for launching new products with spec-driven workflow, AI-assisted implementation, and modern frontend best practices already in place.
- Start from a modern React 19 starter without assembling tooling by hand
- Work with OpenSpec from day one so change proposals and baseline specs stay inside the repository
- Use
.agents/skillsfor Codex and.claude/skillsplus OPSX commands for Claude Code to cover design, code review, testing, git workflows, and browser automation - Keep routing, data fetching, styling, testing, and CI aligned from the first commit
- Build product work on top of a frontend baseline that already standardizes routing, data, styling, testing, and CI
- Combine OpenSpec-driven planning with OpenAPI-driven API generation in one repository
- Reuse a polished landing page and guide page for public project presentation
- Start new product work through
npm create tanvite@latest/pnpm create tanvite@latest/yarn create tanvite@latestinstead of copying the full maintenance repository
Use the published scaffolder when you want a new TanVite-based product project.
Pick the package manager you use:
# npm
npm create tanvite@latest my-app
# pnpm
pnpm create tanvite@latest my-app
# yarn
yarn create tanvite@latest my-appThen install and start the dev server:
cd my-app
pnpm install
pnpm devOpen http://localhost:4319.
Optional examples (flags go after -- for npm, directly for pnpm / yarn):
# npm
npm create tanvite@latest my-app -- --preset full
npm create tanvite@latest my-app -- --with openspec,openapi,playwright,pages,agents
npm create tanvite@latest my-app -- --hooks --hooks-agents claude,codex
# pnpm
pnpm create tanvite@latest my-app --preset full
pnpm create tanvite@latest my-app --with openspec,openapi,playwright,pages,agents
pnpm create tanvite@latest my-app --hooks --hooks-agents claude,codex
# yarn
yarn create tanvite@latest my-app --preset full
yarn create tanvite@latest my-app --with openspec,openapi,playwright,pages,agents
yarn create tanvite@latest my-app --hooks --hooks-agents claude,codex- Replace the landing copy and branding.
- Add or remove TanStack route entries under
src/app/routes. - Compose route-facing pages in
src/pages, then move reusable screen blocks intosrc/widgetsand shared runtime logic intosrc/shared. - Keep the existing testing and CI setup as the project baseline.
The source repository is for maintaining TanVite itself: the create-tanvite scaffolder, the starter template, and the public showcase. Product teams starting a new app should use npm create tanvite@latest (or pnpm create tanvite@latest / yarn create tanvite@latest).
Release from packages/create-tanvite and verify tarball contents before publish.
cd packages/create-tanvite
npm version patch --no-git-tag-version
TARBALL=$(pnpm pack | tail -n 1)
tar -tzf "$TARBALL" | grep -E "template/base/(gitignore|\\.gitignore|src/routeTree\\.gen\\.ts)"
pnpm publish --access public --no-git-checks --registry=https://registry.npmjs.orgThen verify npm dist-tags:
npm view create-tanvite version dist-tags --json --registry=https://registry.npmjs.orgcreate-tanvitescaffolder for curated starter generation- React 19 + TypeScript + Vite 8 starter baseline
- OpenSpec workspace initialized in
spec-drivenmode .agents/skillsfor Codex and.claude/skillsplus OPSX commands for Claude Code, covering frontend design, review, testing, git workflows, and browser automation- TanStack Router file-based routing
- TanStack Query data layer
- OpenAPI-driven client, hook, and mock generation via Orval
- Tailwind CSS and shadcn/ui-ready utilities
- Biome for linting and formatting
- Vitest + Testing Library for unit tests
- Playwright for end-to-end tests
- MSW and Prism for browser-level mocks and standalone mock server workflows
- Husky + lint-staged + commitlint for commit workflow enforcement
- Steiger-powered FSD structure and import-boundary checks
- AI agent hooks for Claude Code and Codex β pnpm enforcement, file protection, auto-format, context injection, FSD checks, and desktop notifications
| Category | Technology |
|---|---|
| Framework | React 19 |
| Language | TypeScript |
| Build Tool | Vite |
| Package Manager | pnpm |
| Specification Workflow | OpenSpec |
| AI Collaboration | .agents/skills, .claude/skills, Codex, Claude Code, OPSX commands, agent hooks |
| Routing | TanStack Router |
| Data Fetching | TanStack Query |
| API Contract | Orval, OpenAPI |
| Mocking | MSW, Prism |
| Styling | Tailwind CSS |
| UI Utilities | shadcn/ui, class-variance-authority, tailwind-merge |
| Code Quality | Biome |
| Unit Testing | Vitest, Testing Library, jsdom |
| E2E Testing | Playwright |
| Git Hooks | Husky, lint-staged |
- Node.js 20+
- pnpm 10+
pnpm routes:generate # Generate the TanStack Router route tree
pnpm openapi:check # Validate the remote OpenAPI document
pnpm openapi:generate # Generate API clients, React Query hooks, and MSW mocks
pnpm openapi:mock # Start a standalone Prism mock server
pnpm dev # Start the Vite dev server
pnpm dev:mock # Start Vite with the MSW browser mock enabled
pnpm dev:showcase # Start the isolated showcase app locally
pnpm build # Build the app into dist/
pnpm build:pages # Build the showcase site into dist-pages/
pnpm preview # Preview dist/ on http://localhost:4419
pnpm preview:pages # Preview dist-pages/ on http://localhost:4419
pnpm test # Run Vitest in watch mode
pnpm test:run # Run unit tests once
pnpm test:coverage # Generate a coverage report
pnpm test:e2e # Run Playwright tests
pnpm test:e2e:ui # Run Playwright in UI mode
pnpm check # Run Biome checks with fixes
pnpm lint # Run Biome lint
pnpm format # Run Biome format- Build the Pages artifact.
- Start the Pages preview server.
- Open the project-site path.
pnpm build:pages
pnpm preview:pagesOpen http://localhost:4419/tanvite/.
- Copy
.env.exampleto.env.local. - Set
OPENAPI_SCHEMA_URLto your backend Swagger/OpenAPI endpoint. - Validate the contract and generate the API layer.
- Start development against either MSW or a standalone Prism mock server.
cp .env.example .env.local
pnpm openapi:check
pnpm openapi:generate
pnpm dev:mockUse pnpm openapi:mock when you want a separate mock server on http://127.0.0.1:4010.
This repository has already been initialized with OpenSpec and uses the spec-driven schema.
- Keep active change proposals under
openspec/changes/ - Keep baseline specifications under
openspec/specs/ - Keep repository-level OpenSpec settings in
openspec/config.yaml
Common commands:
pnpm openspec:list
pnpm openspec:new <name>
pnpm openspec:validate
pnpm openspec:spec:listThe current workspace ships with Codex skills under .agents/skills/, Claude Code skills under .claude/skills/, and OpenSpec command assets under .claude/commands/opsx/.
openspec-*skills andopsx/*commands for OpenSpec change exploration, proposal, application, and archivingfrontend-design,ui-ux-pro-max, andweb-design-guidelinesfor product-facing UI workfrontend-code-reviewandcode-review-expertfor review passes on pending changesreact-expertandtypescript-expertfor framework and language-specific guidanceagent-browserandwebapp-testingfor browser automation and local app verificationgit-commitandgit-pushingfor conventional commit and delivery workflows
When the hooks feature is enabled via create-tanvite, the generated project ships with deterministic runtime hooks for Claude Code and/or Codex. These hooks enforce project rules automatically rather than relying on the AI to remember them.
| Hook | Event | What it does |
|---|---|---|
| pnpm enforcement | PreToolUse (Bash) |
Blocks npm, yarn, bun install commands |
| File protection | PreToolUse (Edit|Write) |
Blocks edits to src/routeTree.gen.ts, src/shared/api/generated/, .env, package-lock.json |
| Auto-format | PostToolUse (Edit|Write) |
Runs biome check --write after every file edit |
| Context injection | SessionStart |
Injects project rules on session start and after context compaction |
| FSD check | Stop |
Runs Steiger through pnpm check:boundaries before the agent stops |
| Desktop notification | Notification |
Sends a macOS notification when the agent needs input |
| Hook | Event | What it does |
|---|---|---|
| pnpm enforcement | PreToolUse (Bash) |
Blocks npm, yarn, bun install commands |
| Context injection | SessionStart |
Injects project rules on session start |
| FSD check | Stop |
Runs Steiger through pnpm check:boundaries before the agent stops |
Select agents during scaffolding with --hooks --hooks-agents claude, --hooks --hooks-agents codex, or --hooks --hooks-agents claude,codex. The full preset enables hooks for both agents by default.
src/
βββ routeTree.gen.ts
βββ app/
β βββ main.tsx
β βββ providers/
β βββ routes/
β β βββ __root.tsx
β β βββ index.tsx
β βββ router.tsx
β βββ styles/
βββ entities/
βββ features/
βββ pages/
β βββ home/
βββ shared/
β βββ api/
β βββ i18n/
β βββ lib/
β βββ model/
β βββ ui/
βββ widgets/
β βββ starter-home/
βββ vite-env.d.ts
openspec/
βββ changes/
βββ specs/
βββ config.yaml
.agents/
βββ skills/
βββ agent-browser/
βββ frontend-design/
βββ openspec-propose/
βββ react-expert/
βββ typescript-expert/
βββ webapp-testing/
.claude/
βββ commands/
βββ opsx/
showcase/
βββ index.html
βββ src/
βββ app.tsx
βββ components/
βββ lib/
βββ main.tsx
βββ styles.css
packages/
βββ create-tanvite/
βββ bin/
βββ src/
βββ template/
tests/
βββ e2e/
β βββ home.spec.ts
βββ lib/
β βββ utils.test.ts
βββ setup.ts
Generate the route tree with:
pnpm routes:generatepnpm build and pnpm build:pages run route generation automatically before bundling.
Use the official GitHub Actions Pages deployment flow.
- App build output:
dist/ - Pages build output:
dist-pages/ - Public URL:
https://yangsonhung.github.io/tanvite - Deployment workflow: .github/workflows/deploy-pages.yml
For GitHub Pages:
- Build with
pnpm build:pages - Use
/tanvite/as the production base path - Publish the GitHub Actions artifact instead of committing
docs/ - Keep
404.htmland.nojekyllin the Pages output for SPA hosting
For regular production deployment, use pnpm build.
- Enable React Query Devtools and TanStack Router Devtools only in development
- Track requirement and behavior changes in
openspec/changesbefore implementation work grows - Keep
.agents/skills,.claude/skills, and.claude/commands/opsxversioned with the project so Codex and Claude Code stay aligned on the same workflows - Point
OPENAPI_SCHEMA_URLat your backend spec before runningpnpm openapi:generate - Keep FSD layers as
app/pages/widgets/features/entities/shared;processesis intentionally omitted because it is deprecated - Run
pnpm check:boundariesto validate the FSD structure with Steiger - Generated API artifacts live under
src/shared/api/generated - Keep shared query defaults in
src/shared/api/query-client.ts - Use
src/shared/lib/utils.tsfor thecn()helper
Read CONTRIBUTING.md before opening a pull request.
Track project history in CHANGELOG.md.
MIT
