-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.command
More file actions
executable file
·57 lines (49 loc) · 1.45 KB
/
start.command
File metadata and controls
executable file
·57 lines (49 loc) · 1.45 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
54
55
56
57
#!/bin/bash
# ProposalAI — Double-click to launch
cd "$(dirname "$0")"
echo ""
echo "========================================="
echo " ProposalAI — RFP Response Engine"
echo "========================================="
echo ""
# Check for node
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed."
echo " Install it from: https://nodejs.org"
echo ""
read -p "Press Enter to close..."
exit 1
fi
# Install dependencies if needed
if [ ! -d "node_modules" ]; then
echo "📦 Installing dependencies (first run only)..."
npm install
echo ""
fi
# Check for .env
if [ ! -f ".env" ]; then
if [ -f ".env.example" ]; then
echo "⚠️ No .env file found. Creating from .env.example..."
echo " Please edit .env and add your ANTHROPIC_API_KEY"
cp .env.example .env
open -a TextEdit .env
echo ""
read -p "After adding your API key, press Enter to continue..."
fi
fi
echo "🚀 Starting ProposalAI..."
echo " Backend: http://localhost:3001"
echo " Frontend: http://localhost:3001"
echo ""
echo " Opening Safari..."
echo " (Press Ctrl+C to stop the server)"
echo ""
# Build frontend if dist doesn't exist
if [ ! -d "dist" ]; then
echo "🔨 Building frontend..."
npx vite build
fi
# Open Safari after a short delay
(sleep 2 && open -a Safari http://localhost:3001) &
# Start the server (serves both API + built frontend)
NODE_ENV=production node server.js