-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·81 lines (67 loc) · 1.91 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·81 lines (67 loc) · 1.91 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
78
79
80
81
#!/bin/bash
# Payment Soundbox Setup Script
echo "🚀 Payment Soundbox Setup Script"
echo "================================="
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 18+ from https://nodejs.org/"
exit 1
fi
# Check if npm is available
if ! command -v npm &> /dev/null; then
echo "❌ npm is not available. Please install npm or use a Node.js installer that includes npm."
exit 1
fi
echo "✅ Node.js version: $(node --version)"
echo "✅ npm version: $(npm --version)"
# Install dependencies
echo "📦 Installing dependencies..."
npm install
if [ $? -eq 0 ]; then
echo "✅ Dependencies installed successfully!"
else
echo "❌ Failed to install dependencies. Please check the error messages above."
exit 1
fi
# Create database directory
echo "🗄️ Creating database directory..."
mkdir -p server/database
# Set up environment
echo "⚙️ Setting up environment..."
if [ ! -f .env ]; then
echo "Creating .env file..."
cat > .env << EOF
# Payment Soundbox Backend Configuration
PORT=3001
NODE_ENV=development
# Database Configuration
DB_PATH=./server/database/payments.db
# WebSocket Configuration
WS_PORT=3001
# CORS Configuration
CORS_ORIGIN=http://localhost:3000
# TTS Configuration
TTS_ENABLED=true
TTS_SERVICE=web_speech_api
# Payment Configuration
PAYMENT_TIMEOUT=300000
QR_CODE_SIZE=256
EOF
echo "✅ .env file created"
else
echo "✅ .env file already exists"
fi
echo ""
echo "🎉 Setup completed successfully!"
echo ""
echo "To start the application:"
echo "1. Terminal 1 (Backend): npm run dev:server"
echo "2. Terminal 2 (Frontend): npm run dev"
echo ""
echo "Access the application at:"
echo "- Frontend: http://localhost:3000"
echo "- Backend API: http://localhost:3001"
echo "- Health Check: http://localhost:3001/api/health"
echo ""
echo "To test the API:"
echo "- npm run test:api"