-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·100 lines (73 loc) · 1.92 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·100 lines (73 loc) · 1.92 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
# FinanceX Setup Script
echo "🚀 FinanceX - Retirement Calculator Setup"
echo "========================================="
echo ""
# Check Python
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed. Please install Python 3.10 or higher."
exit 1
fi
echo "✅ Python found: $(python3 --version)"
# Check Node.js
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 18 or higher."
exit 1
fi
echo "✅ Node.js found: $(node --version)"
echo ""
echo "📦 Setting up Backend (Django)..."
echo "================================="
# Backend setup
cd backend || exit
# Create virtual environment
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
source venv/bin/activate
# Install dependencies
echo "Installing Python dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
# Run migrations
echo "Running database migrations..."
python manage.py migrate
echo ""
echo "✅ Backend setup complete!"
echo ""
# Deactivate venv
deactivate
# Frontend setup
cd ../frontend || exit
echo "📦 Setting up Frontend (Next.js)..."
echo "===================================="
# Install dependencies
echo "Installing Node.js dependencies..."
npm install
# Create .env.local if it doesn't exist
if [ ! -f ".env.local" ]; then
echo "Creating .env.local..."
echo "NEXT_PUBLIC_API_URL=http://localhost:8000" > .env.local
fi
echo ""
echo "✅ Frontend setup complete!"
echo ""
cd ..
echo "🎉 Setup Complete!"
echo "=================="
echo ""
echo "To start the application:"
echo ""
echo "Terminal 1 (Backend):"
echo " cd backend"
echo " source venv/bin/activate"
echo " python manage.py runserver"
echo ""
echo "Terminal 2 (Frontend):"
echo " cd frontend"
echo " npm run dev"
echo ""
echo "Then open http://localhost:3000 in your browser"
echo ""