How joacominatel/escaneo-facturas-scratch works
Project type and purpose
• This is a containerized, full-stack invoice-processing system.
• It uses a Next.js frontend, a Flask REST API backend, a Celery worker for asynchronous processing, MariaDB for storage, Redis as broker/cache, and external OCR (Tesseract) plus OpenAI for intelligent data extraction.
File structure
• Top-level directories:
• app/ (Flask application subdivided into api/, core/, models/, services/, tasks/, prompts/, utils/)
• frontend/ (Next.js app with pages, components, hooks, contexts, and lib/)
• migrations/ (Alembic scripts for DB schema)
• docker/ + docker-compose.yml (service definitions and Dockerfiles)
• Patterns & configurations:
• app/api: individual Flask endpoints (invoice upload, list, preview, confirm, retry, download, etc.)
• app/core: configuration, Celery app setup, Flask extensions (CORS, SocketIO)
• app/services & tasks: OCR and OpenAI calls encapsulated in services, Celery task definitions
• WebSocket support via Flask-SocketIO for real-time updates
• Docker Compose orchestrates six services (frontend, backend, worker, mariadb, redis, and optionally a volume or cache)
README for additional insights
• Confirms an asynchronous flow: user→API→queue→worker→DB→WebSocket→frontend
• Lists all major technologies/platforms and service boundaries
• Describes API endpoints and high-level processing steps