Merge pull request #18 from illAssad/fix/frontend-npm-install

Fix frontend startup by auto-installing npm dependencies
This commit is contained in:
Bob Roberts 2025-12-08 21:47:01 -06:00 • committed by GitHub
commit 2b80837f7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -194,6 +194,21 @@ if check_port 5173; then
fi
cd "$PROJECT_DIR/frontend"
# Check if node_modules exists, install dependencies if not
if [ ! -d "node_modules" ]; then
echo " Installing frontend dependencies..."
npm install > "$PROJECT_DIR/logs/frontend.log" 2>&1
if [ $? -eq 0 ]; then
echo -e " ${GREEN}✓ Frontend dependencies installed${NC}"
else
echo -e " ${RED}❌ Failed to install frontend dependencies${NC}"
echo " Check logs with: tail -f logs/frontend.log"
cd "$PROJECT_DIR"
exit 1
fi
fi
nohup npm run dev -- --host 0.0.0.0 > "$PROJECT_DIR/logs/frontend.log" 2>&1 &
FRONTEND_PID=$!
echo " Frontend PID: $FRONTEND_PID (logging to logs/frontend.log)"