54 lines
1.4 KiB
Bash
Executable File
54 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "🎵 Setting up Harmony - A Shared Spotify Experience for Two"
|
|
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+ first."
|
|
exit 1
|
|
fi
|
|
|
|
# Check if PostgreSQL is installed
|
|
if ! command -v psql &> /dev/null; then
|
|
echo "❌ PostgreSQL is not installed. Please install PostgreSQL first."
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Prerequisites check passed"
|
|
|
|
# Install dependencies
|
|
echo "📦 Installing dependencies..."
|
|
npm install
|
|
|
|
# Generate Prisma client
|
|
echo "🔧 Generating Prisma client..."
|
|
npm run db:generate
|
|
|
|
# Check if database exists
|
|
echo "🗄️ Setting up database..."
|
|
DB_EXISTS=$(psql -lqt | cut -d \| -f 1 | grep -w spotify_app | wc -l)
|
|
|
|
if [ $DB_EXISTS -eq 0 ]; then
|
|
echo "Creating database 'spotify_app'..."
|
|
createdb spotify_app
|
|
echo "✅ Database created"
|
|
else
|
|
echo "✅ Database already exists"
|
|
fi
|
|
|
|
# Push database schema
|
|
echo "📊 Pushing database schema..."
|
|
npm run db:push
|
|
|
|
echo ""
|
|
echo "🎉 Setup complete!"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo "1. Copy .env.local and update with your Spotify credentials"
|
|
echo "2. Get your Spotify user IDs and add them to ALLOWED_SPOTIFY_USERS"
|
|
echo "3. Run 'npm run dev' to start the development server"
|
|
echo "4. Visit http://localhost:3000 to see your beautiful Harmony app!"
|
|
echo ""
|
|
echo "💕 Enjoy your musical journey together!"
|