-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·74 lines (61 loc) · 1.94 KB
/
setup.sh
File metadata and controls
executable file
·74 lines (61 loc) · 1.94 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
#!/bin/bash
echo "============================================"
echo " AI-Powered CRM - Setup Script"
echo "============================================"
# Create virtual environment
echo "Creating virtual environment..."
python3 -m venv venv
source venv/bin/activate
# Install dependencies
echo "Installing Python dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
# Setup PostgreSQL database
echo ""
echo "============================================"
echo " Database Setup"
echo "============================================"
echo ""
echo "Make sure PostgreSQL is installed and running."
echo "Creating database and user..."
# Create database (modify credentials as needed)
sudo -u postgres psql << EOF
CREATE DATABASE ai_crm;
CREATE USER crm_user WITH ENCRYPTED PASSWORD 'crm_password';
GRANT ALL PRIVILEGES ON DATABASE ai_crm TO crm_user;
EOF
echo "Database created successfully!"
# Run migrations
echo "Running database migrations..."
python -c "from database.models import Base; from database.connection import engine; Base.metadata.create_all(bind=engine)"
# Setup environment variables
echo ""
echo "Creating .env file..."
cat > .env << EOF
# Database
DATABASE_URL=postgresql://crm_user:crm_password@localhost:5432/ai_crm
# LLM API Keys
OPENAI_API_KEY=your_openai_key_here
ANTHROPIC_API_KEY=your_anthropic_key_here
# Redis
REDIS_URL=redis://localhost:6379/0
# Email
GMAIL_API_CREDENTIALS=path/to/credentials.json
# App Settings
DEBUG=True
SECRET_KEY=your_secret_key_here
EOF
echo ""
echo "============================================"
echo " Setup Complete!"
echo "============================================"
echo ""
echo "Next steps:"
echo "1. Edit .env file with your API keys"
echo "2. Start Redis: redis-server"
echo "3. Start API server: python main.py"
echo "4. Start Celery workers: celery -A workflows.worker worker"
echo ""
echo "API will be available at: http://localhost:8000"
echo "API docs: http://localhost:8000/docs"
echo ""