.NET Archetypes
Modern .NET archetypes for building enterprise-grade, cloud-native services with cutting-edge technology stacks and production-ready features.
Overview
Our .NET archetype collection provides comprehensive templates for building scalable, maintainable, and performant services using the latest .NET technologies. Each archetype is designed with enterprise requirements in mind, including observability, security, testing, and deployment best practices.
Available Archetypes
REST Service Basic
Production-ready .NET REST service with Entity Framework, comprehensive CRUD operations, and extensive testing framework.
gRPC Service Basic
High-performance .NET gRPC service with Protocol Buffers, Entity Framework, and optimized for inter-service communication.
GraphQL Service Basic
Modern .NET GraphQL service with Hot Chocolate, comprehensive schema design, and real-time subscription support.
REST Domain Gateway
Enterprise domain gateway with authentication, gRPC integration, service orchestration, and comprehensive API management.
REST Services
REST Service Basic
ASP.NET CoreModern RESTful API service with Entity Framework Core, comprehensive testing, and production-ready configuration.
Perfect for CRUD operations, business APIs, and microservices
gRPC Services
gRPC Service Basic
High PerformanceHigh-performance gRPC service with protobuf definitions, streaming support, and comprehensive testing.
Ideal for inter-service communication and high-throughput scenarios
GraphQL Services
GraphQL Service Basic
Hot ChocolateModern GraphQL API with Hot Chocolate, type-safe resolvers, and advanced features like subscriptions.
Perfect for flexible APIs and client-specific data requirements
Domain Gateways
Enterprise API gateway with YARP reverse proxy, routing, authentication, and resilience patterns.
Essential for microservices architectures and domain boundaries
Key Features
Modern .NET Stack
- .NET 8: Latest LTS version with improved performance and features
- ASP.NET Core: High-performance web framework
- Entity Framework Core: Modern ORM with excellent performance
- C# 12: Latest language features and nullable reference types
Production Ready
- Observability: Built-in metrics, tracing, and structured logging
- Health Checks: Comprehensive health monitoring
- Configuration: Flexible configuration management
- Security: JWT authentication, authorization, and security headers
Developer Experience
- Testing: Comprehensive unit, integration, and performance tests
- Docker: Container-ready with multi-stage builds
- CI/CD: GitHub Actions workflows included
- Documentation: OpenAPI/Swagger integration
Enterprise Features
- Resilience: Circuit breakers, retry policies, and timeouts
- Validation: Request/response validation with FluentValidation
- Caching: Distributed caching support
- Background Services: Hosted services for background processing
Technology Comparison
| Feature | REST Service | gRPC Service | GraphQL Service | Domain Gateway |
|---|---|---|---|---|
| Performance | Good | Excellent | Good | Good |
| Type Safety | Moderate | Excellent | Excellent | Moderate |
| Streaming | Limited | Full Support | Subscriptions | Proxy |
| Browser Support | Native | Limited | Native | Native |
| Learning Curve | Low | Moderate | Moderate | High |
| Use Case | General APIs | Inter-service | Flexible APIs | API Gateway |
Getting Started
Prerequisites
- .NET 8 SDK or later
- Docker (optional, for containerization)
- Your preferred IDE (Visual Studio, VS Code, JetBrains Rider)
Quick Start
# Install Archetect CLI
npm install -g @archetect/archetect
# Generate a new .NET service
archetect render git@github.com:p6m-archetypes/dotnet-rest-service-basic.archetype.git my-api
cd my-api
# Run the service
dotnet run
Architecture Patterns
Best Practices
Service Design
- Follow RESTful principles for HTTP APIs
- Use domain-driven design patterns
- Implement proper error handling and validation
- Design for testability and maintainability
Performance
- Use async/await patterns consistently
- Implement proper caching strategies
- Optimize database queries and use proper indexes
- Monitor and profile regularly
Security
- Implement authentication and authorization
- Use HTTPS everywhere
- Validate all inputs
- Follow OWASP security guidelines
Deployment
- Use health checks for container orchestration
- Implement graceful shutdown
- Configure proper logging and monitoring
- Use configuration management for environments
Support and Resources
- Documentation: Each archetype includes comprehensive README and documentation
- Examples: Real-world code examples and patterns
- Community: Join our community for support and discussions
- Updates: Regular updates with latest .NET features and security patches
Ready to build modern .NET services? Choose the archetype that best fits your requirements and get started in minutes.