#!/bin/bash

# Enamel Wallets - Quick Live Deployment Script
# Run this script to deploy your app live in 15 minutes

echo "🚀 ENAMEL WALLETS - GOING LIVE NOW!"
echo "=================================="

# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m'

print_step() {
    echo -e "${GREEN}✓${NC} $1"
}

print_info() {
    echo -e "${BLUE}→${NC} $1"
}

print_warning() {
    echo -e "${YELLOW}!${NC} $1"
}

echo
print_info "Step 1: Installing Vercel CLI..."
npm install -g vercel

echo
print_info "Step 2: Building your Enamel Wallets app..."
npm run build

if [ $? -eq 0 ]; then
    print_step "Build successful!"
else
    echo "❌ Build failed. Please check your code."
    exit 1
fi

echo
print_info "Step 3: Deploying to Vercel..."
print_warning "When prompted, choose:"
print_warning "- Set up new project: YES"
print_warning "- Project name: enamel-wallets"
print_warning "- Framework: React/Vite"
print_warning "- Root directory: ./"

vercel --prod

echo
print_step "🎉 ENAMEL WALLETS IS NOW LIVE!"
echo
print_info "Your app is deployed! Copy the URL from above."
print_info "Next steps:"
print_info "1. Go to your Supabase dashboard"
print_info "2. Run the DATABASE_SCHEMA.sql in SQL Editor"
print_info "3. Add environment variables in Vercel"
print_info "4. Test with: test@enamelwallets.ng / TestUser123!"

echo
print_warning "🌐 Your live Nigerian fintech platform is ready!"
print_warning "🏦 Multi-wallet system ✓"
print_warning "👥 Group savings (Ajo/Esusu) ✓"
print_warning "💳 Payment processing ready ✓"
print_warning "👑 Admin dashboard ✓"