lcsoft.dotnetgenesis

DotNet new Templates

https://github.com/luigi-sw/lcsoft.dotnetgenesis

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.5%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

DotNet new Templates

Basic Info
  • Host: GitHub
  • Owner: luigi-sw
  • License: other
  • Language: C#
  • Default Branch: main
  • Size: 66.4 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 10 months ago · Last pushed 7 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Codeowners Security Support

README.md

LCSoft.DotNetGenesis

[!CAUTION] These templates are highly opinionated by design.

While they aim to enforce strict and recognized architectural rules and patterns (such as Clean Architecture, DDD, Hexagonal, etc.), they also reflect my personal preferences and interpretations of these patterns. This includes specific decisions around: - Project structure - Naming conventions - Use of tools and libraries - Dependency injection and organization - Code style and folder layout

If you're looking for flexible or fully unopinionated scaffolding, these templates may not be the best fit out-of-the-box. However, you're encouraged to fork and customize them to suit your team's conventions, tooling preferences, and domain requirements.

These templates were originally created for my own use — tailored to my personal development style and architectural preferences. You're absolutely welcome to use them.

[!WARNING]
One of the core motivations behind this project is that most architecture templates available today are also highly opinionated, but they often fail to make that clear. Worse, many do not let you customize project names, namespaces, or folder structure properly — requiring significant manual cleanup after generation. This repository aims to be transparent about its opinions and give you a better starting point with proper scaffolding that respects your input.

Treat these templates as a strong starting opinion — not a one-size-fits-all solution.

Welcome to the LC.DotNetGenesis repository!

This project will provide a collection of dotnet new templates for rapidly scaffolding ASP.NET Core applications using Clean Architecture, Hexagonal Architecture (Ports and Adapters), and Onion Architecture principles — all with support for Domain-Driven Design (DDD) and key design patterns like CQRS, Mediator, Repository, and Dependency Injection.

[!TIP] For this first version, this will be only my choices for organization when creating a new project, will not be implemented DDD strictly at this point since this will be a future feature. Right now I just need a quickly setup start for my projects.

Overview

Starting a new project with a well-defined structure can significantly accelerate development and improve long-term maintainability. These templates aim to provide pre-configured solutions that embody best practices for different architectural styles.

Key Features:

  • Multiple Architectural Patterns: Choose the architecture that best suits your project needs.
  • Domain-Driven Design (DDD) Ready: Structured to facilitate DDD concepts like Entities, Aggregates, Value Objects, Domain Events, Repositories, and Application Services.
  • Separation of Concerns: Clear boundaries between different layers (Domain, Application, Infrastructure, Presentation/API).
  • Testability: Designed with testability in mind, encouraging unit, integration, and acceptance testing.
  • Modern .NET: Built using the latest stable versions of .NET and ASP.NET Core.
  • Common Patterns: Includes examples or placeholders for patterns like CQRS (Command Query Responsibility Segregation), Mediator, Repository, Unit of Work, etc., where applicable.

Available Templates

Currently, the following templates are available:

  1. LC Basic Stuff (lc-basic)

Each template is accessible via dotnet new and includes comprehensive project structure and example implementations:

  • lc-basic – Basic template with some basic structure and baseline files.

Features

  • ✅ Ready-to-use architecture patterns
  • ✅ SOLID principles implementation
  • ✅ Testable design
  • ✅ Unit test and integration test scaffolding
  • ✅ DI-ready structure
  • ✅ Modern .NET practices
  • ✅ Health checks
  • ✅ Logging integration
  • ❌ API-first with minimal setup and Swagger/OpenAPI support in API templates (Swagger, versioning, etc.)
  • ❌ Configuration management

All templates support:

  • ✅ Modular and layered structure
  • ✅ Follows SOLID, DRY, KISS principles
  • ✅ Dependency Injection using Microsoft.Extensions.DependencyInjection
  • ✅ Optional persistence via Entity Framework Core (can be replaced)
  • ❌ Domain-Driven Design (DDD) patterns (Entities, Aggregates, Value Objects, Services, Repositories)
  • ❌ CQRS and Mediator pattern implementation integration option
  • ❌ Event Sourcing option
  • ❌ Mediator pattern
  • ❌ Repository pattern
  • ❌ Unit of Work pattern
  • ❌ Specification pattern

Prerequisites

  • .NET 8.0 SDK or later
  • (Optional) Docker for containerized development

🚀 Getting Started

1. Install Templates

```bash dotnet new install PATHTOTHIS_REPOSITORY

or, for local development

dotnet new install . ```

To use these templates, you first need to install them using the dotnet new --install command.

  1. Clone the repository (Optional - if installing locally): bash git clone https://github.com/luigi-sw/LC.DotNetGenesis cd LC.DotNetGenesis

  2. Install from Local Source: Navigate to the root directory containing the .template.config folders (or the parent directory of your template projects) and run: ```bash dotnet new --install .

    Or point to specific template project folders if needed

    dotnet new --install ./src/Templates/LCBasic.Template/

    ```

  3. Install from NuGet (Recommended once published): Replace LC.DotNetGenesis with your actual NuGet package ID. bash dotnet new --install LC.DotNetGenesis

You can verify the installation by running dotnet new --list and searching for your template short names (e.g., lc-basic, lc-clean, lc-hex).

2. List Available Templates

bash dotnet new list

3. Usage

Once installed, you can create a new project using the templates.

```bash

Example: Create a basic project

dotnet new lc-basic -n MyApp -o ./MyApp ```

Template Options (not implemented yet)

Common options available for all templates:

  • ❌ --use-ddd - Enable Domain-Driven Design patterns
  • ❌ --use-cqrs - Implement CQRS pattern
  • ❌ --use-es - Add Event Sourcing infrastructure
  • ❌ --db-provider - Specify database provider (SqlServer, Postgres, Sqlite, InMemory)
  • ❌ --add-tests - Include unit and integration test projects
  • ❌ --add-docker - Include Docker support

Example:

bash dotnet new lc-basic -n MyProject --use-ddd --db-provider Postgres --add-tests

Template Details

🧩 LC-Basic

This template will allow clean architecture and organization of the project, without strict enforcement of rules, will allow the code be highly maintainable, clean and testable.

  • Project Structure:
    • YourProjectName.Core: Shared models, interfaces, and domain rules (anemic or rich, as needed).
    • YourProjectName.Application: Application Services, DTOs, Use Cases, Interfaces for Infrastructure.
    • YourProjectName.Infrastructure: Data Access, External Service Clients, Implementations of Infrastructure Interfaces.
    • YourProjectName.Web (or YourProjectName.Api): Thin controllers/endpoints (minimal logic).

Project Structure Overview

cpp YourProjectName/ ├── src/ │ ├── Web(or api)/ // Thin controllers/endpoints (minimal logic). │ │ ├── Models/ // Request/Response models │ │ ├── Configuration/ // Configuration (Dependency Injection) extensions │ │ └── Mapping/ // Mapping extensions │ ├── Application/ // Use cases/services—orchestrates workflows but defers to Core for rules. │ │ ├── Dto/ // Data transfer objects │ │ ├── Configuration/ // Configuration (Dependency Injection) extensions │ │ ├── Extensions/ // Other relevant extensions │ │ ├── Interfaces/ // Interface for the AppServices │ │ ├── AppServices/ // Use cases services and processors │ │ └── Mapping/ // Mapping extensions │ ├── Core/ // Shared models, interfaces, and domain rules (anemic or rich, as needed). │ │ ├── Entities/ // Aggregate roots and nested entities │ │ └── Services/ // Core services for complex business logic (stateless operations) │ └── Infrastructure/ // Persistence, third-party services, repository implementations │ ├── Repository/ // Repository pattern implementation │ ├── Configuration/ // Configuration (Dependency Injection) extensions │ ├── Interfaces/ // Interfaces for infrastructure services │ ├── ExternalServices/ // External services │ └── Mapping/ // Mapping extensions ├── tests/ │ ├── UnitTests/ // Core and Application layer tests │ └── IntegrationTests/ // End-to-end, persistence and API-level testing └── docs/ // Entities diagrams,glossary (optional)

  • Principles:

    • Separation of Concerns
    • Encourages rich domain modeling
    • Well-suited for small-to-medium but, evolving business domains.
  • Key Concepts:

    • Separate concerns, but allow cross-layer communication when pragmatic.
    • Logic is decoupled from frameworks for easy unit/integration testing.
    • Prefer clear, readable code over "magic" or excessive abstraction.

References

Owner

  • Name: luigi-sw
  • Login: luigi-sw
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
type: software
authors:
  - family-names: C. Filho
    given-names: Luigi
    portfolio: https://www.lcdesenvolvimentos.com.br
title: "LC.DotNetGenesis"
version: 0.0.1
date-released: 2025-02-01
url: "https://github.com/luigicfilho/LC.DotNetGenesis"

GitHub Events

Total
  • Push event: 3
Last Year
  • Push event: 3