Skip to content

Development Setup

This page covers the development workflow, build commands, and testing setup for contributors.

CommandDescription
dotnet watch --project src/TechStrat.ApiRun with hot reload (recommended for development)
dotnet build TechStrat.slnxBuild all projects
dotnet test TechStrat.slnxRun all tests (requires Docker)
dotnet test tests/TechStrat.Core.TestsRun unit tests only (no Docker needed)

Always use dotnet watch during development rather than dotnet run:

Terminal window
dotnet watch --project src/TechStrat.Api

To completely reset the database (destroy all data and recreate):

Terminal window
docker compose -f docker/docker-compose.yml down -v
docker compose -f docker/docker-compose.yml up -d

When you change EF Core entity models or the DbContext, create a new migration:

Terminal window
dotnet ef migrations add <MigrationName> \
--project src/TechStrat.Infrastructure \
--startup-project src/TechStrat.Api \
--output-dir Persistence/Migrations

Migrations are auto-applied in development mode when the server starts. See Migrations for detailed guidance.

Terminal window
dotnet test tests/TechStrat.Core.Tests

These tests cover the domain logic — the event processor, model operations, and business rules. They require no database or Docker.

Terminal window
dotnet test tests/TechStrat.Api.Tests
dotnet test tests/TechStrat.Infrastructure.Tests

Integration tests use Testcontainers to spin up a PostgreSQL instance automatically. Docker must be running.

Terminal window
dotnet test TechStrat.slnx

The solution is organized into clearly separated layers:

src/
TechStrat.Core/ Pure domain (zero dependencies)
TechStrat.Infrastructure/ PostgreSQL persistence (depends on Core)
TechStrat.Shared/ DTOs shared between API and Blazor
TechStrat.Api/ ASP.NET Core host (depends on all src projects)
TechStrat.UI/ Shared Razor components
TechStrat.Web/ Blazor WASM unified app
tests/
TechStrat.Core.Tests/ Unit tests
TechStrat.Api.Tests/ Integration tests
TechStrat.Infrastructure.Tests/ Persistence tests
docker/
docker-compose.yml PostgreSQL dev instance

The layering follows strict dependency rules:

Diagram
  • Core has zero external dependencies — pure domain logic only
  • Infrastructure depends only on Core
  • Shared has no project dependencies (DTOs only)
  • UI depends only on Shared
  • Web depends on UI and Shared
  • Api is the composition root that references everything