Skip to main content
US Army Corps of EngineersInstitute for Water Resources, Risk Management Center

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
tip

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

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.


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

  1. Open the backend/src/ folder in Visual Studio
  2. Set DST.API as the startup project
  3. Press F5 (debug) or Ctrl+F5 (no debug)
  4. Visual Studio will launch the API with hot reload on http://localhost:5250
info

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.