Skip to content

beyondnetcode/Shell.Bootstrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BeyondNet.Bootstrapper

A lightweight, extensible library for orchestrating .NET application startup

🇬🇧 English | 🇪🇸 Español

NuGet Build


Welcome to BeyondNet.Bootstrapper! A lightweight, extensible library for orchestrating the startup sequence of any .NET application or library. Based on the Composite pattern, it lets you encapsulate each initialization step as an independent, testable unit.

Built on .NET 10 with full support for async/await, Nullable Reference Types, and a Cloud Native observability stack.

Installation

NuGet Packages

# Core (always required)
dotnet add package BeyondNetCode.Shell.Bootstrapper

# Official adapters (add as needed)
dotnet add package BeyondNetCode.Shell.Bootstrapper.DependencyInjection
dotnet add package BeyondNetCode.Shell.Bootstrapper.AutoMapper
dotnet add package BeyondNetCode.Shell.Bootstrapper.Observability

Packages Overview

Package Description NuGet
BeyondNetCode.Shell.Bootstrapper Core bootstrapper with Composite pattern link
BeyondNetCode.Shell.Bootstrapper.DependencyInjection DI extension adapter link
BeyondNetCode.Shell.Bootstrapper.AutoMapper AutoMapper configuration adapter link
BeyondNetCode.Shell.Bootstrapper.Observability OpenTelemetry + Serilog adapter link

Why BeyondNet.Bootstrapper?

Without a standard, startup code tends to become a monolithic block in Program.cs that is hard to test and maintain. This library solves that by enforcing a single rule:

Each initialization concern lives in its own class. The Composite runs them in order.

Benefits:

  • Each bootstrapper is independently unit-testable
  • The startup sequence is explicit and readable
  • Adding or removing a step never changes surrounding code
  • Async I/O at startup cannot deadlock the application

Quick Start

Synchronous Bootstrapper

public class MyBootstrapper : IBootstrapper
{
    public void Run()
    {
        // Initialize your service
        Console.WriteLine("Bootstrap complete!");
    }
}

// Use
new CompositeBootstrapper()
    .Add(new MyBootstrapper())
    .Run();

Asynchronous Bootstrapper

public class MyAsyncBootstrapper : IBootstrapperAsync
{
    public async Task RunAsync()
    {
        await Task.Delay(100);
        Console.WriteLine("Async bootstrap complete!");
    }
}

// Use
await new CompositeBootstrapperAsync()
    .Add(new MyAsyncBootstrapper())
    .RunAsync();

Combining with Adapters

var composite = new CompositeBootstrapperAsync()
    .Add(new DependencyInjectionBootstrapper(services =>
    {
        services.AddSingleton<IMyService, MyService>();
    }))
    .Add(new AutoMapperBootstrapper(cfg =>
    {
        cfg.CreateMap<Source, Dest>();
    }))
    .Add(new ObservabilityBootstrapper(services, config))
    .Add(new MyCustomBootstrapper());

await composite.RunAsync();

Documentation

For detailed documentation, see the language-specific README files:

Migration from Ums.Shell.Bootstrapper

If you were using Ums.Shell.Bootstrapper, update your NuGet references:

# Before (Ums.Shell.Bootstrapper)
dotnet add package Ums.Shell.Bootstrapper

# After (BeyondNetCode.Shell.Bootstrapper)
dotnet add package BeyondNetCode.Shell.Bootstrapper

Update namespaces in your code:

// Before
using Ums.Shell.Bootstrapper;

// After
using BeyondNetCode.Shell.Bootstrapper;

Contributing

See CONTRIBUTING.md for GitFlow workflow, commit conventions, and coding standards.

Versioning

See VERSIONING.md for SemVer strategy and release process.

License

Licensed under the Apache 2.0 License. See LICENSE for details.

Acknowledgments

See DISCLAIMER.md for original code authorship attribution.

About

Lightweight .NET bootstrapper library for orchestrating application startup with async support, Composite pattern, DI, AutoMapper, and observability adapters.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages