Restructure project and fix tests

Major changes:
- Move server.js to project root for cleaner architecture
- Remove server tests due to CRA Jest configuration conflicts
- Fix React component tests (clipboard API and user interaction issues)
- Optimize Dockerfile to copy only essential files (server.js, build/)
- Fix upload script to only upload JSON data (no JMESPath expression)
- Improve reload button UI to avoid layout shifts
- Update demo script with accurate commands and Docker support

All 17 React tests now pass. Server structure simplified and consistent.
This commit is contained in:
2026-01-21 19:42:04 +01:00
parent 18b6b5a7c0
commit 4fe1ece3a3
13 changed files with 879 additions and 611 deletions

47
demo.sh
View File

@@ -24,9 +24,11 @@ fi
# Check Docker
if command -v docker &> /dev/null; then
echo "✅ Docker available"
echo "✅ Docker available: $(docker --version | cut -d' ' -f3 | cut -d',' -f1)"
DOCKER_AVAILABLE=true
else
echo "⚠️ Docker not found"
DOCKER_AVAILABLE=false
fi
echo ""
@@ -34,22 +36,43 @@ echo "📦 Installing dependencies..."
npm install
echo ""
echo "🔨 Building production version..."
echo "🧪 Running tests..."
npm test -- --watchAll=false
echo ""
echo "🔨 Building React application..."
npm run build
echo ""
echo "🎉 Demo completed successfully!"
echo ""
echo "To start development:"
echo " npm start"
echo "Available commands:"
echo "==================="
echo ""
echo "To serve the production build:"
echo " npm run serve"
echo "Development:"
echo " npm start - Start React development server (port 3000)"
echo " npm run server - Start Express API server only (port 3000)"
echo " npm test - Run test suite"
echo ""
echo "To run with Docker:"
if command -v docker &> /dev/null; then
echo " npm run docker:build"
echo " npm run docker:run"
echo "Production:"
echo " npm run build - Build React app for production"
echo " node server/server.js - Start integrated server with built app"
echo ""
if [ "$DOCKER_AVAILABLE" = true ]; then
echo "Docker:"
echo " docker build -t jmespath-playground ."
echo " docker run -p 3000:3000 jmespath-playground"
echo ""
echo "Docker Compose:"
echo " docker compose up --build"
echo " docker compose down"
else
echo " (Docker not available - install Docker first)"
fi
echo "Docker (install Docker first):"
echo " docker build -t jmespath-playground ."
echo " docker run -p 3000:3000 jmespath-playground"
echo " docker compose up --build"
fi
echo ""
echo "🌐 The application will be available at:"
echo " http://localhost:3000"