Skip to content

Operations — local run & reset

What it is

How to run ManpowerIQ locally and how to reset the database to a clean baseline. This is the current, supported way to run the system — the source is the local-environment runbook (Local_Environment_Runbook.md), which is the operations source of truth.

Running locally

1. Database — the canonical local DB is Docker postgres:16-alpine (per docker-compose.yml):

docker compose up -d

2. Dependencies

dotnet restore ManpowerIQ.sln
# (web) npm install

3. Apply migrations — explicitly; the API does not migrate on startup:

dotnet ef database update --project src/ManpowerIQ.Infrastructure --startup-project src/ManpowerIQ.API

4. Run the API

dotnet run --project src/ManpowerIQ.API
  • API: http://localhost:5159 · Swagger UI: http://localhost:5159/swagger · health: GET /api/health.

5. Run the web app

npm run dev   # Vite → http://localhost:5173

Sign in with a demo user (e.g. via POST /api/auth/login-dev in Development) — see the runbook §6 for accounts.

Resetting to a clean baseline

The supported reset is drop + recreate, not truncate — seed-data migrations are non-idempotent against truncation (PB-025; see Migrations):

dotnet ef database drop -f --project src/ManpowerIQ.Infrastructure --startup-project src/ManpowerIQ.API
dotnet ef database update --project src/ManpowerIQ.Infrastructure --startup-project src/ManpowerIQ.API

Then re-apply the demo dataset if needed (the DemoDataSeeder, runbook §11 / §"seeder round-trip"). The full destructive-cleanup commands are runbook §11.

Gotchas / constraints

  • No migrate-on-startup — apply migrations before running the API (corrected against the runbook in Phase 3).
  • Reset = drop + recreate — truncation leaves __EFMigrationsHistory ahead of the rows; the telltale is POST /api/auth/login-dev401 Unknown user with zero row counts.
  • Restore application_settings after smoke tests (PB-046) — toggling password.require_* settings and forgetting to restore makes the Domain.Tests sweep fail; the runbook §"CRITICAL" has the restore script.
  • Restore the DemoDataSeeder Skip toggle after a seeder round-trip, or dotnet test will run the seeder against the dev DB.
  • Hangfire schema is installed by a bootstrap gate; corruption recovery is a manual DROP SCHEMA hangfire CASCADE; (runbook §5).

Build status

Available — local docker-compose + dotnet run + npm run dev is the current way to run the system. Hosted deployment is planned — see Deployment.