Initial commit: AARS backend + frontend + holiday/leave phase 1+2

This commit is contained in:
IT Dog
2026-07-19 20:10:15 +08:00
commit bbc0048c24
49 changed files with 13375 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
#!/bin/bash
# AARS Setup Script
# Run this on VPS to setup the project
set -e
echo "=== AARS Setup Script ==="
echo ""
# Generate JWT secret if not exists
if [ ! -f backend/secret.py ] || grep -q "change-me" backend/secret.py; then
JWT_SECRET="aars-jwt-$(date +%s)-$(head -c 32 /dev/urandom | base64)"
echo "JWT_SECRET=$JWT_SECRET" > backend/secret.py
echo "✅ Generated JWT secret"
else
echo "✅ JWT secret already exists"
fi
# Create data directory
mkdir -p data
chmod 755 data
# Build Docker image
echo ""
echo "=== Building Docker image ==="
docker compose build
echo ""
echo "=== Starting container ==="
docker compose up -d
echo ""
echo "=== Waiting for container to be healthy ==="
sleep 5
# Check health
for i in {1..10}; do
if curl -sf http://localhost:18775/api/auth/me > /dev/null 2>&1; then
echo "✅ Container is healthy!"
break
fi
echo "⏳ Waiting for container... ($i/10)"
sleep 3
done
echo ""
echo "=== Setup Complete! ==="
echo ""
echo "📍 AARS URL: http://187.127.116.15:18775"
echo "👤 Default login: admin@aars.hk / admin123"
echo ""
echo "⚠️ Please change the default password after first login!"