-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·50 lines (38 loc) · 938 Bytes
/
setup.sh
File metadata and controls
executable file
·50 lines (38 loc) · 938 Bytes
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
#!/bin/bash
# Create necessary .env files
echo "Creating .env files..."
# Root .env
cat > .env << EOL
# Database
DATABASE_URL="postgresql://postgres:password@localhost:5432/crypto_bot"
# Web3
RPC_URL="https://eth-mainnet.g.alchemy.com/v2/your-api-key"
CHAIN_ID="1"
# Telegram Bot
BOT_TOKEN="7668895332:AAEwXnPGqA3xZTh255ECT65Q0SzenVLH-vw"
# API
API_URL="http://localhost:3001/api"
PORT=3001
# Web
NEXT_PUBLIC_API_URL="http://localhost:3001/api"
NEXT_PUBLIC_WS_URL="ws://localhost:3001"
EOL
# Copy .env files
echo "Copying .env files..."
mkdir -p apps/api
mkdir -p packages/database
cp .env ./apps/api/.env
cp .env ./packages/database/.env
# Install dependencies
echo "Installing dependencies..."
pnpm install
# Generate Prisma client
echo "Generating Prisma client..."
cd packages/database
pnpm db:generate
# Push database schema
echo "Pushing database schema..."
pnpm db:push
# Go back to root
cd ../..
echo "Setup complete!"