--- title: Idd emoji: 🌍 colorFrom: purple colorTo: indigo sdk: docker pinned: false --- # EL HELAL Studio - FastAPI Backend A headless, production-ready FastAPI backend for AI-powered ID card photo processing. ## Quick Start ``` pip install -r requirements.txt uvicorn main:app --reload ``` Open http://localhost:8000/docs for the interactive Swagger UI. ## Endpoints | Method | Path | Description | |--------|------|-------------| | GET | /status | Check if AI models are loaded | | POST | /upload | Upload an image, returns thumbnail | | POST | /process/{file_id} | Run full AI pipeline | | GET | /settings | Get pipeline settings | | POST | /settings | Update settings | | GET | /frames | List frame overlays | | POST | /frames | Upload a frame | | DELETE | /frames/{filename} | Delete a frame | | POST | /clear-all | Purge all uploads/results | | POST | /backup/export | Export config+assets as ZIP | | POST | /backup/import | Import a backup ZIP | Full endpoint reference: see API_REFERENCE.md. ## Docker ``` docker-compose up --build ``` API will be available at http://localhost:8000. ## Testing The project includes both a mocked unit test suite (runs instantly without loading deep learning models) and a full end-to-end integration test suite. ### 1. Mocked Unit & API Tests Runs without GPU or external model weight downloads: ```bash venv\Scripts\python.exe -m unittest discover -s tests -p "test_*.py" ``` ### 2. End-to-End Integration Tests Requires the local Uvicorn server to be running on port 9000: ```bash venv\Scripts\python.exe test_api.py ``` # i d - m a k e r - 2 Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference # ID-pushed-to-hg