freezone/platform/run-server.sh
2025-06-30 17:01:40 +02:00

55 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Freezone Platform Server Runner
# This script sets up and runs the complete Stripe-integrated server
echo "🚀 Starting Freezone Platform with Stripe Integration"
echo "=================================================="
# Check if .env file exists
if [ ! -f ".env" ]; then
echo "❌ .env file not found!"
echo "📋 Please copy .env.example to .env and add your Stripe keys:"
echo " cp .env.example .env"
echo " # Then edit .env with your actual Stripe keys"
exit 1
fi
# Check if Stripe keys are configured
if grep -q "YOUR_ACTUAL" .env; then
echo "⚠️ Warning: .env file contains placeholder values"
echo "📋 Please update .env with your real Stripe API keys from:"
echo " https://dashboard.stripe.com/apikeys"
echo ""
echo "🎭 Running in demo mode (server will still start)..."
echo ""
fi
# Load environment variables
source .env
echo "🔧 Building server with Stripe integration..."
cargo build --bin server --features server
if [ $? -ne 0 ]; then
echo "❌ Build failed! Please check the error messages above."
exit 1
fi
echo "✅ Build successful!"
echo ""
echo "🌐 Starting server on http://${HOST:-127.0.0.1}:${PORT:-8080}"
echo "📊 Health check: http://${HOST:-127.0.0.1}:${PORT:-8080}/api/health"
echo "💳 Payment endpoint: http://${HOST:-127.0.0.1}:${PORT:-8080}/api/company/create-payment-intent"
echo ""
echo "🧪 To test the integration:"
echo " 1. Open http://${HOST:-127.0.0.1}:${PORT:-8080} in your browser"
echo " 2. Navigate to the entities page"
echo " 3. Go through the company registration steps"
echo " 4. In step 4, you'll see Stripe Elements instead of manual form"
echo ""
echo "🔄 Press Ctrl+C to stop the server"
echo "=================================================="
# Run the server
cargo run --bin server --features server