Local Setup¶
Get the full project running on your machine.
1. Clone the repo¶
2. Start local services (Postgres + Redis)¶
This starts Postgres on port 5432 and Redis on port 6379.
3. Configure the API¶
Copy the example env file:
At minimum, set Jwt__SecretKey to any 40+ character random string. OAuth and Anthropic keys are optional for local dev.
4. Run database migrations¶
5. Start the API¶
API is now running at http://localhost:5000. Swagger UI at http://localhost:5000/swagger (Development mode only).
6. Build and run the desktop app¶
Open SimCopilot.App in Visual Studio or run:
In the app: Paramètres → Compte → API URL → set to http://localhost:5000.
7. Run tests¶
# Desktop app tests
dotnet test SimCopilot.sln -c Release
# API tests (includes SafeWatch unit tests)
dotnet test SimCopilot.Api/SimCopilot.Api.sln -c Release
All tests should pass green.
8. Browse SafeWatch (optional)¶
Navigate to http://localhost:5000/safewatch. Default dev credentials (from appsettings.Development.json):
| Username | Password | Role |
|---|---|---|
admin |
admin123 |
sys_admin |
product |
admin123 |
product |
support |
admin123 |
support |
ceo |
admin123 |
ceo |
Warning
Change these credentials before deploying to any shared environment.
Troubleshooting¶
| Symptom | Fix |
|---|---|
Connection refused on Postgres |
Run docker-compose up -d and wait 10 seconds |
dotnet ef: command not found |
Run dotnet tool install --global dotnet-ef |
| Desktop app shows "Hors ligne" | Set ApiBaseUrl to http://localhost:5000 in Settings |
| SafeWatch redirects to login on every request | The sw_session cookie requires HTTPS in production; dev uses HTTP override in appsettings.Development.json |