Development Setup
This page covers the development workflow, build commands, and testing setup for contributors.
Build Commands
Section titled “Build Commands”| Command | Description |
|---|---|
dotnet watch --project src/TechStrat.Api | Run with hot reload (recommended for development) |
dotnet build TechStrat.slnx | Build all projects |
dotnet test TechStrat.slnx | Run all tests (requires Docker) |
dotnet test tests/TechStrat.Core.Tests | Run unit tests only (no Docker needed) |
Development Server
Section titled “Development Server”Always use dotnet watch during development rather than dotnet run:
dotnet watch --project src/TechStrat.ApiDatabase Management
Section titled “Database Management”Reset the database
Section titled “Reset the database”To completely reset the database (destroy all data and recreate):
docker compose -f docker/docker-compose.yml down -vdocker compose -f docker/docker-compose.yml up -dCreate a migration
Section titled “Create a migration”When you change EF Core entity models or the DbContext, create a new migration:
dotnet ef migrations add <MigrationName> \ --project src/TechStrat.Infrastructure \ --startup-project src/TechStrat.Api \ --output-dir Persistence/MigrationsMigrations are auto-applied in development mode when the server starts. See Migrations for detailed guidance.
Running Tests
Section titled “Running Tests”Unit tests (fast, no dependencies)
Section titled “Unit tests (fast, no dependencies)”dotnet test tests/TechStrat.Core.TestsThese tests cover the domain logic — the event processor, model operations, and business rules. They require no database or Docker.
Integration tests (requires Docker)
Section titled “Integration tests (requires Docker)”dotnet test tests/TechStrat.Api.Testsdotnet test tests/TechStrat.Infrastructure.TestsIntegration tests use Testcontainers to spin up a PostgreSQL instance automatically. Docker must be running.
All tests
Section titled “All tests”dotnet test TechStrat.slnxProject Structure
Section titled “Project Structure”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 instanceDependency rules
Section titled “Dependency rules”The layering follows strict dependency rules:
- 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
Next Steps
Section titled “Next Steps”- Read the Coding Conventions before making changes
- Review the Testing guide for test writing patterns
- Explore the Architecture to understand the system design