Wundr-compliant project templates with opinionated best practices
Wundr-compliant project templates with opinionated best practices for scaffolding new projects.
The @wundr/project-templates package provides production-ready project templates that come pre-configured with Wundr's best practices, including TypeScript, testing, linting, CI/CD, and governance baselines. Every project created is ready for immediate development with all quality tools configured.
- Production-Ready Templates - Frontend, Backend, Monorepo, Full-stack
- Complete Tool Setup - TypeScript, ESLint, Prettier, Jest/Vitest
- CI/CD Included - GitHub Actions workflows pre-configured
- Wundr Governance - Quality baselines and drift detection
- AI-Ready - CLAUDE.md configuration for AI assistance
- Git Hooks - Husky + lint-staged for code quality
- Docker Support - Optional containerization
As part of the Wundr CLI:
``bash`
npm install -g @wundr/cli
Or standalone:
`bash`
npm install -g @wundr/project-templates
bash
wundr create frontend my-app
`$3
`bash
wundr create backend my-api
`$3
`bash
wundr create monorepo my-platform
`$3
`bash
wundr create fullstack my-project
`š Available Templates
$3
Modern React application with Next.js 15 and best practices.Stack:
- Next.js 15 with App Router
- TypeScript 5.2+ (strict mode)
- Tailwind CSS 3.4
- shadcn/ui components
- Radix UI primitives
- React Query for data fetching
- Zustand for state management
- React Hook Form + Zod validation
Features:
- Server-side rendering (SSR)
- Static site generation (SSG)
- API routes
- Optimized images and fonts
- PWA ready
- SEO optimized
- Accessibility (WCAG 2.1 AA)
Structure:
`
my-app/
āāā app/ # Next.js app directory
ā āāā (auth)/ # Auth group routes
ā āāā api/ # API routes
ā āāā layout.tsx # Root layout
ā āāā page.tsx # Home page
āāā components/ # React components
ā āāā ui/ # shadcn/ui components
ā āāā features/ # Feature components
āāā lib/ # Utilities
āāā hooks/ # Custom React hooks
āāā styles/ # Global styles
āāā public/ # Static assets
āāā tests/ # Test files
`$3
High-performance Node.js API with Fastify and enterprise features.Stack:
- Fastify 4+ (high performance)
- TypeScript 5.2+ (strict mode)
- Prisma ORM
- OpenAPI/Swagger documentation
- Winston logging
- Bull for job queues
- Redis for caching
- JWT authentication
Features:
- RESTful API design
- GraphQL support (optional)
- Database migrations
- Request validation
- Error handling
- Rate limiting
- Health checks
- Metrics endpoint
Structure:
`
my-api/
āāā src/
ā āāā controllers/ # Route handlers
ā āāā services/ # Business logic
ā āāā models/ # Data models
ā āāā middleware/ # Custom middleware
ā āāā plugins/ # Fastify plugins
ā āāā utils/ # Utilities
ā āāā index.ts # Entry point
āāā prisma/
ā āāā schema.prisma # Database schema
ā āāā migrations/ # Database migrations
āāā tests/ # Test files
āāā docs/ # API documentation
`$3
Scalable monorepo setup with Turborepo and multiple packages.Stack:
- Turborepo for build orchestration
- pnpm workspaces
- Shared TypeScript configs
- Unified ESLint/Prettier
- Changeset for versioning
- Shared component library
- Multiple applications
Features:
- Optimized builds with caching
- Parallel task execution
- Shared dependencies
- Cross-package imports
- Unified CI/CD
- Package publishing ready
Structure:
`
my-platform/
āāā apps/
ā āāā web/ # Frontend application
ā āāā api/ # Backend API
ā āāā admin/ # Admin dashboard
āāā packages/
ā āāā ui/ # Shared UI components
ā āāā config/ # Shared configurations
ā āāā database/ # Database client
ā āāā utils/ # Shared utilities
āāā turbo.json # Turborepo config
āāā pnpm-workspace.yaml # Workspace config
`$3
Complete application with frontend, backend, and shared packages.Includes:
- Next.js frontend
- Fastify backend
- Shared types package
- Database package
- UI component library
- Unified authentication
- End-to-end type safety
š§ Configuration Files
Every template includes:
$3
`
.wundr/
āāā baseline.json # Quality baseline metrics
āāā config.yaml # Project configuration
āāā patterns.yaml # Approved code patterns
āāā drift-check.yaml # Drift detection rules
`$3
`
.husky/ # Git hooks
.github/workflows/ # CI/CD pipelines
.vscode/ # VS Code settings
.eslintrc.json # ESLint configuration
.prettierrc # Prettier configuration
jest.config.js # Jest configuration
tsconfig.json # TypeScript configuration
CLAUDE.md # AI assistant instructions
`š» CLI Options
$3
`bash
Skip git initialization
wundr create frontend my-app --no-gitSkip dependency installation
wundr create backend my-api --no-installInclude Docker configuration
wundr create monorepo my-platform --dockerSpecify package manager
wundr create frontend my-app --package-manager pnpmCustom path
wundr create backend my-api --path ./projectsWith description
wundr create fullstack my-project --description "My awesome project"
`$3
`bash
Interactive project creation
wundr create projectWill prompt for:
- Project type (frontend/backend/monorepo/fullstack)
- Project name
- Description
- Author
- Package manager
- Additional features
`š Included Scripts
All templates include these npm scripts:
`json
{
"scripts": {
"dev": "Start development server",
"build": "Build for production",
"start": "Start production server",
"test": "Run tests",
"test:watch": "Run tests in watch mode",
"test:coverage": "Generate coverage report",
"lint": "Lint code",
"lint:fix": "Fix linting issues",
"format": "Format code with Prettier",
"typecheck": "Type check with TypeScript",
"prepare": "Setup Husky hooks",
"analyze": "Analyze with Wundr",
"govern:check": "Check governance compliance"
}
}
`š Post-Creation Steps
After creating a project:
`bash
Navigate to project
cd my-appInstall dependencies (if not auto-installed)
pnpm installStart development
pnpm devRun initial analysis
pnpm analyzeCreate governance baseline
pnpm govern:baseline
`šÆ Best Practices Included
$3
- TypeScript strict mode enabled
- ESLint with recommended rules
- Prettier for consistent formatting
- Import sorting configured
- No console.log in production$3
- Jest/Vitest configured
- Testing utilities included
- Coverage thresholds set
- E2E test setup (Playwright)$3
- Conventional commits enforced
- Pre-commit hooks for linting
- Pre-push hooks for testing
- Protected branch rules$3
- GitHub Actions workflows
- Automated testing
- Build verification
- Dependency caching
- Release automation$3
- README template
- API documentation
- Component documentation
- Contribution guidelinesš API Usage
`typescript
import { projectTemplates } from '@wundr/project-templates';// Create a project programmatically
await projectTemplates.createProject({
name: 'my-app',
type: 'frontend',
framework: 'next',
path: './projects',
install: true,
git: true
});
// Get template information
const templates = projectTemplates.listTemplates();
// Validate project name
const isValid = projectTemplates.validateProjectName('my-app');
`š§ Template Customization
Templates use Handlebars for variable substitution:
`typescript
// Template variables available
interface TemplateVariables {
projectName: string;
projectDescription: string;
author: string;
email: string;
year: number;
license: string;
packageManager: 'npm' | 'pnpm' | 'yarn';
}
`š¤ Contributing
We welcome new templates! To contribute:
1. Create a new template in
src/templates/`MIT - See LICENSE for details.