Appearance
Layering rules
Core rules
NGB.Runtimeorchestrates, but does not contain provider-specific SQL.NGB.PostgreSqlimplements provider-specific persistence and reporting execution.NGB.BackgroundJobsowns provider-neutral scheduling and hosting;NGB.BackgroundJobs.PostgreSqlowns the Hangfire PostgreSQL adapter.NGB.Hosting.AspNetCoreowns provider-neutral web hosting;NGB.PostgreSql.AspNetCoreowns PostgreSQL-specific web adapters.NGB.Runtime.Hostingowns generic-host lifecycle integration;NGB.Runtimeremains host-neutral.NGB.DefinitionsandNGB.Metadatadescribe, but do not host HTTP or provider logic.- vertical modules extend the platform without leaking vertical rules into reusable platform projects.
- hosts compose modules; libraries should not behave like hidden application entry points.
Practical do-not-cross boundaries
- do not put Dapper/Npgsql code into
NGB.Runtime; - do not put SQL, Dapper, or a concrete Hangfire storage provider into
NGB.BackgroundJobs; - do not put Hangfire dependencies into the generic
NGB.PostgreSqlprovider; - do not put vertical literals into reusable platform code where a generic contract belongs;
- do not put ASP.NET concerns into definitions/metadata projects;
- do not make
NGB.PostgreSqlthe owner of workflow semantics.
Why this matters
These rules are what let NGB remain a modular monolith instead of collapsing into either a generic framework or a pile of vertical-specific code.