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:
- Starts the PostgreSQL Docker container
- Waits for the database to be healthy
- Restores your database snapshot (or seeds demo data on first run)
- Starts the System-Response API (new Windows Terminal tab)
- Starts the .NET backend with hot reload (new Windows Terminal tab)
- Starts the React frontend (new Windows Terminal tab)
- Opens Chrome to http://localhost:5174
All three services open as named tabs in a single Windows Terminal window.
Service URLs
| Service | URL | Purpose |
|---|---|---|
| Frontend | http://localhost:5174 | React dev server (Vite) |
| Backend API | http://localhost:5250 | ASP.NET Core API |
| System-Response | http://localhost:5001 | Calculation engine |
| PostgreSQL | localhost:5432 | Database (user: dst_user, pass: dst_password, db: dst_db) |
Verify Everything Works
- The browser should open to the DST application
- You should see the sidebar navigation on the left
- Click through Hazards in the sidebar — data entry pages for hazard parameters
- 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
- Start Scripts
- End Scripts
| Script | Description |
|---|---|
start-dev.bat | Start everything (DB, System-Response, Backend, Frontend, Browser) |
scripts/start-db.bat | Start PostgreSQL container only |
scripts/start-backend.bat | Start .NET API only (new window) |
scripts/start-frontend.bat | Start React dev server only (new window) |
| Script | Description |
|---|---|
end-dev.bat | Stop everything (snapshots DB first) |
scripts/end-db.bat | Stop PostgreSQL container only |
scripts/end-backend.bat | Stop .NET API only |
scripts/end-frontend.bat | Stop React dev server only |
Restarting Individual Services
If one service crashes or you need to restart just one part:
- Frontend
- Backend
- Database
./scripts/end-frontend.bat && ./scripts/start-frontend.bat./scripts/end-backend.bat && ./scripts/start-backend.bat./scripts/end-db.bat && ./scripts/start-db.batThis will snapshot, tear down, and restore the database.
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.