Files
roa2web-service-auto/status.sh
Marius Mutu c5e051ad80 feat: Migrate to ultrathin monolith architecture
Consolidate 3 separate applications (reports-app, data-entry-app, telegram-bot) into a unified
architecture with single backend and frontend:

Backend Changes:
- Unified FastAPI backend at backend/ with modular structure
- Modules: reports, data_entry, telegram in backend/modules/
- Centralized config.py and main.py with all routers registered
- Single worker mode (--workers 1) for Telegram bot compatibility
- Shared Oracle connection pool and JWT authentication
- Unified requirements.txt and environment configuration

Frontend Changes:
- Single Vue.js SPA with module-based routing
- Unified frontend at src/ with modules in src/modules/{reports,data-entry}/
- Shared components and stores in src/shared/
- Error boundaries for module isolation
- Dual API proxy in Vite for module communication

Infrastructure:
- New unified startup scripts: start-prod.sh, start-test.sh, start-backend.sh
- Environment templates: .env.dev.example, .env.test.example, .env.prod.example
- Updated deployment scripts for Windows IIS
- Simplified SSH tunnel management

Documentation:
- Comprehensive CLAUDE.md with architecture overview
- Module-specific docs in docs/{data-entry,telegram}/
- Architecture decision records in docs/ARCHITECTURE-DECISIONS.md
- Deployment guides consolidated in deployment/windows/docs/

This migration reduces complexity, improves maintainability, and enables easier
deployment while maintaining all existing functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 23:48:14 +02:00

107 lines
3.6 KiB
Bash

#!/bin/bash
# ROA2WEB Ultrathin Monolith - Services Status Overview
# Shows status of unified backend and frontend
# Script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Source helper functions
source "$SCRIPT_DIR/scripts/service-helpers.sh"
print_header "ROA2WEB Ultrathin Monolith - Services Status"
# SSH Tunnel check
echo -e "${BLUE}━━━ Infrastructure ━━━${NC}"
if check_service_status 1526 "SSH Tunnel (Oracle)"; then
:
else
print_warning "SSH Tunnel not running - Oracle DB connection will fail"
print_info "Start with: ./ssh-tunnel-prod.sh start (or ./ssh-tunnel-test.sh start for TEST)"
fi
echo ""
# Unified Backend
echo -e "${BLUE}━━━ Unified Backend (port 8000) ━━━${NC}"
if check_service_status 8000 "Unified Backend"; then
# Try health check
echo -e "${CYAN}Health check:${NC}"
health=$(curl -s http://localhost:8000/health 2>&1)
if echo "$health" | grep -q "api"; then
echo "$health" | python3 -m json.tool 2>/dev/null || echo "$health"
print_success "Backend is healthy"
else
print_warning "Health check: Not responding properly"
echo "$health"
fi
# Show module status
echo ""
echo -e "${CYAN}Modules:${NC}"
echo " • Reports API: http://localhost:8000/api/reports/*"
echo " • Data Entry API: http://localhost:8000/api/data-entry/*"
echo " • Telegram API: http://localhost:8000/api/telegram/*"
echo " • Telegram Bot: Running as background task"
else
print_info "Start with: ./start-prod.sh (or ./start-test.sh for TEST)"
fi
echo ""
# Frontend
echo -e "${BLUE}━━━ Frontend Unified ━━━${NC}"
if check_service_status 3000 "Frontend Unified"; then
print_info "Access at: http://localhost:3000"
else
print_info "Start with: ./start-prod.sh (or ./start-test.sh for TEST)"
fi
echo ""
# Log files summary
print_header "Log Files"
echo -e "${BLUE}Recent logs (last modified):${NC}"
ls -lht /tmp/unified_backend*.log /tmp/unified_frontend*.log 2>/dev/null | head -10 || print_warning "No log files found"
echo ""
# Quick stats
print_header "Quick Stats"
running_count=0
for port in 1526 8000 3000; do
if netstat -tuln 2>/dev/null | grep -q ":${port} " || ss -tuln 2>/dev/null | grep -q ":${port} "; then
running_count=$((running_count + 1))
fi
done
echo -e "${BLUE}Services running: ${GREEN}${running_count}/3${NC}"
if [ $running_count -eq 3 ]; then
print_success "All services are running!"
elif [ $running_count -ge 2 ]; then
print_warning "Some services are not running"
else
print_error "Most services are offline"
fi
echo ""
# Helpful commands
echo -e "${BLUE}━━━ Helpful Commands ━━━${NC}"
echo " ./status.sh # Show this status"
echo " ./start-prod.sh # Start all services (PROD)"
echo " ./start-test.sh # Start all services (TEST)"
echo " ./start-prod.sh stop # Stop all services"
echo " ./start-backend.sh status # Detailed backend status"
echo " ./start-backend.sh restart # Restart backend only"
echo " ./start-frontend.sh restart # Restart frontend (quick!)"
echo " tail -f /tmp/unified_backend_prod.log # Watch backend logs (PROD)"
echo " tail -f /tmp/unified_backend_test.log # Watch backend logs (TEST)"
echo " tail -f /tmp/unified_frontend_prod.log # Watch frontend logs (PROD)"
echo ""
# API Documentation links
echo -e "${BLUE}━━━ API Documentation ━━━${NC}"
if check_service_status 8000 ""; then
echo " • Unified API Docs: http://localhost:8000/docs"
echo " • Health Endpoint: http://localhost:8000/health"
echo " • Root Endpoint: http://localhost:8000/"
else
echo " (Backend not running)"
fi
echo ""