-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·53 lines (45 loc) · 1.35 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·53 lines (45 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# SecuScan Frontend Startup Script
echo "🔒 Starting SecuScan Frontend..."
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Error: Node.js is not installed"
echo "Please install Node.js 18+ from https://nodejs.org"
exit 1
fi
# Check Node version
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VERSION" -lt 18 ]; then
echo "⚠️ Warning: Node.js version is < 18. Some features may not work."
fi
# Check if backend is running
echo "🔍 Checking backend connection..."
if curl -s http://127.0.0.1:8080/api/v1/health > /dev/null 2>&1; then
echo "✅ Backend is running"
else
echo "⚠️ Warning: Backend is not responding at http://127.0.0.1:8080"
echo " Please start the backend first: cd ../backend && python -m backend.main"
echo ""
read -p "Continue anyway? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
echo "📦 Installing dependencies..."
npm install
if [ $? -ne 0 ]; then
echo "❌ Failed to install dependencies"
exit 1
fi
fi
echo ""
echo "✨ Starting development server..."
echo "📍 Frontend: http://localhost:3000"
echo "📍 Backend: http://127.0.0.1:8080"
echo ""
echo "Press Ctrl+C to stop"
echo ""
npm run dev