DotNetStarter is a CLI (Command Line Interface) tool designed to help .NET developers quickly and efficiently initialize projects in an organized way, following architectural best practices. With support for multiple architectures such as Clean Architecture, Domain-Driven Design (DDD), Hexagonal Architecture, and more, DotNetStarter makes project creation more intuitive and automated.
- Support for multiple architectures: Clean Architecture, DDD, Hexagonal, CQRS + Event Sourcing, Onion Architecture, and Microservices.
- Dynamic project and folder creation based on the chosen template.
- Integration with the dotnet CLI to automatically generate solutions and projects.
- Modularity and extensibility, making it easy to add new architectures.
- Modern visual experience using Spectre.Console.
Layered structure with clear separation of concerns, focusing on Application, Domain, Infrastructure, CrossCutting, and Tests.
Separation of commands and queries with event-based persistence. Includes folders for CommandSide, QuerySide, API, Shared, and Tests.
Domain-centered model with support for Aggregates, Entities, ValueObjects, Events, and Exceptions. Includes layers such as Application, Domain, Infrastructure, Presentation, and Tests.
Decouples core application logic from external interfaces. Includes folders for Adapters, Application, Domain, Infrastructure, and Tests.
Focused on building decoupled services with support for messaging and observability. Includes layers like API, Application, Domain, Infrastructure, and Tests.
Layered model with concentric circles, where dependencies flow from the outer layers to the inner ones. Includes folders for API, Core, Infrastructure, and Tests.
Initializes a new project based on the chosen architecture.
# Create a project using Clean Architecture
$ dotnetstarter init CleanArchitectureLists the available architecture structures.
# Show available structures
$ dotnetstarter list Displays available commands or supported architectures.
# Show general help
$ dotnetstarter helpDepending on the selected architecture, DotNetStarter creates a solution and organizes the projects in layers. For example, in Clean Architecture:
MyProject.sln
├── MyProject.Application
│ ├── DTOs
│ ├── Interfaces
│ ├── Services
│ └── UseCases
├── MyProject.Domain
│ ├── Entities
│ ├── Interfaces
│ ├── ValueObjects
├── MyProject.Infrastructure
│ ├── Context
│ ├── Migrations
│ └── Repositories
├── MyProject.CrossCutting
│ └── DependencyInjection
├── MyProject.Tests
└── UnitTests
DotNetStarter uses Factories to encapsulate the logic for creating each architecture and Builders to perform common operations such as creating projects, solutions, and folders. The use of Dependency Injection (DI) ensures extensible and modular code.
- .NET 6: Core platform for tool development.
- Spectre.Console: Provides a modern and interactive CLI interface.
- Microsoft.Extensions.DependencyInjection: For dependency management.
-
Make sure you have the .NET SDK installed (version 6 or higher).
-
Install the DotNetStarter tool via NuGet:
$ dotnet tool install -g DotNetStarter- Verify the installation:
$ dotnetstarter --helpContributions are very welcome! To contribute:
- Fork the repository.
- Create a branch for your feature or fix:
git checkout -b my-feature. - Commit your changes:
git commit -m 'Added a new feature'. - Push to the remote repository:
git push origin my-feature. - Open a Pull Request.
If you have questions, suggestions, or want to reach out, feel free to send me a message on LinkedIn.
I hope this tool makes .NET project development easier for you! 🚀