-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
57 lines (45 loc) · 1.21 KB
/
setup.sh
File metadata and controls
57 lines (45 loc) · 1.21 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
echo "Setting up Travel Guide Application..."
echo ""
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "Python is not installed. Please install Python 3.8 or higher and try again."
exit 1
fi
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "Node.js is not installed. Please install Node.js and try again."
exit 1
fi
echo "Setting up backend..."
cd backend
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment and install requirements
source venv/bin/activate
pip install -r requirements.txt
if [ $? -ne 0 ]; then
echo "Failed to install Python dependencies."
exit 1
fi
cd ..
echo ""
echo "Setting up frontend..."
cd frontend
# Install Node.js dependencies
npm install
if [ $? -ne 0 ]; then
echo "Failed to install Node.js dependencies."
exit 1
fi
cd ..
echo ""
echo "Setup completed successfully!"
echo ""
echo "To start the application:"
echo "1. Start the backend: cd backend && source venv/bin/activate && python app.py"
echo "2. In a new terminal, start the frontend: cd frontend && npm start"
echo ""