translation_app / start.sh
Athena1621's picture
feat: Introduce new backend architecture with notebooks, sources, chat, and CLaRa models, alongside database schema and updated deployment scripts, while removing old frontend, deployment files, and previous backend components.
88f8604
#!/bin/bash
# Antigravity Notebook - Startup Script
# This script starts all services needed for Antigravity Notebook
set -e
echo "======================================"
echo "πŸš€ Antigravity Notebook - Startup"
echo "======================================"
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if .env exists
if [ ! -f .env ]; then
echo -e "${YELLOW}⚠️ .env file not found. Creating from .env.example...${NC}"
cp .env.example .env
echo -e "${GREEN}βœ… Created .env file. You may want to customize it.${NC}"
fi
# Start PostgreSQL
echo ""
echo "πŸ“Š Starting PostgreSQL..."
docker-compose up -d
# Wait for PostgreSQL to be ready
echo "⏳ Waiting for PostgreSQL to be ready..."
sleep 5
# Check if database is initialized
echo ""
echo "πŸ”§ Initializing database..."
python -m backend.database
# Start backend in background
echo ""
echo "πŸ–₯️ Starting FastAPI backend..."
echo " (API will be available at http://localhost:8000)"
python -m backend.main &
BACKEND_PID=$!
# Wait for backend to start
sleep 10
# Start frontend
echo ""
echo "🎨 Starting Streamlit frontend..."
echo " (UI will be available at http://localhost:8501)"
streamlit run frontend/app_notebook.py &
FRONTEND_PID=$!
echo ""
echo "======================================"
echo -e "${GREEN}βœ… Antigravity Notebook is running!${NC}"
echo "======================================"
echo ""
echo "πŸ“ Services:"
echo " β€’ Frontend UI: http://localhost:8501"
echo " β€’ Backend API: http://localhost:8000"
echo " β€’ API Docs: http://localhost:8000/docs"
echo ""
echo "Press Ctrl+C to stop all services"
echo ""
# Function to cleanup on exit
cleanup() {
echo ""
echo "πŸ›‘ Stopping services..."
kill $BACKEND_PID 2>/dev/null || true
kill $FRONTEND_PID 2>/dev/null || true
docker-compose down
echo "βœ… All services stopped"
exit 0
}
# Trap Ctrl+C and call cleanup
trap cleanup INT TERM
# Wait for processes
wait