Skip to content

BXS-Lab/Human-Space-Flight-Risk-Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NASA Human Spaceflight Risk Network

Interactive analysis of NASA's human spaceflight risk DAGs with a FastAPI backend and a React + Cytoscape frontend. The app merges 29 risk graphs, computes structural metrics and DRM-aware rankings, and presents them in a searchable, filterable UI.

Repository layout

  • backend/ - FastAPI service (graph parsing/merging, centrality and scoring endpoints).
  • frontend/ - React + Vite client for visualization and ranking exploration.
  • data/ - All required inputs (*.dag, NODE definition.json, LC score.csv).
  • START_BACKEND.bat / START_FRONTEND.bat - Convenience launchers for Windows.
  • requirements.txt - Backend Python dependencies (installed into a virtual environment).

Prerequisites

  • Python 3.10+ with pip
  • Node.js 18+ with npm
  • Windows users can rely on the .bat files; macOS/Linux users can follow the manual steps below.

Quick start (Windows)

  1. START_BACKEND.bat
    • Creates backend/venv if missing.
    • Installs requirements.txt.
    • Runs backend/test_startup.py to confirm imports and data presence in data/.
    • Starts Uvicorn on http://localhost:8000.
  2. In a new terminal, START_FRONTEND.bat
    • Installs frontend dependencies (if node_modules is absent).
    • Starts Vite dev server on http://localhost:5173 with API pointed to localhost:8000.

Quick start (macOS/Linux)

Backend:

cd backend
python -m venv venv
source venv/bin/activate
pip install -r ../requirements.txt
cd src
uvicorn main:app --reload --host 0.0.0.0 --port 8000

Frontend:

cd frontend
npm install
npm run dev -- --host

Configure the API base (if not default) via frontend/.env (VITE_API_BASE=https://human-space-flight-risk-network.onrender.com by default in the example).

Data folder

All required inputs live in data/:

  • *.dag - 29 risk DAGs in GraphViz format.
  • NODE definition.json - Node definitions and notes.
  • LC score.csv - Likelihood x Consequence scores used for DRM-aware ranking.

The backend loads directly from repo_root/data at startup; no database setup is needed.

Backend notes

  • Framework: FastAPI + Uvicorn.
  • Key modules: DAG parsing/merging (graph/), LxC parsing (data/), metrics and scoring (metrics/), CSV export helpers (utils/export.py).
  • Primary endpoints: /api/graph, /api/risks, /api/drms, /api/centrality, /api/score, /api/top10, /api/export/*.
  • Recommended runtime: Python 3.11 (Render config pins pythonVersion: 3.11.7 to avoid pandas build issues on 3.13).

Frontend notes

  • Stack: React 18, TypeScript, Vite, Cytoscape.js, Axios.
  • Entry points: frontend/src/App.tsx with supporting components under frontend/src/components/.
  • Expects the API base URL from VITE_API_BASE (defaults to https://human-space-flight-risk-network.onrender.com in .env.example).
  • GitHub Pages ready: npm run deploy from frontend/ builds to dist/ and publishes to the gh-pages branch (Vite base is set to /Human-Space-Flight-Risk-Network/ and homepage is configured).

Hosted backend (Render, free tier)

  • Push this repo (including data/) to GitHub.
  • In Render, create a New Web Service from the repo; it will read render.yaml.
    • Build command: pip install -r requirements.txt
    • Start command: cd backend/src && uvicorn main:app --host 0.0.0.0 --port $PORT
    • Plan: Free (service may sleep when idle).
  • After deploy, note the public URL (e.g., https://human-space-flight-risk-network.onrender.com).
  • Set VITE_API_BASE in frontend/.env to that URL (the example already matches), then from frontend/ run npm run deploy to republish GitHub Pages so the static site calls the hosted backend.

Housekeeping

  • Temporary environments are ignored via .gitignore (backend/venv, frontend/node_modules, caches, etc.).
  • No additional documentation is required beyond this README; data artifacts are all in data/.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors