Algo-Model

KERI Command Wiki

This page collects the main commands used in this repository.

Return to the docs navigation hub: KERI Documentation Hub

1) Environment Setup (Backend)

From the project root:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Upgrade dependencies if needed:

pip install -r requirements.txt --upgrade

2) Run Backend API

cd api
uvicorn main:app --reload

Default backend URL: http://localhost:8000

3) Frontend Commands

Install frontend dependencies:

cd frontend
npm install

Start frontend dev server:

cd frontend
npm start

Build frontend for production:

cd frontend
npm run build

Run frontend tests:

cd frontend
npm test

Eject CRA config (irreversible):

cd frontend
npm run eject

Optional backend URL override for frontend:

export REACT_APP_API_URL=http://localhost:8000

Default frontend URL: http://localhost:3000

4) Rebuild NHANES Dataset

source .venv/bin/activate
python api/fetch_nhanes.py

5) Train Biomarker Model

Train or refresh the artifact:

source .venv/bin/activate
python api/train_biomarker_model.py --force

Train without force (reuses existing artifact if present):

source .venv/bin/activate
python api/train_biomarker_model.py

Train with an explicit dataset path/name:

source .venv/bin/activate
python api/train_biomarker_model.py --dataset nhanes_merged.csv

6) Backend Tests (unittest)

Run all backend tests in api/:

python -m unittest discover -s api -p "test_*.py"

Run individual test files:

python -m unittest api/test_biomarker_flow.py
python -m unittest api/test_main_routes.py

7) Typical Local Workflow

Terminal 1:

source .venv/bin/activate
cd api
uvicorn main:app --reload

Terminal 2:

cd frontend
npm start

Optional data/model prep before starting app:

source .venv/bin/activate
python api/fetch_nhanes.py
python api/train_biomarker_model.py --force