team-24

ADR-001: Split OCR and Recommender into separate services

Date: 2026-06-22
Status: Accepted

Context

The product requires two distinct backend capabilities: extracting text from menu images (OCR using Tesseract) and generating dish recommendations (AI using OpenAI). Both could run in a single FastAPI process, but Tesseract requires system-level packages (tesseract-ocr, tesseract-ocr-rus) that significantly increase the Docker image size and add OS-level installation steps to the build.

Decision

Split the backend into two independently deployed FastAPI services:

The frontend acts as the orchestrator: it calls the OCR service first, receives the structured menu, stores it in localStorage, then calls the Recommender service with the menu data.

Consequences

Positive:

Negative:

Quality requirements addressed