Spaces:
Sleeping
Sleeping
Download run.sh from Coeinterns/bank-statement-api: direct link, hf CLI and curl.
- Browser
- Download file 2.65 kB
-
https://huggingface.co/spaces/Coeinterns/bank-statement-api/resolve/main/run.sh
- Command line
-
hf download hf://spaces/Coeinterns/bank-statement-api/run.sh
-
curl -L -o run.sh https://huggingface.co/spaces/Coeinterns/bank-statement-api/resolve/main/run.sh
2.65 kB
| # π¦ BeFree Bank Statement Processor β Development Quick Start | |
| # Starts both the backend API server and the frontend dev server | |
| set -e | |
| PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| cd "$PROJECT_DIR" | |
| # Colors for output | |
| GREEN='\033[0;32m' | |
| BLUE='\033[0;34m' | |
| YELLOW='\033[1;33m' | |
| RED='\033[0;31m' | |
| NC='\033[0m' | |
| echo -e "${BLUE}" | |
| echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" | |
| echo "β π¦ BeFree Bank Statement Processor β" | |
| echo "β FastAPI Backend + Next.js Frontend β" | |
| echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" | |
| echo -e "${NC}" | |
| # Check Python | |
| echo -e "${YELLOW}[1/4]${NC} Checking Python version..." | |
| python3 --version || python --version | |
| # Setup virtual environment | |
| echo -e "${YELLOW}[2/4]${NC} Setting up Python environment..." | |
| if [ ! -d "venv" ] && [ ! -d ".venv" ]; then | |
| echo -e "${YELLOW}Creating virtual environment...${NC}" | |
| python3 -m venv venv || python -m venv venv | |
| fi | |
| # Activate venv | |
| if [ -d "venv" ]; then | |
| source venv/bin/activate | |
| elif [ -d ".venv" ]; then | |
| source .venv/bin/activate | |
| fi | |
| # Install Python deps | |
| echo -e "${YELLOW}[3/4]${NC} Installing Python dependencies..." | |
| pip install -q fastapi "uvicorn[standard]" python-multipart python-dotenv PyMuPDF openpyxl google-generativeai 2>/dev/null | |
| pip install -q -e shared -e bank-extractor -e "bank-hitl[web]" -e bank-classifier 2>/dev/null | |
| # Install frontend deps | |
| echo -e "${YELLOW}[4/4]${NC} Installing frontend dependencies..." | |
| cd befree-frontend | |
| npm install --silent 2>/dev/null | |
| cd .. | |
| echo -e "${GREEN}β Setup complete!${NC}" | |
| echo "" | |
| # Start backend in background | |
| echo -e "${BLUE}Starting Backend API (port 8000)...${NC}" | |
| python api_server.py & | |
| BACKEND_PID=$! | |
| # Start frontend | |
| echo -e "${BLUE}Starting Frontend (port 3000)...${NC}" | |
| cd befree-frontend | |
| npm run dev & | |
| FRONTEND_PID=$! | |
| cd .. | |
| echo "" | |
| echo -e "${GREEN}π BeFree is running!${NC}" | |
| echo -e " π± Frontend: ${GREEN}http://localhost:3000${NC}" | |
| echo -e " π§ Backend: ${GREEN}http://localhost:8000${NC}" | |
| echo -e " π API Docs: ${GREEN}http://localhost:8000/docs${NC}" | |
| echo "" | |
| echo -e "${YELLOW}Press Ctrl+C to stop both servers${NC}" | |
| # Cleanup on exit | |
| trap "kill $BACKEND_PID $FRONTEND_PID 2>/dev/null; exit" SIGINT SIGTERM | |
| wait | |