@@ -26,6 +26,7 @@ set -euo pipefail
2626readonly PROJECT_ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
2727readonly FRONTEND_DIR=" ${PROJECT_ROOT} /surfsense_web"
2828readonly EXTENSION_DIR=" ${PROJECT_ROOT} /surfsense_browser_extension"
29+ readonly BACKEND_DIR=" ${PROJECT_ROOT} /surfsense_backend"
2930
3031ENV_NAME=" ${SURFSENSE_ENV_NAME:- surfsense} "
3132PYTHON_VERSION=" ${SURFSENSE_PYTHON_VERSION:- 3.12} "
@@ -74,17 +75,41 @@ main() {
7475 conda_run python -m pip install --upgrade pip setuptools wheel
7576
7677 info " Installing SurfSense backend dependencies…"
78+ if [[ ! -d " ${BACKEND_DIR} " ]]; then
79+ error " Backend directory not found at '${BACKEND_DIR} '. Verify repository layout and adjust BACKEND_DIR."
80+ fi
7781 conda_run python -m pip install -e " ${BACKEND_DIR} "
7882
7983 info " Installing optional developer helpers…"
8084 conda_run python -m pip install " pre-commit>=3.8.0"
8185
8286 if command -v npm > /dev/null 2>&1 ; then
83- info " Installing frontend dependencies (surfsense_web)…"
84- (cd " ${FRONTEND_DIR} " && npm install)
85-
86- info " Installing browser extension dependencies (surfsense_browser_extension)…"
87- (cd " ${EXTENSION_DIR} " && npm install)
87+ if command -v node > /dev/null 2>&1 ; then
88+ NODE_MAJOR=" $( node -v | sed -E ' s/^v([0-9]+).*/\1/' ) "
89+ if [[ " ${NODE_MAJOR} " -lt 18 ]]; then
90+ warn " Detected Node.js v$( node -v) . Require >= v18; skipping frontend installs."
91+ NODE_OK=false
92+ else
93+ NODE_OK=true
94+ fi
95+ else
96+ warn " node not found (only npm present); skipping frontend installs."
97+ NODE_OK=false
98+ fi
99+ if [[ " ${NODE_OK:- false} " == true ]]; then
100+ if [[ -d " ${FRONTEND_DIR} " ]]; then
101+ info " Installing frontend dependencies (surfsense_web)…"
102+ (cd " ${FRONTEND_DIR} " && npm install)
103+ else
104+ warn " Frontend directory not found at '${FRONTEND_DIR} '. Skipping web app install."
105+ fi
106+ if [[ -d " ${EXTENSION_DIR} " ]]; then
107+ info " Installing browser extension dependencies (surfsense_browser_extension)…"
108+ (cd " ${EXTENSION_DIR} " && npm install)
109+ else
110+ warn " Extension directory not found at '${EXTENSION_DIR} '. Skipping extension install."
111+ fi
112+ fi
88113 else
89114 warn " npm not found; skipping frontend dependency installation. Install Node.js 18+ to enable the web UI."
90115 fi
@@ -96,7 +121,7 @@ main() {
96121 conda activate ${ENV_NAME}
97122
981232. Start the backend API:
99- (cd ${BACKEND_DIR} && uvicorn app.app:app --reload)
124+ (cd " ${BACKEND_DIR} " && uvicorn app.app:app --reload)
100125 or refer to DEPLOYMENT_GUIDE.md for production options.
101126
1021273. Start the web app (if npm was available):
107132}
108133
109134main " $@ "
110-
0 commit comments