Repository navigation
Expand file tree
/
Copy pathsetup-dashboard.sh
More file actions
executable file
·77 lines (68 loc) · 2.04 KB
/
Copy pathsetup-dashboard.sh
File metadata and controls
executable file
·77 lines (68 loc) · 2.04 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
#!/bin/bash
# Setup script for DBAB API Dashboard Integration
# This script helps you set up the API for the dashboard
set -e
echo "🚀 DBAB API - Dashboard Setup Script"
echo "===================================="
echo ""
# Check Python version
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed. Please install Python 3.8 or higher."
exit 1
fi
PYTHON_VER=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
echo "✓ Python $PYTHON_VER found"
# Check if config directory exists
CONFIG_DIR="$HOME/.dbab-config"
if [ ! -d "$CONFIG_DIR" ]; then
echo ""
echo "📁 Creating config directory..."
mkdir -p "$CONFIG_DIR"
echo "✓ Created $CONFIG_DIR"
fi
# Check if config file exists
CONFIG_FILE="$CONFIG_DIR/dbab.json"
if [ ! -f "$CONFIG_FILE" ]; then
echo ""
echo "⚠️ Config file not found at $CONFIG_FILE"
echo "📝 Creating template config file..."
cp dbab.json.example "$CONFIG_FILE"
echo "✓ Created $CONFIG_FILE"
echo ""
echo "⚠️ IMPORTANT: Edit $CONFIG_FILE and add:"
echo " - Discord client_id"
echo " - Discord client_secret"
echo " - A strong JWT secret"
echo ""
read -p "Press Enter after updating the config file..."
fi
# Install dependencies
echo ""
echo "📦 Installing Python dependencies..."
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
echo "✓ Dependencies installed"
else
echo "❌ requirements.txt not found"
exit 1
fi
# Run migrations
echo ""
echo "🗄️ Running database migrations..."
python3 migrations.py
# Summary
echo ""
echo "✅ Setup complete!"
echo ""
echo "📋 Next steps:"
echo "1. Verify config file at: $CONFIG_FILE"
echo "2. Ensure Discord OAuth credentials are set"
echo "3. Run the API: python3 main.py"
echo "4. API will start on: http://localhost:3000"
echo ""
echo "Dashboard will run on: http://localhost:5173"
echo ""
echo "📚 Documentation:"
echo " - DASHBOARD_SETUP.md - Complete setup guide"
echo " - DASHBOARD_API_GUIDE.md - API reference"
echo ""