A modern React TypeScript starter template built for developer productivity. Features automated code quality checks, comprehensive testing setup, and seamless AI-assisted development integration.
- React 19 + TypeScript - Latest React with full TypeScript support
- Lightning-fast Vite - Instant HMR and optimized production builds
- Zero-config testing - Vitest, Storybook, and Chromatic pre-configured
- AI-ready development - Claude Code MCP server integration
- Automated quality gates - Pre-commit hooks and CI for formatting and linting
- Node.js 22+ and npm
- Git for version control
-
Set up environment variables
cp .env.example .env
Edit
.env
and add your API keys:FIGMA_API_KEY=your_figma_api_key_here
-
Configure visual testing (optional)
For Chromatic integration:
- Replace
CHROMATIC_PROJECT_ID
inchromatic.config.json
- Set
CHROMATIC_PROJECT_TOKEN
in GitHub secrets
- Replace
-
Start developing
npm start
Command | Description |
---|---|
npm start |
Start development server with hot reload |
npm run build |
Create production build |
npm run preview |
Preview production build locally |
Command | Description |
---|---|
npm run lint |
Check code for issues |
npm run format |
Auto-format all code |
npm run check |
Run all code quality checks |
npm run check:fix |
Fix all auto-fixable issues |
Command | Description |
---|---|
npm test |
Run unit tests |
npm run test:watch |
Run tests and watch for changes |
npm run test:coverage |
Generate test coverage report |
npm run storybook:run |
Launch Storybook development |
npm run storybook:build |
Build static Storybook |
npm run chromatic |
Run visual regression tests |
frontend-vibe-code-template/
βββ src/
β βββ features/ # Feature modules (screens, workflows)
β β βββ intro/ # Example feature with component + stories
β βββ shared/ # Shared code across features
β β βββ components/ # Reusable UI components
β β βββ hooks/ # Custom React hooks
β β βββ services/ # API clients and external services
β β βββ stores/ # Global state management
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Helper functions
β βββ app.tsx # Root application component
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
βββ public/ # Static assets
βββ .storybook/ # Storybook configuration
βββ [config files] # Various configuration files
- Feature-first organization - Group by feature, not file type
- Shared module pattern - Common code in centralized location
- Path aliasing - Use
@/
prefix for clean imports - No barrel exports - Direct imports for better tree-shaking
Features live in src/features/
. Each feature should be self-contained:
// src/features/my-feature/my-feature.tsx
export function MyFeature() {
return <div>My new feature</div>;
}
// src/features/my-feature/my-feature.stories.tsx
export default {
title: 'Features/MyFeature',
component: MyFeature,
};
Import shared utilities using the @/
alias:
import { Button } from '@/shared/components/button';
import { useDebounce } from '@/shared/hooks/use-debounce';
import { apiClient } from '@/shared/services/api';
Document components with Storybook, write test using storybook interaction tests or vitest
// my-component.stories.tsx
export default {
title: 'Shared/MyComponent',
component: MyComponent,
parameters: {
docs: {
description: {
component: 'A reusable component for...'
}
}
}
};
export const Default = {
args: {
label: 'Click me'
}
};
This template includes MCP (Model Context Protocol) server configurations:
- Playwright - Browser automation and E2E testing
- Figma - Design token extraction and component sync
- Context7 - Library documentation lookup
To use with Claude Code:
source .env && claude
The .mcp.json
configuration automatically loads the required servers.
When using AI assistance:
- Reference CLAUDE.md - Contains project-specific guidelines
- Check project-structure.md - Auto-updated file structure
- Run quality checks - Always lint and format after AI-generated code
- Test thoroughly - Verify AI suggestions with unit tests
This template uses Ultracite rules via Biome for:
- β Accessibility compliance (ARIA, semantic HTML)
- β React best practices (hooks, props, components)
- β TypeScript strictness (no any, proper types)
- β Code consistency (formatting, naming)
Git hooks automatically:
- Format staged files
- Update project structure documentation
- Run linting checks
- Stage documentation changes
File | Purpose |
---|---|
biome.json |
Linting and formatting rules |
vite.config.ts |
Build and dev server settings |
vitest.config.ts |
Test runner configuration |
tsconfig.json |
TypeScript compiler options |
.rules |
Custom project guidelines |
The @/
alias maps to the src/
directory:
{
"paths": {
"@/*": ["./src/*"]
}
}
Create .env
from .env.example
:
# API Keys
FIGMA_API_KEY=your_key_here
# Feature Flags (optional)
VITE_ENABLE_ANALYTICS=false
VITE_API_URL=http://localhost:3000
Port already in use
# Kill process on port 5173
lsof -ti:5173 | xargs kill -9
Module not found errors
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
Linting errors after changes
# Auto-fix what's possible
npm run check:fix
Built with β€οΈ for productive development