Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

28 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CI - Build and Test Dependencies audited Security: Dependabot Vulnerabilities checked .NET Analyzers

โšก BlitzSliceForge

Fast .NET scaffolder for Blazor + CQRS + Vertical Slice Architecture solutions

BlitzSliceForge (bsf) is a CLI tool that scaffolds a fully structured .NET 9 solution following Clean Architecture and Vertical Slice principles in seconds. Stop wasting time creating projects, linking references, and setting up folder structures manually โ€” let bsf do the heavy lifting.

.NET 9 Blazor Vertical Slice License Version


โœจ Features

  • ๐Ÿš€ One-command scaffolding โ€” generates an entire solution structure instantly
  • ๐Ÿ—๏ธ Clean Architecture โ€” Domain, Application, Infrastructure, and Web layers out of the box
  • ๐ŸŒ Blazor Interactive โ€” pre-configured Blazor project with Auto interactivity mode
  • ๐Ÿงช Test projects included โ€” test projects created and linked for every layer
  • ๐Ÿ“ Opinionated folder layout โ€” src/, tests/, docs/adr/, docker/, .github/workflows/
  • ๐Ÿ“„ Common files โ€” .gitignore, global.json, Directory.Build.props, and README.md auto-generated
  • โš™๏ธ Framework selection โ€” choose target .NET version (e.g., net8.0, net9.0) with a simple parameter
  • ๐Ÿ” SDK validation โ€” verifies the required .NET SDK is installed before scaffolding
  • ๐Ÿ“ฆ Distributed as a .NET tool โ€” install globally and use anywhere

๐Ÿ“ฆ Installation

Prerequisites

Install globally

dotnet tool install --global BlitzSliceForge.Cli

Check installation

bsf --help

Descripciรณn:
  bsf - Blitz Slice Forge

Uso:
  BlitzSliceForge.Cli [opciones]

Opciones:
  -n, --name <n> (REQUERIDO)    Name of the solution
  -f, --framework <net8|net9>  Target .NET framework version (e.g. net8)
  -o, --output <o>            Output path (default: solution name)
  -?, -h, --help                   Mostrar ayuda e informaciรณn de uso
  --version                        Mostrar informaciรณn de la versiรณn

Uninstall

dotnet tool uninstall BlitzSliceForge.Cli --tool-path .tools 

๐Ÿš€ Quick Usage

Generate a new solution

bsf --name MyAwesomeApp

This creates a solution named MyAwesomeApp in a folder with the same name in the current directory.

Generate a solution with a specific .NET framework

bsf --name MyAwesomeApp --framework net8

Specify a custom output directory

bsf --name MyAwesomeApp --output C:/Projects/MyAwesomeApp

CLI Options

Option Alias Description Required
--name -n Name of the solution โœ… Yes
--framework -f Target .NET framework version (e.g. net8) โŒ No
--output -o Output path (defaults to solution name) โŒ No

๐Ÿ—๏ธ Generated Structure

When you run bsf --name MyAwesomeApp, the following structure is generated:

MyAwesomeApp/
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/           # CI/CD workflow templates
โ”œโ”€โ”€ docker/                  # Docker configuration
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ adr/                 # Architecture Decision Records
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ MyAwesomeApp.Domain/             # Entities, Value Objects, Interfaces
โ”‚   โ”œโ”€โ”€ MyAwesomeApp.Application/        # Use Cases, CQRS Handlers, DTOs
โ”‚   โ”œโ”€โ”€ MyAwesomeApp.Infrastructure/     # EF Core, External Services, Repos
โ”‚   โ””โ”€โ”€ MyAwesomeApp.Web/               # Blazor Server/WASM (Auto mode)
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ MyAwesomeApp.Domain/             # Domain unit tests
โ”‚   โ”œโ”€โ”€ MyAwesomeApp.Application/        # Application unit tests
โ”‚   โ””โ”€โ”€ MyAwesomeApp.Infrastructure/     # Infrastructure unit tests
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ Directory.Build.props
โ”œโ”€โ”€ global.json
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ MyAwesomeApp.sln

Project References

The generated projects are automatically linked following Clean Architecture dependency rules:

graph TD
    A["๐ŸŒ MyAwesomeApp.Web<br/><i>Blazor - Presentation</i>"] --> B
    B["โš™๏ธ MyAwesomeApp.Application<br/><i>Use Cases / CQRS</i>"] --> C
    B --> D
    D["๐Ÿ”Œ MyAwesomeApp.Infrastructure<br/><i>Data Access / External</i>"] --> C
    C["๐Ÿงฑ MyAwesomeApp.Domain<br/><i>Entities / Core Logic</i>"]

    style A fill:#6C3FC5,stroke:#4A2A8A,color:#fff
    style B fill:#0078D4,stroke:#005A9E,color:#fff
    style C fill:#107C10,stroke:#0B5E0B,color:#fff
    style D fill:#D83B01,stroke:#A52C00,color:#fff
Loading

Application โ†’ references Domain + Infrastructure Infrastructure โ†’ references Domain


๐Ÿ“Š Project Status

timeline
    title BlitzSliceForge Roadmap
    section MVP โœ…
        v0.0.1 : Solution scaffolding
               : Clean Architecture layers
               : Blazor Web project (Auto)
               : Test projects per layer
               : Project reference linking
               : Common file templates
               : SDK version validation
    section Next Steps ๐Ÿ”ฎ
        Backlog : Entity scaffolding per feature
                : CQRS handler generation
                : Vertical Slice feature scaffolding
                : MediatR integration templates
                : Docker Compose templates
                : GitHub Actions CI/CD templates
                : NuGet package publishing
Loading

Current Status: MVP โœ…

Feature Status
Solution generation โœ… Done
Clean Architecture project layout โœ… Done
Blazor Web project (Auto interactivity) โœ… Done
Test projects for each layer โœ… Done
Automatic project reference linking โœ… Done
Common templates (.gitignore, global.json, etc.) โœ… Done
.NET SDK validation โœ… Done
Global .NET tool distribution โœ… Done
Framework selection โœ… Done
Unit tests for CLI core logic โœ… Done

Next Steps ๐Ÿ”ฎ

Feature Status
Entity scaffolding per feature/slice ๐Ÿ“‹ Planned
CQRS command/query handler generation ๐Ÿ“‹ Planned
Vertical Slice feature folder scaffolding ๐Ÿ“‹ Planned
MediatR integration templates ๐Ÿ“‹ Planned
Docker Compose templates ๐Ÿ“‹ Planned
GitHub Actions CI/CD pipelines ๐Ÿ“‹ Planned

๐Ÿ› ๏ธ Building from Source

# Clone the repository
git clone https://github.com/AlejBlasco/BlitzSliceForge.git
cd BlitzSliceForge

# Build the project
dotnet build

# Run locally
dotnet run --project src/BlitzSliceForge.Cli -- --name TestSolution

# Pack as a .NET tool
dotnet pack src/BlitzSliceForge.Cli -c Release

# Install locally from the generated .nupkg
dotnet tool install --global --add-source ./src/BlitzSliceForge.Cli/nupkg BlitzSliceForge.Cli

๐Ÿงช Running Tests

dotnet test

The test suite covers the core logic of BlitzSliceForge.Cli using xUnit, Moq and FluentAssertions.

Test coverage

Area Test class What is verified
Enums AvailableFrameworksEnumExtensionsTests TFM string mapping, out-of-range exception
Models GenerationOptionsTests Default values, property assignment
Models ProjectGenerationOptionsTests ProjectName, ProjectDirectory, FullProjectPath computed properties
Services DotNetCliResponseTests Constructor, GetOutputLines with empty / Unix / Windows / mixed line endings
Services SdkCheckerServiceTests Null guard, SDK found โ†’ true, not found โ†’ false, CLI called once
Services TemplateRendererServiceTests Missing template, static render, model interpolation, cancellation
Generators ProjectTemplateTests Project count, src/tests layout, framework propagation, Blazor options
Generators ProjectGeneratorTests Null guard, CLI invocation count, directory creation, reference linking

Run with coverage

dotnet test --collect:"XPlat Code Coverage"

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿค Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Architectural Decisions

All important decisions are documented in docs/adr/

About

Fast .NET scaffolder for Blazor + CQRS + Vertical Slice Architecture solutions

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages