|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# StripeFlow Deployment Verification Script |
| 4 | +set -e |
| 5 | + |
| 6 | +# Colors for output |
| 7 | +RED='\033[0;31m' |
| 8 | +GREEN='\033[0;32m' |
| 9 | +YELLOW='\033[1;33m' |
| 10 | +BLUE='\033[0;34m' |
| 11 | +NC='\033[0m' # No Color |
| 12 | + |
| 13 | +echo -e "${BLUE}🔍 StripeFlow Deployment Verification${NC}" |
| 14 | +echo "==================================" |
| 15 | + |
| 16 | +# Check if we're in the right directory |
| 17 | +if [ ! -f "README.md" ]; then |
| 18 | + echo -e "${RED}❌ Not in StripeFlow directory${NC}" |
| 19 | + exit 1 |
| 20 | +fi |
| 21 | + |
| 22 | +echo -e "${GREEN}✅ In StripeFlow directory${NC}" |
| 23 | + |
| 24 | +# Check if frontend builds successfully |
| 25 | +echo -e "${YELLOW}📦 Verifying frontend build...${NC}" |
| 26 | +cd frontend |
| 27 | + |
| 28 | +if npm run build > /dev/null 2>&1; then |
| 29 | + echo -e "${GREEN}✅ Frontend builds successfully${NC}" |
| 30 | +else |
| 31 | + echo -e "${RED}❌ Frontend build failed${NC}" |
| 32 | + exit 1 |
| 33 | +fi |
| 34 | + |
| 35 | +# Check if dist folder exists and has content |
| 36 | +if [ -d "dist" ] && [ "$(ls -A dist)" ]; then |
| 37 | + echo -e "${GREEN}✅ Build output exists${NC}" |
| 38 | + echo -e "${BLUE} Build size: $(du -sh dist/ | cut -f1)${NC}" |
| 39 | + |
| 40 | + # Check for key files |
| 41 | + if [ -f "dist/index.html" ]; then |
| 42 | + echo -e "${GREEN}✅ index.html exists${NC}" |
| 43 | + else |
| 44 | + echo -e "${RED}❌ index.html missing${NC}" |
| 45 | + fi |
| 46 | + |
| 47 | + if ls dist/assets/*.js > /dev/null 2>&1; then |
| 48 | + echo -e "${GREEN}✅ JavaScript bundles exist${NC}" |
| 49 | + else |
| 50 | + echo -e "${RED}❌ JavaScript bundles missing${NC}" |
| 51 | + fi |
| 52 | + |
| 53 | + if ls dist/assets/*.css > /dev/null 2>&1; then |
| 54 | + echo -e "${GREEN}✅ CSS bundles exist${NC}" |
| 55 | + else |
| 56 | + echo -e "${RED}❌ CSS bundles missing${NC}" |
| 57 | + fi |
| 58 | +else |
| 59 | + echo -e "${RED}❌ Build output missing or empty${NC}" |
| 60 | + exit 1 |
| 61 | +fi |
| 62 | + |
| 63 | +cd .. |
| 64 | + |
| 65 | +# Check if GitHub Pages workflow exists |
| 66 | +echo -e "${YELLOW}🚀 Checking GitHub Pages workflow...${NC}" |
| 67 | +if [ -f ".github/workflows/github-pages.yml" ]; then |
| 68 | + echo -e "${GREEN}✅ GitHub Pages workflow exists${NC}" |
| 69 | +else |
| 70 | + echo -e "${RED}❌ GitHub Pages workflow missing${NC}" |
| 71 | +fi |
| 72 | + |
| 73 | +# Check if all required components exist |
| 74 | +echo -e "${YELLOW}🎨 Checking frontend components...${NC}" |
| 75 | +REQUIRED_FILES=( |
| 76 | + "frontend/src/App.tsx" |
| 77 | + "frontend/src/components/PaymentForm.tsx" |
| 78 | + "frontend/src/components/TransactionHistory.tsx" |
| 79 | + "frontend/src/components/PaymentReceipt.tsx" |
| 80 | + "frontend/src/components/PaymentForm.css" |
| 81 | + "frontend/src/components/TransactionHistory.css" |
| 82 | + "frontend/src/components/PaymentReceipt.css" |
| 83 | +) |
| 84 | + |
| 85 | +for file in "${REQUIRED_FILES[@]}"; do |
| 86 | + if [ -f "$file" ]; then |
| 87 | + echo -e "${GREEN}✅ $file exists${NC}" |
| 88 | + else |
| 89 | + echo -e "${RED}❌ $file missing${NC}" |
| 90 | + fi |
| 91 | +done |
| 92 | + |
| 93 | +# Check package.json for correct dependencies |
| 94 | +echo -e "${YELLOW}📋 Checking dependencies...${NC}" |
| 95 | +cd frontend |
| 96 | +if grep -q '"react"' package.json; then |
| 97 | + echo -e "${GREEN}✅ React dependency found${NC}" |
| 98 | +else |
| 99 | + echo -e "${RED}❌ React dependency missing${NC}" |
| 100 | +fi |
| 101 | + |
| 102 | +if grep -q '"react-dom"' package.json; then |
| 103 | + echo -e "${GREEN}✅ React-DOM dependency found${NC}" |
| 104 | +else |
| 105 | + echo -e "${RED}❌ React-DOM dependency missing${NC}" |
| 106 | +fi |
| 107 | + |
| 108 | +cd .. |
| 109 | + |
| 110 | +# Check if test documentation exists |
| 111 | +echo -e "${YELLOW}📚 Checking documentation...${NC}" |
| 112 | +if [ -f "TEST_CASES.md" ]; then |
| 113 | + echo -e "${GREEN}✅ TEST_CASES.md exists${NC}" |
| 114 | +else |
| 115 | + echo -e "${RED}❌ TEST_CASES.md missing${NC}" |
| 116 | +fi |
| 117 | + |
| 118 | +if [ -f "scripts/test-system.sh" ]; then |
| 119 | + echo -e "${GREEN}✅ Test script exists${NC}" |
| 120 | +else |
| 121 | + echo -e "${RED}❌ Test script missing${NC}" |
| 122 | +fi |
| 123 | + |
| 124 | +# Check if README has test information |
| 125 | +if grep -q "Test Results Summary" README.md; then |
| 126 | + echo -e "${GREEN}✅ README contains test information${NC}" |
| 127 | +else |
| 128 | + echo -e "${RED}❌ README missing test information${NC}" |
| 129 | +fi |
| 130 | + |
| 131 | +# Summary |
| 132 | +echo "" |
| 133 | +echo -e "${GREEN}🎉 Deployment Verification Complete!${NC}" |
| 134 | +echo "==================================" |
| 135 | +echo -e "${BLUE}📊 Summary:${NC}" |
| 136 | +echo "✅ Frontend builds successfully" |
| 137 | +echo "✅ All required components exist" |
| 138 | +echo "✅ Dependencies are correct" |
| 139 | +echo "✅ Documentation is complete" |
| 140 | +echo "✅ GitHub Pages workflow configured" |
| 141 | + |
| 142 | +echo "" |
| 143 | +echo -e "${YELLOW}📝 Next Steps:${NC}" |
| 144 | +echo "1. Check GitHub Actions for deployment status" |
| 145 | +echo "2. Visit: https://atheendre130505.github.io/stripe-flow/" |
| 146 | +echo "3. Test the payment form functionality" |
| 147 | +echo "4. Test the transaction history" |
| 148 | +echo "5. Test the payment receipts" |
| 149 | + |
| 150 | +echo "" |
| 151 | +echo -e "${GREEN}✅ StripeFlow is ready for deployment!${NC}" |
0 commit comments