--- title: QuickTools emoji: 📸 colorFrom: blue colorTo: green sdk: docker pinned: false app_port: 7860 --- # Visa Photo Maker A professional, multilingual, privacy-first web application for generating standard visa and passport photos. ## Features - **AI-Powered**: Automatic background removal and biometric cropping. - **Privacy-First**: RAM-only processing, zero disk storage for user images. - **Multilingual**: Supports ZH, EN, ES, FR, JA, KO. - **Global Standards**: Supports US, EU, UK, China, Japan, Korea, Australia, Canada. - **SEO Optimized**: Pre-rendered routes and Schema.org integration. ## Tech Stack - **Frontend**: Next.js 15+, Tailwind CSS, TypeScript. - **Backend**: FastAPI (Python 3.12), Rembg, Pillow, NumPy. - **DevOps**: PM2 for process management. ## Getting Started ### Backend 1. `cd backend` 2. `python -m venv venv` 3. `source venv/bin/activate` 4. `pip install -r requirements.txt` 5. `python main.py` (Runs on port 13002) ### Frontend 1. `cd frontend` 2. `npm install` 3. `npm run dev` (Runs on port 3000 in dev, 13001 in production) ## Monitoring & Maintenance We use a watchdog script to ensure services stay online. - **Port Checker**: `./check_ports.sh` scans for active services. - **Auto-Recovery**: `scripts/watchdog.sh` (Runs via cron every minute). - **Guide**: See [docs/MONITORING.md](docs/MONITORING.md) for setup instructions. ## Testing ### Backend Unit Tests We use `pytest` to ensure image processing and API logic remain correct. ```bash cd backend venv/bin/pytest test_main.py ``` ## Deployment 1. Run the safe deployment script: ```bash ./deploy.sh ``` (This script automatically runs unit tests before building and reloading.) Processes are managed by PM2: ```bash pm2 list pm2 restart visa-backend pm2 restart visa-frontend ``` ## License MIT