Common Development Tasks
Quick reference for tasks you'll perform regularly during DST development.
For Git branching, commit message standards, pull request workflows, and code review process, see the GitHub Workflows SOP.
Creating a Database Migration
After adding a new entity and its EF configuration:
cd backend/src/DST.API
dotnet ef migrations add YourMigrationName --project ../DST.Infrastructure
dotnet ef database update
Always run migrations from the DST.API directory with the --project ../DST.Infrastructure flag. The migration files are generated in the Infrastructure project, but the EF tools need the API project as the startup project to resolve the connection string.
Running the Frontend Linter
cd frontend
npm run lint
Building the Backend
cd backend/src/DST.API
dotnet build
To build the entire solution from the backend root:
cd backend/src
dotnet build DST.API/DST.API.csproj
Testing an API Endpoint
- VS Code REST Client
- curl
- Visual Studio
Create a .http file anywhere in the project:
### Get hydrologic hazard for demo screening
GET http://localhost:5250/api/screenings/demo01/hydrologic-hazard
### Save hydrologic hazard data
PUT http://localhost:5250/api/screenings/demo01/hydrologic-hazard
Content-Type: application/json
{
"curve": [
{ "aep": 0.01, "stage": 496.5 },
{ "aep": 0.001, "stage": 500.5 }
]
}
Click "Send Request" above any request block to execute it.
curl http://localhost:5250/api/screenings/demo01/hydrologic-hazardVisual Studio includes a built-in HTTP client. Create a .http file in the API project and use the same syntax as VS Code REST Client.
Alternatively, use the Endpoints Explorer (View → Other Windows → Endpoints Explorer) to discover and test API routes automatically.
Connecting to the Database
Use any PostgreSQL client (pgAdmin, DBeaver, VS Code PostgreSQL extension, or Azure Data Studio with the PostgreSQL extension):
Host: localhost
Port: 5432
Database: dst_db
User: dst_user
Password: dst_password
Running the Backend from Visual Studio
- Open the
backend/src/folder in Visual Studio - Set DST.API as the startup project
- Press
F5(debug) orCtrl+F5(no debug) - Visual Studio will launch the API with hot reload on
http://localhost:5250
The frontend and System-Response services still need to be started separately via their scripts or manually in a terminal. Visual Studio only runs the DST backend.