-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_dashboard.sh
More file actions
72 lines (59 loc) · 1.89 KB
/
create_dashboard.sh
File metadata and controls
72 lines (59 loc) · 1.89 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
#!/bin/bash
# 🚀 Crypto Trading Bot Dashboard Setup Script
# This script creates a React dashboard for monitoring the trading bot
echo "🚀 Creating Crypto Trading Bot Dashboard..."
echo "=========================================="
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Installing Node.js..."
# Install Node.js on Ubuntu
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
echo "✅ Node.js installed successfully"
else
echo "✅ Node.js is already installed: $(node --version)"
fi
# Check if npm is available
if ! command -v npm &> /dev/null; then
echo "❌ npm is not available"
exit 1
else
echo "✅ npm is available: $(npm --version)"
fi
# Create dashboard directory
DASHBOARD_DIR="trading-bot-dashboard"
echo "📁 Creating dashboard directory: $DASHBOARD_DIR"
# Remove existing directory if it exists
if [ -d "$DASHBOARD_DIR" ]; then
echo "⚠️ Directory $DASHBOARD_DIR already exists. Removing..."
rm -rf "$DASHBOARD_DIR"
fi
# Create React app
echo "⚛️ Creating React application..."
npx create-react-app "$DASHBOARD_DIR" --template typescript
# Navigate to dashboard directory
cd "$DASHBOARD_DIR"
# Install additional dependencies
echo "📦 Installing additional dependencies..."
npm install --save \
@mui/material \
@emotion/react \
@emotion/styled \
@mui/icons-material \
@mui/x-charts \
axios \
socket.io-client \
recharts \
react-router-dom \
@types/react-router-dom
# Install development dependencies
npm install --save-dev \
@types/socket.io-client
echo "✅ Dashboard setup completed!"
echo ""
echo "📋 Next steps:"
echo "1. cd $DASHBOARD_DIR"
echo "2. npm start"
echo "3. Open http://localhost:3000 in your browser"
echo ""
echo "🔧 The dashboard components will be created next..."