Scaffold the Before-M1 repo skeleton

Stand up the modular-monolith skeleton per docs/V1_BUILD_PLAN.md: one .NET 10
solution with web + worker hosts sharing seven interface-bounded module projects,
PostgreSQL 17 + pgvector via EF Core 10, a React 19 + Vite SPA built into wwwroot,
and Docker Compose for one-command local dev. Skeleton only — no feature code.

Architecture
- One project per module (OrgBoard, Identity, Skills, Assembler, Governance,
  Memory, Integrations); each is its own assembly so non-public types (entities,
  DbContext) are invisible across modules at compile time.
- TeamUp.Bootstrap is the only library that references all modules; both hosts
  reference only Bootstrap. SharedKernel/Infrastructure never reference modules.
- IModule seam: Register(...) runs in both hosts; MapEndpoints(...) only in web.
- PlatformDbContext owns the pgvector extension + the seven module schemas
  (InitialPlatform migration); MigrationRunner applies it then any module context.
- One image, two roles selected by RUN_MODE at the Docker entrypoint.

Verified
- dotnet build green (nullable + warnings-as-errors).
- ArchitectureTests 8/8 — reflection-based boundary rules (no module -> module,
  -> Infrastructure, -> Bootstrap, or -> host references).
- IntegrationTests 10/10 — Testcontainers boots the host against real pgvector:
  migration applies, vector extension + 7 schemas exist, /health 200, every
  /api/<module>/ping 200, /openapi/v1.json served.
- client builds clean (Vite 6 — pinned for Node 22.3.0; Vite 8 needs Node >=22.12).

Packages and base images route through the Nexus mirror (mirror.soroushasadi.com),
reachable from Iran when nuget.org / Docker Hub / MCR are not. CI is intentionally
deferred to a later session.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-09 06:41:28 +03:30
commit 36fe158b43
89 changed files with 7329 additions and 0 deletions
@@ -0,0 +1,10 @@
namespace TeamUp.SharedKernel.Domain;
/// <summary>
/// Base class for domain entities. Uses a UUIDv7 identifier — time-ordered, so it keeps
/// B-tree index locality (unlike a random v4) while remaining globally unique.
/// </summary>
public abstract class Entity
{
public Guid Id { get; protected set; } = Guid.CreateVersion7();
}
@@ -0,0 +1,30 @@
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace TeamUp.SharedKernel.Modularity;
/// <summary>
/// The contract every domain module implements. A module is a self-contained slice of the
/// monolith with its own persistence and services. Modules collaborate only through public
/// abstractions resolved from DI — never by referencing each other's internals.
/// </summary>
public interface IModule
{
/// <summary>Stable lowercase key used for the module's DB schema and in logs (e.g. "orgboard").</summary>
string Name { get; }
/// <summary>
/// Register the module's services, validators, DbContext, etc. Runs in BOTH the web and
/// worker hosts, so a module's background-capable services are available to the worker.
/// </summary>
void Register(IServiceCollection services, IConfiguration configuration);
/// <summary>
/// Contribute Minimal-API endpoint groups. Called by the WEB host only — the worker never
/// invokes this, so modules contribute zero HTTP surface to the worker. Default is a no-op.
/// </summary>
void MapEndpoints(IEndpointRouteBuilder endpoints)
{
}
}
@@ -0,0 +1,4 @@
namespace TeamUp.SharedKernel.Modularity;
/// <summary>Response of a module's skeleton liveness endpoint — proves the module seam is wired.</summary>
public sealed record ModulePing(string Module, string Status = "ok");
@@ -0,0 +1,8 @@
namespace TeamUp.SharedKernel.Persistence;
/// <summary>
/// Marker implemented by each module's (internal) DbContext so the migration runner can
/// discover every module context from DI and apply its migrations uniformly. Keeping this in
/// SharedKernel lets Infrastructure migrate module contexts without referencing the modules.
/// </summary>
public interface IModuleDbContext;
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--
The dependency-light core. Defines the IModule seam and base domain/persistence
abstractions. The ASP.NET framework reference is here ONLY so IModule can name
IEndpointRouteBuilder / IServiceCollection / IConfiguration. No package deps,
no project deps — every module references this and nothing else of ours.
-->
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>