Spaces:
Configuration error
Configuration error
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
| # 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 | |