-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·47 lines (40 loc) · 1.26 KB
/
setup.sh
File metadata and controls
executable file
·47 lines (40 loc) · 1.26 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
#!/bin/bash
echo "🚀 Setting up ts-node-express project..."
# Check if pnpm is installed
if ! command -v pnpm &> /dev/null; then
echo "Installing pnpm..."
npm install -g pnpm
fi
# Install backend dependencies
echo "📦 Installing backend dependencies..."
cd backend && pnpm install && cd ..
# Install UI dependencies
echo "📦 Installing UI dependencies..."
cd ui && pnpm install && cd ..
# Set up environment variables
echo "🔧 Setting up environment variables..."
if [ ! -f .env ]; then
echo "Creating .env file..."
cat > .env << EOL
# Database Configuration
DATABASE_URL=file:./backend/local.db
# Server Configuration
PORT=3000
# Add any other required environment variables here
EOL
echo ".env file created successfully."
else
echo ".env file already exists. Skipping..."
fi
# Run database migrations
echo "🗃️ Setting up database..."
cd backend && pnpm dlx drizzle-kit generate && cd ..
cd backend && pnpm dlx drizzle-kit push:sqlite && cd ..
echo "✅ Setup completed successfully!"
echo
echo "🚀 To start the development server:"
echo " - Backend: cd backend && pnpm dev"
echo " - UI: cd ui && pnpm dev"
echo
echo "🌐 Backend will be available at: http://localhost:3000"
echo "🌐 UI will be available at: http://localhost:5173"