-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
71 lines (58 loc) · 1.86 KB
/
setup.sh
File metadata and controls
71 lines (58 loc) · 1.86 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
#!/bin/bash
echo "🚀 Setting up escape.fun PvP Crypto Betting Platform..."
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 18+ first."
exit 1
fi
# Check if npm is installed
if ! command -v npm &> /dev/null; then
echo "❌ npm is not installed. Please install npm first."
exit 1
fi
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed. Please install Docker first."
exit 1
fi
# Check if Docker Compose is installed
if ! command -v docker-compose &> /dev/null; then
echo "❌ Docker Compose is not installed. Please install Docker Compose first."
exit 1
fi
echo "✅ Node.js, npm, Docker, and Docker Compose are installed"
# Install dependencies
echo "📦 Installing dependencies..."
npm install
# Check if .env.local exists
if [ ! -f .env.local ]; then
echo "📝 Creating .env.local file..."
cp env.example .env.local
echo "⚠️ Please edit .env.local with your database credentials and JWT secret"
else
echo "✅ .env.local already exists"
fi
# Generate Prisma client
echo "🔧 Generating Prisma client..."
npx prisma generate
# Start Docker services
echo "🐳 Starting Docker services..."
docker-compose up -d
# Wait for database to be ready
echo "⏳ Waiting for database to be ready..."
sleep 10
# Run database migrations
echo "🗄️ Running database migrations..."
npx prisma db push
echo "🎉 Setup completed!"
echo ""
echo "Services running:"
echo "✅ PostgreSQL database (localhost:5432)"
echo "✅ Redis cache (localhost:6379)"
echo ""
echo "Next steps:"
echo "1. Edit .env.local if needed (Helius API key is already configured)"
echo "2. Start the backend: npm run dev:server"
echo "3. Start the frontend: npm run dev"
echo ""
echo "Visit http://localhost:3000 to see the application"