-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
63 lines (50 loc) · 1.39 KB
/
Copy pathsetup.sh
File metadata and controls
63 lines (50 loc) · 1.39 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
#!/bin/bash
echo "🚀 Setting up Smart Document Q&A Agent..."
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed. Please install Python 3.9 or higher."
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 18 or higher."
exit 1
fi
# Create data directories
echo "📁 Creating data directories..."
mkdir -p data/documents
mkdir -p data/vectorstore
mkdir -p data/logs
# Create .gitkeep files
touch data/documents/.gitkeep
touch data/vectorstore/.gitkeep
touch data/logs/.gitkeep
# Setup backend
echo "🐍 Setting up backend..."
cd backend
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
# Download spacy model
python -m spacy download en_core_web_lg
# Copy .env if not exists
if [ ! -f .env ]; then
cp .env.example .env
echo "⚠️ Please edit backend/.env and add your GEMINI_API_KEY"
fi
cd ..
# Setup frontend
echo "⚛️ Setting up frontend..."
cd frontend
npm install
cd ..
echo "✅ Setup complete!"
echo ""
echo "Next steps:"
echo "1. Get your Gemini API key from https://aistudio.google.com/app/apikey"
echo "2. Edit backend/.env and add your GEMINI_API_KEY"
echo "3. Run 'bash start.sh' to start the application"
echo ""