#!/bin/bash
# LinkedIn Lead Generator - Startup Script

echo "Starting LinkedIn Lead Generator..."

# Create data directory if not exists
mkdir -p data

# Generate Prisma client if needed
if [ ! -d "node_modules/.prisma" ]; then
    echo "Generating Prisma client..."
    npx prisma generate
fi

# Push database schema if needed
if [ ! -f "data/leads.db" ]; then
    echo "Initializing database..."
    npx prisma db push
fi

# Start the server
echo "Starting server on port 3000..."
PORT=3000 HOSTNAME=0.0.0.0 node server.js
