148 lines
3.9 KiB
Bash
Executable File
148 lines
3.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Hotel Pi Project Setup Verification Script
|
|
# Run this to verify all files have been created correctly
|
|
|
|
set -e
|
|
|
|
echo "🏨 Hotel Pi Project Verification"
|
|
echo "================================="
|
|
echo ""
|
|
|
|
# Color codes
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
FILES_OK=0
|
|
FILES_MISSING=0
|
|
|
|
check_file() {
|
|
if [ -f "$1" ]; then
|
|
echo -e "${GREEN}✓${NC} $1"
|
|
((FILES_OK++))
|
|
else
|
|
echo -e "${RED}✗ MISSING${NC} $1"
|
|
((FILES_MISSING++))
|
|
fi
|
|
}
|
|
|
|
check_dir() {
|
|
if [ -d "$1" ]; then
|
|
echo -e "${GREEN}✓${NC} $1/"
|
|
((FILES_OK++))
|
|
else
|
|
echo -e "${RED}✗ MISSING${NC} $1/"
|
|
((FILES_MISSING++))
|
|
fi
|
|
}
|
|
|
|
echo "Checking directories..."
|
|
check_dir "frontend"
|
|
check_dir "control-service"
|
|
check_dir "directus"
|
|
check_dir "scripts"
|
|
check_dir "frontend/src"
|
|
check_dir "frontend/src/components"
|
|
check_dir "frontend/src/lib"
|
|
check_dir "control-service/src"
|
|
|
|
echo ""
|
|
echo "Checking root configuration files..."
|
|
check_file ".env.example"
|
|
check_file ".gitignore"
|
|
check_file "package.json"
|
|
check_file "docker-compose.yml"
|
|
check_file "docker-compose.dev.yml"
|
|
|
|
echo ""
|
|
echo "Checking documentation..."
|
|
check_file "README.md"
|
|
check_file "GETTING_STARTED.md"
|
|
check_file "DEPLOYMENT.md"
|
|
check_file "ARCHITECTURE.md"
|
|
check_file "API.md"
|
|
check_file "QUICK_REFERENCE.md"
|
|
check_file "COMPLETION.md"
|
|
check_file "INDEX.md"
|
|
check_file "BUILD_COMPLETE.md"
|
|
|
|
echo ""
|
|
echo "Checking frontend files..."
|
|
check_file "frontend/package.json"
|
|
check_file "frontend/vite.config.js"
|
|
check_file "frontend/tsconfig.json"
|
|
check_file "frontend/.prettierrc"
|
|
check_file "frontend/index.html"
|
|
check_file "frontend/Dockerfile"
|
|
check_file "frontend/README.md"
|
|
check_file "frontend/src/main.js"
|
|
check_file "frontend/src/App.svelte"
|
|
check_file "frontend/src/components/IdleScreen.svelte"
|
|
check_file "frontend/src/components/HomeScreen.svelte"
|
|
check_file "frontend/src/components/RestaurantsPage.svelte"
|
|
check_file "frontend/src/components/AttractionsPage.svelte"
|
|
check_file "frontend/src/components/Clock.svelte"
|
|
check_file "frontend/src/lib/store.js"
|
|
check_file "frontend/src/lib/api.js"
|
|
check_file "frontend/src/lib/websocket.js"
|
|
check_file "frontend/src/lib/qrcode.js"
|
|
|
|
echo ""
|
|
echo "Checking control service files..."
|
|
check_file "control-service/package.json"
|
|
check_file "control-service/.eslintrc.json"
|
|
check_file "control-service/Dockerfile"
|
|
check_file "control-service/README.md"
|
|
check_file "control-service/src/server.js"
|
|
check_file "control-service/src/cec-handler.js"
|
|
check_file "control-service/src/commands.js"
|
|
|
|
echo ""
|
|
echo "Checking CMS files..."
|
|
check_file "directus/README.md"
|
|
check_file "directus/schema.js"
|
|
check_file "directus/seed-data.sql"
|
|
|
|
echo ""
|
|
echo "Checking scripts..."
|
|
check_file "scripts/launch-kiosk.sh"
|
|
check_file "scripts/launch-plex.sh"
|
|
check_file "scripts/return-to-kiosk.sh"
|
|
check_file "scripts/init-system.sh"
|
|
check_file "scripts/rebuild.sh"
|
|
check_file "scripts/stop.sh"
|
|
check_file "scripts/logs.sh"
|
|
check_file "scripts/control.sh"
|
|
|
|
echo ""
|
|
echo "================================="
|
|
echo -e "${GREEN}✓ Found: $FILES_OK files/directories${NC}"
|
|
if [ $FILES_MISSING -gt 0 ]; then
|
|
echo -e "${RED}✗ Missing: $FILES_MISSING files/directories${NC}"
|
|
else
|
|
echo -e "${GREEN}✓ All files present!${NC}"
|
|
fi
|
|
|
|
echo ""
|
|
echo "Project Statistics:"
|
|
FILE_COUNT=$(find . -type f \( -name "*.js" -o -name "*.svelte" -o -name "*.json" -o -name "*.yml" -o -name "*.md" -o -name "*.sh" \) ! -path "./node_modules/*" ! -path "./.git/*" | wc -l)
|
|
DOC_COUNT=$(find . -name "*.md" -type f | wc -l)
|
|
echo " Total source files: $FILE_COUNT"
|
|
echo " Documentation files: $DOC_COUNT"
|
|
|
|
echo ""
|
|
if [ $FILES_MISSING -eq 0 ]; then
|
|
echo "🎉 Project is complete and ready!"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo " 1. Read README.md"
|
|
echo " 2. Copy .env.example to .env"
|
|
echo " 3. Run: docker-compose up -d"
|
|
echo " 4. Visit: http://localhost:5173"
|
|
exit 0
|
|
else
|
|
echo "❌ Some files are missing. Please check above."
|
|
exit 1
|
|
fi
|