#!/bin/bash

start_backend() {
    DEBUG=true uvicorn evoprompt.api.main:app --reload
}
start_frontend() {
    BROWSER="none" npm run start --prefix evoprompt/frontend
}

start_backend & pid_backend=($!)
start_frontend & pid_frontend=($!)
python -m webbrowser -t "http://localhost:8000"
wait "$pid_backend"
kill "$pid_frontend"
