chore: organize project structure and cleanup root directory
- Move all deployment documentation to docs/deployment/ (16 files) - Move all phase documentation to docs/phases/ (9 files) - Move deployment scripts to scripts/ (3 PowerShell scripts) - Remove temporary deployment zip files (5 files) - Remove duplicate documentation files - Create documentation indexes for better navigation - Clean up root directory to essential files only - Update documentation references Root directory reduced from ~50+ files to 20 essential files. All documentation properly organized and indexed.
This commit is contained in:
394
docs/deployment/NEXT_STEPS_COMPLETE.md
Normal file
394
docs/deployment/NEXT_STEPS_COMPLETE.md
Normal file
@@ -0,0 +1,394 @@
|
||||
# 🚀 Complete Next Steps for Full Deployment
|
||||
|
||||
**Date:** November 12, 2025
|
||||
**Status:** Deployment in progress - ensuring all endpoints are fully operational
|
||||
|
||||
---
|
||||
|
||||
## 📋 Current Status
|
||||
|
||||
### ✅ Completed
|
||||
- Infrastructure deployed (all 9 resources)
|
||||
- Function App created and running
|
||||
- Static Web App created (Standard SKU)
|
||||
- Key Vault configured with secrets
|
||||
- Azure AD configured
|
||||
- Environment variables set
|
||||
- Applications built
|
||||
- Monitoring configured
|
||||
|
||||
### ⚠️ In Progress
|
||||
- Frontend deployment to Static Web App
|
||||
- Function App code deployment
|
||||
- Endpoint verification
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Immediate Next Steps
|
||||
|
||||
### Step 1: Deploy Frontend to Static Web App ✅ IN PROGRESS
|
||||
|
||||
**Issue:** Static Web App is showing default Azure page, needs actual application deployment.
|
||||
|
||||
**Solution Options:**
|
||||
|
||||
#### Option A: Use GitHub Actions (Recommended)
|
||||
If you have a GitHub repository connected:
|
||||
1. Push code to GitHub
|
||||
2. Azure will automatically deploy via GitHub Actions
|
||||
3. Check Azure Portal → Static Web App → Deployment Center
|
||||
|
||||
#### Option B: Manual Deployment via Azure Portal
|
||||
1. Go to Azure Portal → Static Web App → Deployment Center
|
||||
2. Upload the `swa-deploy.zip` file
|
||||
3. Or connect to a repository for automatic deployments
|
||||
|
||||
#### Option C: Fix SWA CLI and Deploy
|
||||
```bash
|
||||
# Remove apiRuntime from config (already done)
|
||||
# Try deployment again
|
||||
DEPLOY_TOKEN=$(az staticwebapp secrets list \
|
||||
--name mim-prod-igiay4-web \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--query "properties.apiKey" -o tsv)
|
||||
|
||||
swa deploy ./dist \
|
||||
--env production \
|
||||
--deployment-token $DEPLOY_TOKEN \
|
||||
--no-use-keychain
|
||||
```
|
||||
|
||||
#### Option D: Use Azure CLI REST API
|
||||
```bash
|
||||
# Get deployment token
|
||||
DEPLOY_TOKEN=$(az staticwebapp secrets list \
|
||||
--name mim-prod-igiay4-web \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--query "properties.apiKey" -o tsv)
|
||||
|
||||
# Deploy via REST API
|
||||
curl -X POST \
|
||||
"https://mim-prod-igiay4-web.scm.azurestaticapps.net/api/zipdeploy" \
|
||||
-H "Authorization: Bearer $DEPLOY_TOKEN" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary @swa-deploy.zip
|
||||
```
|
||||
|
||||
### Step 2: Deploy Function App Code ✅ IN PROGRESS
|
||||
|
||||
**Status:** Function App exists but functions may not be deployed.
|
||||
|
||||
**Commands:**
|
||||
```bash
|
||||
# Build API
|
||||
cd api
|
||||
npm run build
|
||||
cd ..
|
||||
|
||||
# Create deployment package
|
||||
cd api/dist
|
||||
zip -r ../../api-func-deploy.zip .
|
||||
cd ../..
|
||||
|
||||
# Deploy to Function App
|
||||
az functionapp deployment source config-zip \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--name mim-prod-igiay4-func \
|
||||
--src api-func-deploy.zip
|
||||
```
|
||||
|
||||
**Verify Functions:**
|
||||
```bash
|
||||
# Check function app status
|
||||
az functionapp show \
|
||||
--name mim-prod-igiay4-func \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--query "{state:state, defaultHostName:defaultHostName}"
|
||||
|
||||
# Test function endpoints
|
||||
curl https://mim-prod-igiay4-func.azurewebsites.net/api/donations
|
||||
```
|
||||
|
||||
### Step 3: Verify All Endpoints
|
||||
|
||||
**Test Commands:**
|
||||
```bash
|
||||
# Static Web App
|
||||
curl -I https://lemon-water-015cb3010.3.azurestaticapps.net
|
||||
curl https://lemon-water-015cb3010.3.azurestaticapps.net | head -20
|
||||
|
||||
# Function App
|
||||
curl -I https://mim-prod-igiay4-func.azurewebsites.net
|
||||
curl https://mim-prod-igiay4-func.azurewebsites.net/api/health
|
||||
|
||||
# API Endpoints (if deployed)
|
||||
curl https://mim-prod-igiay4-func.azurewebsites.net/api/donations
|
||||
```
|
||||
|
||||
**Expected Results:**
|
||||
- Static Web App: Should return your React app HTML (not Azure default page)
|
||||
- Function App: Should return function responses or 404 if no functions
|
||||
- API Endpoints: Should return JSON responses
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Configuration Steps
|
||||
|
||||
### Step 4: Verify Environment Variables
|
||||
|
||||
**Check Static Web App Settings:**
|
||||
```bash
|
||||
az staticwebapp appsettings list \
|
||||
--name mim-prod-igiay4-web \
|
||||
--resource-group rg-miraclesinmotion-prod
|
||||
```
|
||||
|
||||
**Check Function App Settings:**
|
||||
```bash
|
||||
az functionapp config appsettings list \
|
||||
--name mim-prod-igiay4-func \
|
||||
--resource-group rg-miraclesinmotion-prod
|
||||
```
|
||||
|
||||
**Update if needed:**
|
||||
```bash
|
||||
# Static Web App
|
||||
az staticwebapp appsettings set \
|
||||
--name mim-prod-igiay4-web \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--setting-names \
|
||||
"AZURE_CLIENT_ID=c96a96c9-24a2-4c9d-a4fa-286071bf1909" \
|
||||
"AZURE_TENANT_ID=fb97e99d-3e94-4686-bfde-4bf4062e05f3"
|
||||
|
||||
# Function App
|
||||
az functionapp config appsettings set \
|
||||
--name mim-prod-igiay4-func \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--settings \
|
||||
"KEY_VAULT_URL=https://mim-prod-igiay4-kv.vault.azure.net/" \
|
||||
"APPINSIGHTS_INSTRUMENTATIONKEY=4dafce7d-8a34-461f-9148-d005e3d20a6a"
|
||||
```
|
||||
|
||||
### Step 5: Configure CORS (if needed)
|
||||
|
||||
**For Function App:**
|
||||
```bash
|
||||
az functionapp cors add \
|
||||
--name mim-prod-igiay4-func \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--allowed-origins "https://lemon-water-015cb3010.3.azurestaticapps.net"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ☁️ Cloudflare Setup
|
||||
|
||||
### Step 6: Complete Cloudflare Configuration
|
||||
|
||||
**Prerequisites:**
|
||||
- Add Cloudflare credentials to `.env.production`:
|
||||
```
|
||||
CLOUDFLARE_API_TOKEN=your-token
|
||||
CLOUDFLARE_ZONE_ID=your-zone-id
|
||||
```
|
||||
|
||||
**Run Automation:**
|
||||
```bash
|
||||
bash scripts/setup-cloudflare-auto.sh
|
||||
```
|
||||
|
||||
**What it does:**
|
||||
- Configures DNS records (www and apex)
|
||||
- Sets up SSL/TLS (Full mode, Always HTTPS)
|
||||
- Configures security settings
|
||||
- Enables performance optimizations
|
||||
- Adds custom domain to Azure
|
||||
|
||||
---
|
||||
|
||||
## 🌐 Custom Domain Setup
|
||||
|
||||
### Step 7: Configure Custom Domain
|
||||
|
||||
**DNS Configuration:**
|
||||
1. Add CNAME records at your DNS provider:
|
||||
- `www.mim4u.org` → `lemon-water-015cb3010.3.azurestaticapps.net`
|
||||
- `mim4u.org` → `lemon-water-015cb3010.3.azurestaticapps.net`
|
||||
|
||||
**Azure Configuration:**
|
||||
```bash
|
||||
# Add custom domain
|
||||
az staticwebapp hostname set \
|
||||
--name mim-prod-igiay4-web \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--hostname "mim4u.org"
|
||||
|
||||
az staticwebapp hostname set \
|
||||
--name mim-prod-igiay4-web \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--hostname "www.mim4u.org"
|
||||
```
|
||||
|
||||
**Wait for:**
|
||||
- DNS propagation (5-30 minutes)
|
||||
- SSL certificate provisioning (1-24 hours)
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Testing & Verification
|
||||
|
||||
### Step 8: Comprehensive Testing
|
||||
|
||||
**Run Test Script:**
|
||||
```bash
|
||||
bash scripts/test-deployment.sh
|
||||
```
|
||||
|
||||
**Manual Testing:**
|
||||
```bash
|
||||
# Test Static Web App
|
||||
curl -I https://lemon-water-015cb3010.3.azurestaticapps.net
|
||||
curl https://lemon-water-015cb3010.3.azurestaticapps.net | grep -i "miracles"
|
||||
|
||||
# Test Function App
|
||||
curl -I https://mim-prod-igiay4-func.azurewebsites.net
|
||||
curl https://mim-prod-igiay4-func.azurewebsites.net/api/health
|
||||
|
||||
# Test Authentication (if configured)
|
||||
# Open browser: https://lemon-water-015cb3010.3.azurestaticapps.net
|
||||
# Try to sign in
|
||||
```
|
||||
|
||||
**Performance Testing:**
|
||||
```bash
|
||||
# Response times
|
||||
time curl -s -o /dev/null https://lemon-water-015cb3010.3.azurestaticapps.net
|
||||
time curl -s -o /dev/null https://mim-prod-igiay4-func.azurewebsites.net
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📊 Monitoring Setup
|
||||
|
||||
### Step 9: Verify Monitoring
|
||||
|
||||
**Check Application Insights:**
|
||||
```bash
|
||||
# Get connection string
|
||||
az monitor app-insights component show \
|
||||
--app mim-prod-igiay4-appinsights \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--query connectionString -o tsv
|
||||
```
|
||||
|
||||
**View in Portal:**
|
||||
- Application Insights: https://portal.azure.com → Application Insights
|
||||
- Function App Logs: https://portal.azure.com → Function App → Logs
|
||||
- Static Web App Analytics: https://portal.azure.com → Static Web App → Analytics
|
||||
|
||||
**Check Alerts:**
|
||||
```bash
|
||||
az monitor metrics alert list \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--query "[].{name:name, enabled:enabled, condition:condition}"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔐 Security Verification
|
||||
|
||||
### Step 10: Security Checklist
|
||||
|
||||
- [ ] HTTPS enforced (automatic with Static Web App)
|
||||
- [ ] Key Vault secrets not exposed
|
||||
- [ ] CORS configured correctly
|
||||
- [ ] Authentication working
|
||||
- [ ] Environment variables secured
|
||||
- [ ] Monitoring alerts active
|
||||
|
||||
---
|
||||
|
||||
## 📝 Deployment Summary
|
||||
|
||||
### Current Status
|
||||
|
||||
| Component | Status | Action Required |
|
||||
|-----------|--------|----------------|
|
||||
| Infrastructure | ✅ Complete | None |
|
||||
| Static Web App | ⚠️ Needs Deployment | Deploy frontend code |
|
||||
| Function App | ⚠️ Needs Code | Deploy functions |
|
||||
| Configuration | ✅ Complete | Verify settings |
|
||||
| Monitoring | ✅ Complete | Verify alerts |
|
||||
| Cloudflare | ⚠️ Pending | Add credentials |
|
||||
| Custom Domain | ⚠️ Pending | Configure DNS |
|
||||
|
||||
### Priority Actions
|
||||
|
||||
1. **HIGH:** Deploy frontend to Static Web App
|
||||
2. **HIGH:** Deploy Function App code
|
||||
3. **MEDIUM:** Verify all endpoints
|
||||
4. **MEDIUM:** Complete Cloudflare setup
|
||||
5. **LOW:** Configure custom domain
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Quick Reference Commands
|
||||
|
||||
### Deploy Everything
|
||||
```bash
|
||||
# 1. Build
|
||||
npm run build
|
||||
cd api && npm run build && cd ..
|
||||
|
||||
# 2. Deploy Function App
|
||||
cd api/dist
|
||||
zip -r ../../api-func-deploy.zip .
|
||||
cd ../..
|
||||
az functionapp deployment source config-zip \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--name mim-prod-igiay4-func \
|
||||
--src api-func-deploy.zip
|
||||
|
||||
# 3. Deploy Static Web App (choose one method)
|
||||
# Option A: Azure Portal (recommended if SWA CLI fails)
|
||||
# Option B: Fix SWA CLI and deploy
|
||||
# Option C: GitHub Actions (if connected)
|
||||
```
|
||||
|
||||
### Verify Deployment
|
||||
```bash
|
||||
# Test endpoints
|
||||
curl -I https://lemon-water-015cb3010.3.azurestaticapps.net
|
||||
curl -I https://mim-prod-igiay4-func.azurewebsites.net
|
||||
|
||||
# Run tests
|
||||
bash scripts/test-deployment.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
- **Deployment Status:** `DEPLOYMENT_STATUS.md`
|
||||
- **Verification Report:** `DEPLOYMENT_VERIFICATION_REPORT.md`
|
||||
- **Cloudflare Setup:** `CLOUDFLARE_AUTOMATION_COMPLETE.md`
|
||||
- **Custom Domain:** `CUSTOM_DOMAIN_SETUP.md`
|
||||
|
||||
---
|
||||
|
||||
## ✅ Success Criteria
|
||||
|
||||
Deployment is complete when:
|
||||
- [x] All infrastructure resources deployed
|
||||
- [ ] Static Web App shows actual application (not default page)
|
||||
- [ ] Function App has functions deployed and responding
|
||||
- [ ] All endpoints return expected responses
|
||||
- [ ] Authentication working
|
||||
- [ ] Monitoring active
|
||||
- [ ] Cloudflare configured (optional)
|
||||
- [ ] Custom domain working (optional)
|
||||
|
||||
---
|
||||
|
||||
**🎯 Focus on deploying the frontend and Function App code to make all endpoints fully operational!**
|
||||
|
||||
Reference in New Issue
Block a user