Applications built on the Anarchy I/O Toolkit platform, one per kind of workload a typical service runs. They use only the toolkit’s own defaults and extension points. None of these projects is packed, and the layering check ignores them.

No single sample covers the whole platform; together they show its three pillars composed:

  • Architecture: each application registers its services through DI modules (ModuleLibConfiguration) and follows the async, endpoint and testing conventions.
  • Infrastructure: each references only the packages its workload needs (below), plus their dependencies.
  • Build Ecosystem: they are part of the solution, so this repository’s Fallout build compiles and lints them with the packages they consume.
Project Packages referenced directly Capabilities shown
Samples.Api Web REST pipeline, configuration, telemetry, Lambda hosting
Samples.Job Hosting Job hosting, configuration, telemetry
Samples.Worker Hosting, Hosting.Workers Worker hosting, heartbeat and monitored workers
Samples.Ui Web.Ui Blazor UI, cookie-session login, downstream API clients
Samples.MockServer Web.MockServer, Web.MockServer.Ui HTTP mock server with expectations and middlewares
Samples.Examples Configuration, Core.Persistence.Abstractions, Infrastructure.Telemetry.Serilog Telemetry providers and exporters, a UseCase and an Aggregate
Samples.Testing Testing, Testing.Web, Testing.MockServer Showcase of the Testing packages: in-memory telemetry, API, job and UI smoke tests, mock-server assertions

Persistence and messaging packages are not used by the samples; see the Package Catalog and Database Providers.

Project Kind Shows
Samples.Api REST API RestApiWebAppStartupBase, a controller using AppTelemetry, Kestrel locally (Program.cs) and AWS Lambda behind API Gateway (LambdaEntryPoint), which opts into the Parameter Store through its ConfigureAppConfiguration hook.
Samples.Job AWS Lambda job JobStartupBase + JobEntryPointBase, a scoped service wrapped in AppTelemetry.MonitoredActionAsync.
Samples.Worker EC2/systemd worker WorkerEntryPointBase, HeartbeatWorker and a custom MonitoredWorkerBase.
Samples.Ui WebApp UiWebAppStartupBase with two environments, an orders page built from the Web.Ui components (LoginForm, SessionBadge, NotificationHost, JsonModalHost/JsonViewLink, Pagination, TablePaginationFooter, ConfirmationModal, TypedConfirmationModal), and a UiApiClientBase client. Stub auth and orders endpoints under /stub (local hosts only) let it run without external services.
Samples.MockServer Mock server host MockServerEntryPoint with JSON expectations for a payments service (mocks/), a conventional middleware rejecting requests without a bearer token, and an inline one computing stock levels from the request when no expectation matches. Serves the UI at /__mock/ui.
Samples.Examples Console examples Run one with dotnet run --project samples/Samples.Examples -- <name>. Telemetry: default (AddCoreTelemetry() with Microsoft logging and standard metrics), serilog (AddSerilogTelemetry with a consumer sink receiving the toolkit’s events), swap (the same CheckoutService on Microsoft logging, then Serilog), recorder (a custom IMetricRecorder) and otlp (OpenTelemetry exporting the toolkit meter over OTLP; set OTLP_ENDPOINT). orders shows a PlaceOrderUseCase that owns the transaction and an OrderAggregate that joins it, over an in-memory IUnitOfWork.
Samples.Testing Compiled Testing showcase Smoke tests running the API through both the native and Lambda pipelines (RestApiTestCaseBase), invoking the job handler, and exercising the UI’s shell and stubs. Asserting what an application sent to the payments and stock services stood in by Samples.MockServer (MockServerFixture, AssertReceivedAsync).

The application samples register ModuleLibConfiguration; the standalone telemetry examples use AddCoreTelemetry() directly. Both get the toolkit’s provider-neutral ICoreTelemetry, IMetricRecorder and AppTelemetry. Logs go to the logging providers the application registers and metrics use standard .NET metrics; to use an organization’s own sinks or metrics backend, register them (or pass a ModuleTelemetryBase through new ModuleLibConfiguration<…>(new ModuleTelemetry(new MyTelemetryModule()))). See the observability guide.

Run the API locally:

dotnet run --project samples/Samples.Api --environment Development

Run the UI locally, then open https://localhost:5101 and log in with client ID anarchy and secret secret (the stub’s test credentials, overridable through StubClientId/StubClientSecret):

dotnet run --project samples/Samples.Ui --environment Development

Pick either environment on the login page: each has its own orders. Canceling a shipped order shows how a failed downstream call is reported; priority orders (★) ask for typed confirmation.

Run the mock server locally, showing request headers and bodies, then try curl -H 'Authorization: Bearer x' -d '{"currency":"EUR"}' localhost:6001/payments or curl localhost:6001/stock/ABC-1:

dotnet run --project samples/Samples.MockServer -- --verbosity detailed --record artifacts/mock-requests.jsonl
# then open http://localhost:6001/__mock/ui/ (or pass --no-ui)

Samples.Testing is compiled with the solution, so CI proves it builds against the Testing packages, but it is not part of the regular test run (make test_unit). Run it on demand with cd samples/Samples.Testing && dotnet run -c Release. Its MockServerTests spawn it on a free port, or use the one at MOCKSERVER_URL when it is set.