Skip to content

Repository files navigation

GenericModularApi

GenericModularApi is a .NET 10 modular monolith skeleton for building projects from optional, replaceable modules.

The repo is intentionally small and explicit:

  • modules are registered by the host, not discovered by assembly scanning;
  • cross-module communication goes through contracts and integration events;
  • EF Core is the practical unit of work;
  • tenant support starts with shared-database isolation through TenantId;
  • reliable cross-boundary publishing goes through outbox tables and a NATS JetStream adapter.
  • optional cache-aside reads use provider-neutral contracts, HybridCache, and an opt-in Redis adapter.
  • optional administration uses a separate CLI host, persisted RBAC/audit, and feature-owned admin front doors.
  • optional admin HTTP APIs use a separate Host.AdminApi composition root.
  • optional background processing uses a separate Host.Worker composition root when deployments want HTTP hosts to avoid publisher, consumer, and task-worker load.

Quick Start

.\eng\restore.ps1
.\eng\build.ps1 -NoRestore
.\eng\test-fast.ps1 -NoBuild

Run the full local development stack with Aspire:

.\eng\run-aspire.ps1

Run only the API:

.\eng\run-api.ps1

Run the optional admin CLI locally:

.\eng\run-admin.ps1 -- admin roles list --actor owner

Run the optional admin API locally:

.\eng\run-admin-api.ps1

Run the optional worker locally:

.\eng\run-worker.ps1

Run the optional worker in Aspire by setting:

$env:AppHost__Worker__Enabled = 'true'
.\eng\run-aspire.ps1

Docker-backed tests are skippable by default. To require them:

.\eng\test-docker.ps1 -NoBuild

Documentation

Start with docs/README.md.

Useful entry points:

Request Examples

HTTP examples live in requests/auth.http and requests/admin-api.http.

Project Status

This is a work-in-progress skeleton. The current reusable modules are Auth, Tenancy, Administration, Notifications, and TaskRuntime. Catalog, Ordering, and TaskSamples are compiled optional example modules used to prove stored data, admin surfaces, caching, cross-module integration, notifications, and task execution without being registered in default hosts.

About

Just a personal playground for proving some concepts that I have in mind. Work in progress...

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages