Files
CurrenciCombo/scripts/fix-frontend.sh
defiQUG 3dc8592b83 docs: Update CHANGELOG and README for deployment models and troubleshooting
- Added multi-platform deployment architecture details (Web App, PWA, DApp) to README.md.
- Included comprehensive troubleshooting guides and fix scripts in README.md.
- Enhanced CHANGELOG.md with new features, fixes, and improvements, including TypeScript error resolutions and updated documentation structure.
- Revised development setup instructions in DEV_SETUP.md to reflect changes in script usage and environment variable setup.
2025-11-06 08:09:54 -08:00

63 lines
1.5 KiB
Bash
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Frontend Fix Script
echo -e "\n========================================"
echo -e " FRONTEND FIX SCRIPT"
echo -e "========================================\n"
# Step 1: Stop existing webapp
echo -e "1. Stopping existing webapp..."
if lsof -ti:3000 > /dev/null 2>&1; then
kill $(lsof -ti:3000) 2>/dev/null
echo -e " ✅ Stopped webapp process"
sleep 2
else
echo -e " No webapp process running on port 3000"
fi
# Step 2: Clear Next.js cache
echo -e "\n2. Clearing Next.js cache..."
cd webapp || exit 1
if [ -d ".next" ]; then
rm -rf .next
echo -e " ✅ Cleared .next cache"
else
echo -e " No cache to clear"
fi
# Step 3: Check/Create .env.local
echo -e "\n3. Checking environment variables..."
if [ ! -f ".env.local" ]; then
cat > .env.local << EOF
NEXT_PUBLIC_ORCH_URL=http://localhost:8080
NEXTAUTH_SECRET=dev-secret-change-in-production-min-32-chars
EOF
echo -e " ✅ Created .env.local"
else
echo -e " ✅ .env.local exists"
fi
# Step 4: Verify dependencies
echo -e "\n4. Checking dependencies..."
if [ ! -d "node_modules" ]; then
echo -e " ⚠️ node_modules not found. Installing..."
npm install
else
echo -e " ✅ Dependencies installed"
fi
# Step 5: Start webapp
echo -e "\n5. Starting webapp..."
echo -e " Starting in background..."
npm run dev &
WEBAPP_PID=$!
echo -e "\n✅ Webapp starting! (PID: $WEBAPP_PID)"
echo -e " Wait 10-15 seconds for Next.js to compile"
echo -e " Then open: http://localhost:3000"
echo -e " To stop: kill $WEBAPP_PID"
echo ""
cd ..