Skip to content

Local Setup

Get the full project running on your machine.


1. Clone the repo

git clone https://github.com/elFilipeLu/SimCopilot.git
cd SimCopilot

2. Start local services (Postgres + Redis)

docker-compose -f SimCopilot.Api/docker-compose.yml up -d

This starts Postgres on port 5432 and Redis on port 6379.


3. Configure the API

Copy the example env file:

cp SimCopilot.Api/.env.example SimCopilot.Api/.env

At minimum, set Jwt__SecretKey to any 40+ character random string. OAuth and Anthropic keys are optional for local dev.


4. Run database migrations

cd SimCopilot.Api/src/SimCopilot.Api
dotnet ef database update
cd ../../..

5. Start the API

dotnet run --project SimCopilot.Api/src/SimCopilot.Api/SimCopilot.Api.csproj

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

dotnet build SimCopilot.sln -c Release

Open SimCopilot.App in Visual Studio or run:

dotnet run --project SimCopilot.App/SimCopilot.App.csproj

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