Files
routeros-traffic/scripts/dev.sh
Mateusz Gruszczyński 5429f176c9 first commit
2026-03-04 15:21:03 +01:00

31 lines
685 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
echo "[dev] starting backend..."
(
cd "$ROOT_DIR/backend"
if [ ! -f ".env" ]; then cp .env.example .env; fi
python -m venv .venv >/dev/null 2>&1 || true
source .venv/bin/activate
pip install -q -r requirements.txt
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
) &
BACK_PID=$!
cleanup() {
echo
echo "[dev] stopping..."
kill $BACK_PID >/dev/null 2>&1 || true
}
trap cleanup EXIT
echo "[dev] starting frontend..."
(
cd "$ROOT_DIR/frontend"
if [ ! -f ".env.local" ]; then cp .env.example .env.local; fi
npm install >/dev/null
npm run dev
)