Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspfox.com/llms.txt

Use this file to discover all available pages before exploring further.

Hot reload

Backend: The API container runs dotnet watch run. Save any .cs file and the application rebuilds incrementally. Changes typically take 2–5 seconds to take effect. You do not need to restart Docker. Frontend: Vite HMR (Hot Module Replacement) is active in the frontend container. Save any .tsx, .ts, or .css file and the browser updates without a full page reload. React state is preserved for components that are not directly modified.

Makefile reference

All development commands go through make. Run any of these from the project root.
CommandWhat it does
make upStart all services in the background (detached mode)
make downStop all services and remove containers
make restartRestart the API container without rebuilding the image
make logsFollow logs from all services (Ctrl+C to stop)
make logs SERVICE=apiFollow logs from the API container only
make logs SERVICE=frontendFollow logs from the frontend container only
make buildRebuild Docker images and restart all services
make migrateApply any pending EF Core migrations to the database
make seedRun database seeders (creates admin user and lookup data)
make testRun all tests (backend + frontend)
make test-backendRun backend xUnit tests with coverage report
make test-frontendRun frontend Vitest tests
make typecheckRun TypeScript type checking on the frontend (no emit)
make lintRun ESLint on the frontend
make shell-apiOpen a bash shell inside the running API container
make shell-dbOpen a psql session in the database container
make cleanRemove all containers and volumes (deletes database data)
make freshFull reset: clean + up + migrate + seed
make release-checkRun all checks that CI runs: typecheck, lint, test

Adding an EF Core migration

When you modify an entity or add a new one, you need to create a migration and apply it. Step 1: Make sure the database container is running:
make up
Step 2: Open a shell in the API container:
make shell-api
Step 3: Create the migration from inside the container:
dotnet ef migrations add AddProjectsTable \
  --project src/Acme.Infrastructure \
  --startup-project src/Acme.Api
Step 4: Exit the container and apply the migration:
exit
make migrate
The migration file is created in src/Acme.Infrastructure/Migrations/. Commit it to git alongside the entity changes.
If you need to roll back a migration in development, run make shell-api and then dotnet ef database update <PreviousMigrationName> inside the container. Then delete the unwanted migration file.

Viewing database contents

Open a psql session directly:
make shell-db
This drops you into an interactive psql session connected to the development database. Use standard psql commands:
\dt                           -- list all tables
SELECT * FROM users LIMIT 10;
SELECT * FROM tenants;
SELECT * FROM refresh_tokens WHERE is_revoked = false;
\q                            -- quit

Viewing API logs

make logs SERVICE=api
AspFox uses Serilog with structured logging. Every request logs a correlation ID, method, path, status code, and duration. Example:
[INF] HTTP POST /api/v1/auth/login 200 OK in 47ms {CorrelationId: "abc123"}
[INF] Executing InviteMemberCommand {TenantId: "…", TargetEmail: "user@example.com"}
[WRN] Resend email failed for template EmailVerification {Error: "…"}
The correlation ID appears in every log line for a request, making it easy to trace a request through the logs.

Running tests

# All tests
make test

# Backend only (shows coverage)
make test-backend

# Frontend only
make test-frontend
Backend tests use TestContainers — they spin up a real PostgreSQL instance in Docker for integration tests. The first run downloads the container image; subsequent runs are fast.