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

Development Environment

This page covers cloning the repo, starting and stopping services, and your daily development workflow.


Clone and Install

# Clone the repository
git clone <repo-url>
cd DST-Dev

# Install frontend dependencies
cd frontend
npm install
cd ..

Set Your Developer Name

Each developer needs a unique name for database snapshot isolation. Run this once per machine:

echo yourname > db\.dev-name

Replace yourname with your actual first name (e.g., sarah). This file is gitignored — it stays local to your machine. If you skip this, the scripts will prompt you on first run.


Starting the Environment

From the repo root:

./start-dev.bat

This single command does everything in order:

  1. Starts the PostgreSQL Docker container
  2. Waits for the database to be healthy
  3. Restores your database snapshot (or seeds demo data on first run)
  4. Starts the System-Response API (new Windows Terminal tab)
  5. Starts the .NET backend with hot reload (new Windows Terminal tab)
  6. Starts the React frontend (new Windows Terminal tab)
  7. Opens Chrome to http://localhost:5174

All three services open as named tabs in a single Windows Terminal window.

Service URLs

ServiceURLPurpose
Frontendhttp://localhost:5174React dev server (Vite)
Backend APIhttp://localhost:5250ASP.NET Core API
System-Responsehttp://localhost:5001Calculation engine
PostgreSQLlocalhost:5432Database (user: dst_user, pass: dst_password, db: dst_db)

Verify Everything Works

  1. The browser should open to the DST application
  2. You should see the sidebar navigation on the left
  3. Click through Hazards in the sidebar — data entry pages for hazard parameters
  4. Click Response > Evaluation — you'll see the fully-implemented PFM-01 module (your reference)

Stopping the Environment

When you're done working:

./end-dev.bat

This snapshots your database, stops all services, and cleans up Docker. Always use this command — if you kill Docker manually, your database changes will be lost.


Daily Workflow

./start-dev.bat       ← start of day (restores your DB)
... work ...
./end-dev.bat ← end of day (snapshots your DB)

Script Reference

ScriptDescription
start-dev.batStart everything (DB, System-Response, Backend, Frontend, Browser)
scripts/start-db.batStart PostgreSQL container only
scripts/start-backend.batStart .NET API only (new window)
scripts/start-frontend.batStart React dev server only (new window)

Restarting Individual Services

If one service crashes or you need to restart just one part:

./scripts/end-frontend.bat && ./scripts/start-frontend.bat
Configuration

Before running start-dev.bat for the first time, verify the SYSTEM_RESPONSE_PATH variable at the top of the script points to your local System-Response repository. See Prerequisites and IDE Setup for details.