# API Deployment Instructions ## Current Status - ✅ **React App**: Fully deployed at https://cg-bct-2b68d--staging-u50c45fo.web.app - ⚠️ **API Functions**: Need APIs to be enabled (in progress) ## Issue: Google Cloud APIs Still Enabling After upgrading to Blaze plan, these APIs need to be enabled: - `cloudfunctions.googleapis.com` - `cloudbuild.googleapis.com` - `artifactregistry.googleapis.com` ## Solution Options ### Option 1: Manual API Activation (Recommended) 1. Visit [Google Cloud Console](https://console.cloud.google.com/apis/library?project=cg-bct-2b68d) 2. Search for and enable these APIs: - **Cloud Functions API** - **Cloud Build API** - **Artifact Registry API** 3. Wait 2-3 minutes for activation 4. Run: `firebase deploy --only functions` ### Option 2: Firebase Console Method 1. Go to [Firebase Console](https://console.firebase.google.com/project/cg-bct-2b68d/functions) 2. Click "Get Started" on Functions tab 3. This will automatically enable required APIs 4. Run: `firebase deploy --only functions` ### Option 3: Wait and Retry APIs may still be enabling in background: ```bash # Try every 5 minutes until it works firebase deploy --only functions ``` ## After Functions Deploy Successfully Your API endpoints will be available at: - `GET /api/health` - Health check - `POST /api/tickets/verify` - Ticket verification - `POST /api/checkout/create` - Stripe checkout - `POST /api/stripe/connect/start` - Stripe Connect - `GET /api/stripe/connect/status` - Connection status ## Test Commands ```bash # Health check curl https://cg-bct-2b68d--staging-u50c45fo.web.app/api/health # Ticket verification (mock) curl -X POST https://cg-bct-2b68d--staging-u50c45fo.web.app/api/tickets/verify \ -H "Content-Type: application/json" \ -d '{"qr":"test-qr-code"}' ``` ## Deploy to Production Once functions work on staging: ```bash firebase deploy --only hosting,functions # Deploy to main site ``` Your production URLs will be: - **App**: https://cg-bct-2b68d.web.app - **API**: https://cg-bct-2b68d.web.app/api/* The React app is already 100% functional - the API will complete the full experience!