Where the best agents are forged.
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Open http://localhost:3000- Framework: TanStack Start - Full-stack React framework
- Router: TanStack Router - Type-safe routing
- Styling: Tailwind CSS v4 - Utility-first CSS
- Testing: Vitest + React Testing Library
- Type Safety: TypeScript
- Code Quality: ESLint + Prettier
- Git Hooks: Husky + lint-staged
pnpm dev # Start development server (port 3000)
pnpm build # Build for production
pnpm start # Start production server
pnpm serve # Preview production buildpnpm typecheck # Run TypeScript type checking
pnpm lint # Run ESLint with auto-fix
pnpm lint:check # Run ESLint without fixing
pnpm format # Format code with Prettier
pnpm format:check # Check Prettier formattingpnpm test # Run tests once
pnpm test:watch # Run tests in watch mode
pnpm test:ui # Open Vitest UI
pnpm test:coverage # Run tests with coverage reportsrc/
βββ features/ # Feature-based organization
β βββ shared/ # Shared components, hooks, utils
β β βββ components/ # Reusable UI components
β βββ feature-name/ # Feature-specific code
β βββ components/ # Feature components
β βββ hooks/ # Feature hooks
β βββ types/ # Feature types
β βββ utils/ # Feature utilities
βββ routes/ # TanStack Router file-based routes
βββ test/ # Test setup and utilities
βββ styles.css # Global styles
- Components: Use
export default function ComponentName() {} - Imports: Always use
@/absolute imports, never relative../ - Types: Prefer
unknownoverany - Formatting: Single quotes, no semicolons, trailing commas
// 1. External libraries
import { useState } from 'react'
import { Link } from '@tanstack/react-router'
// 2. Internal modules with @/ prefix
import Header from '@/features/shared/components/Header'
import { useAuth } from '@/features/auth/hooks/useAuth'- Components:
PascalCase.tsx(e.g.,Header.tsx) - Hooks:
camelCase.tsstarting withuse(e.g.,useAuth.ts) - Utils:
camelCase.ts(e.g.,formatDate.ts) - Types:
camelCase.types.ts(e.g.,user.types.ts) - Tests:
ComponentName.test.tsxor in__tests__/folders
import { render, screen } from '@testing-library/react'
import { describe, it, expect } from 'vitest'
import Header from '@/features/shared/components/Header'
describe('Header', () => {
it('renders navigation links', () => {
render(<Header />)
expect(screen.getByText('Home')).toBeInTheDocument()
})
})- Unit tests for utilities and hooks
- Integration tests for components
- Place tests in
__tests__/folders or use.test.tsxsuffix - Mock external dependencies appropriately
Every commit automatically runs:
- Type checking - Ensures TypeScript compilation
- Tests - Runs full test suite
- Linting - ESLint with auto-fix
- Formatting - Prettier code formatting
- React Hooks dependency checking
- Import order enforcement
- TypeScript strict rules
- Unused variable detection
- Floating promise detection
pnpm build # Creates optimized production build
pnpm start # Serves production build- Node.js: >=22.12.0
- Package Manager: pnpm >=8.0.0
TypeScript Errors
pnpm typecheck # Check for type errorsLinting Issues
pnpm lint # Auto-fix most issues
pnpm lint:check # See all issuesTest Failures
pnpm test:watch # Debug in watch mode
pnpm test:ui # Use visual test runnerImport Errors
- Always use
@/for absolute imports - Check
tsconfig.jsonpaths configuration - Restart TypeScript server in VS Code