-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
50 lines (44 loc) · 1.55 KB
/
build.sh
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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
echo "Starting Speech-to-Code setup..."
# Frontend setup
echo "Setting up frontend..."
cd frontend
if [ ! -f .env ]; then
echo "Creating frontend .env file..."
echo "REACT_APP_OPENAI_API_KEY=your-openai-api-key" > .env
fi
echo "Installing frontend dependencies..."
npm install
# Backend setup
echo "Setting up backend..."
cd ../backend
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
echo "Activating virtual environment..."
source venv/bin/activate
echo "Installing backend dependencies..."
pip install -r requirements.txt
if [ ! -f .env ]; then
echo "Creating backend .env file..."
echo "OPENAI_API_KEY=your-openai-api-key" > .env
echo "GOOGLE_API_KEY=your-google-api-key" >> .env
echo "ANTHROPIC_API_KEY=your-anthropic-api-key" >> .env
# Prompt for repository path
read -p "Enter the path to your repositories: " repo_path
echo "REPO_PATH=$repo_path" >> .env
else
# Check if REPO_PATH exists in .env, if not, prompt for it
if ! grep -q "REPO_PATH" .env; then
read -p "Enter the path to your repositories: " repo_path
echo "REPO_PATH=$repo_path" >> .env
fi
fi
echo "Setup complete!"
echo "Please update the API keys in both frontend/.env and backend/.env files."
echo "To run the application:"
echo "1. Start the frontend: cd frontend && npm start"
echo "2. In a new terminal, start the backend: cd backend && source venv/bin/activate && uvicorn main:app --reload --log-level debug"