A comprehensive template for .NET 10 web applications using GitHub's spec-kit framework with best practices, coding standards, and architectural guidelines.
This repository serves as a foundational template for building modern .NET web applications. It includes comprehensive specifications, best practices, and guidelines following:
- .NET 10 best practices
- Clean Architecture principles
- Domain-Driven Design (DDD)
- Security-first approach
- Performance optimization strategies
- Comprehensive testing standards
- .NET 10 - Latest LTS version
- ASP.NET Core - Web framework
- Entity Framework Core - ORM
- MediatR - CQRS pattern
- FluentValidation - Input validation
- React or Vue.js - UI framework (your choice)
- FluentUI (Microsoft) - Component library
- TypeScript - Type-safe JavaScript
- PostgreSQL or SQL Server - Primary database
- Redis - Caching and session storage
- Docker - Containerization
- GitHub Actions - CI/CD
- Azure or AWS - Cloud hosting
.github/
βββ specs/ # Spec-kit specifications
βββ constitution.md # Core principles and guidelines
βββ best-practices.md # .NET 10 coding standards
βββ rules.md # Development rules and conventions
βββ naming-conventions.md # Standardized naming conventions
βββ specifications/
βββ architecture.md # Application architecture guidelines
βββ security.md # Security best practices
βββ performance.md # Performance optimization
βββ testing.md # Testing standards
βββ ui-guidelines.md # React/Vue + FluentUI guidelines
- .NET 10 SDK
- Node.js 20+ (for frontend)
- Docker (optional)
- PostgreSQL or SQL Server
-
Click "Use this template" button on GitHub
-
Clone your new repository
git clone https://github.com/yourusername/your-project-name.git cd your-project-name -
Review the specifications
- Read Constitution for core principles
- Check Architecture for structure
- Review Best Practices for coding standards
-
Create your .NET project structure
# Create solution dotnet new sln -n YourProjectName # Create projects following clean architecture dotnet new classlib -n YourProjectName.Domain dotnet new classlib -n YourProjectName.Application dotnet new classlib -n YourProjectName.Infrastructure dotnet new webapi -n YourProjectName.Api # Add projects to solution dotnet sln add **/*.csproj
-
Set up frontend (React or Vue.js)
# React with TypeScript npx create-react-app client --template typescript cd client npm install @fluentui/react @fluentui/react-icons # OR Vue.js with TypeScript npm create vue@latest cd client npm install @fluentui/web-components
- Constitution - Foundational principles and technology choices
- Best Practices - .NET 10 coding standards and patterns
- Rules - Development rules, Git workflow, and quality gates
- Naming Conventions - Comprehensive naming standards
- Architecture - Clean architecture, CQRS, DDD patterns
- Security - Authentication, authorization, data protection
- Performance - Optimization strategies and caching
- Testing - Unit, integration, and E2E testing standards
- UI Guidelines - React/Vue.js with FluentUI implementation
This template follows Clean Architecture with Domain-Driven Design:
src/
βββ Domain/ # Business entities, value objects, domain events
βββ Application/ # Use cases, DTOs, CQRS handlers
βββ Infrastructure/ # Data access, external services
βββ API/ # Controllers, middleware, API endpoints
tests/
βββ UnitTests/ # Unit tests (70% of tests)
βββ IntegrationTests/ # Integration tests (20% of tests)
βββ E2ETests/ # End-to-end tests (10% of tests)
Security is built-in from the start:
- β JWT authentication with refresh tokens
- β Role-based and policy-based authorization
- β Input validation and sanitization
- β SQL injection prevention
- β XSS protection
- β HTTPS enforcement
- β Security headers
- β Rate limiting
- β Secrets management
See Security Specifications for details.
All code must pass these gates before merging:
- β All unit tests pass
- β Code coverage > 80%
- β No critical security vulnerabilities
- β Linting and formatting checks pass
- β Peer review approval
- β Integration tests pass
- β Performance benchmarks met
Following the Test Pyramid:
- 70% Unit Tests - Fast, isolated, business logic
- 20% Integration Tests - API and database integration
- 10% E2E Tests - Critical user journeys
See Testing Standards for details.
- API endpoints: < 200ms (p95)
- Database queries: < 100ms (p95)
- Page load time: < 2s (p95)
- Concurrent users: 10,000+
See Performance Specifications for optimization strategies.
React:
import { ThemeProvider } from '@fluentui/react';
import { PrimaryButton } from '@fluentui/react/lib/Button';Vue.js:
<template>
<fluent-button appearance="primary">Click me</fluent-button>
</template>See UI Guidelines for complete setup.
-
Create feature branch from
developgit checkout -b feature/your-feature-name
-
Follow naming conventions from Naming Conventions
-
Write tests first (TDD approach)
-
Implement feature following Best Practices
-
Run quality checks
dotnet build dotnet test dotnet format -
Create Pull Request with clear description
-
Pass code review and quality gates
-
Merge to develop β then to main for release
This template uses .editorconfig for consistent formatting:
- C# files: 4 spaces, PascalCase for public members
- TypeScript/JavaScript: 2 spaces, camelCase for variables
- JSON/YAML: 2 spaces
- Line endings: LF (Unix-style)
- Read the Constitution
- Follow the Rules
- Adhere to Best Practices
- Use Naming Conventions
- Write comprehensive tests per Testing Standards
This template is available under the MIT License. See LICENSE file for details.
- .NET Documentation
- ASP.NET Core Documentation
- FluentUI React
- React Documentation
- Vue.js Documentation
- Always use async/await for I/O operations
- Enable nullable reference types in all projects
- Use file-scoped namespaces (C# 10+)
- Implement proper logging with structured logging
- Cache appropriately with memory and distributed caching
- Validate all inputs using FluentValidation
- Never commit secrets - use secure secret management
- Review all specifications in
.github/specs/ - Set up your project following the architecture guidelines
- Configure CI/CD pipeline using GitHub Actions
- Implement authentication and authorization
- Set up database with migrations
- Create your first feature following TDD
- Deploy to your preferred cloud platform
Happy Coding! π
For questions or issues, please refer to the specifications or open an issue in this repository.