Modular monolith backend for Community Pro. .NET 9, minimal APIs, one Postgres database with a schema per module, Meilisearch for search.
- .NET SDK 9+ (SDK 10 works — projects target
net9.0) - Docker Desktop (Postgres 16 + Meilisearch)
dotnet-ef(pinned in.config/dotnet-tools.json):dotnet tool restore
Start infrastructure:
docker compose up -dPostgres listens on localhost:5432 (communitypro / communitypro, database communitypro). Meilisearch listens on localhost:7700 with master key communitypro-local-master-key.
Run the API with hot reload:
dotnet watch --project src/CommunityPro.Api- Health check:
GET http://localhost:5080/health - API reference (dev only):
http://localhost:5080/scalar/v1 - OpenAPI document (dev only):
http://localhost:5080/openapi/v1.json
In Development the host applies pending EF Core migrations on startup, so Postgres must be up before the API.
One migration set per module, each DbContext mapped to its own Postgres schema. From the repo root:
dotnet ef migrations add <Name> \
--project src/Modules/CommunityPro.Members \
--startup-project src/CommunityPro.Api \
--context MembersDbContextApply manually (optional — dev startup does this automatically):
dotnet ef database update \
--project src/Modules/CommunityPro.Members \
--startup-project src/CommunityPro.Api \
--context MembersDbContextRepeat the pattern per module as their contexts land (IdentityDbContext, ContentDbContext, ...). Design-time factories fall back to the docker-compose connection string; override with the COMMUNITYPRO_CONNECTION environment variable.
dotnet build
dotnet testsrc/
CommunityPro.Api/ Host: DI wiring, endpoint discovery, middleware
CommunityPro.SharedKernel/ Result<T>, Error, PagedResult<T>, domain events, IEndpointModule
Modules/
CommunityPro.Identity/ Phase 1
CommunityPro.Members/ Phase 2 (owns the "members" schema; migrations pipeline proven here)
CommunityPro.Content/ Phase 4
CommunityPro.Contributors/ Phase 5
CommunityPro.Mentorship/ Phase 6
CommunityPro.Sponsorship/ Phase 7
CommunityPro.Admin/ Phase 8
tests/
CommunityPro.Tests/ xUnit, per-module test folders