Recipe Box is a local-first mobile app for cataloguing recipes. A recipe can be typed manually or scanned from existing cards, pages, and clippings. Both paths save the same local recipe model.
.NET MAUI is the app shell because this workspace already has MAUI workloads for Windows, iOS, and Android, and MAUI provides first-party camera/photo picking, app-private file storage, native UI, and app store deployment paths. Flutter is not installed locally, and React Native would add a JavaScript/native toolchain before proving the product workflow.
OCR is behind IRecipeTextRecognitionService. OpenAI contextual analysis is behind IRecipeVisionAnalysisService so it does not masquerade as character OCR.
- Android uses Google ML Kit text recognition through
Xamarin.GooglePlayServices.MLKit.Text.Recognition. This keeps recognition on device through Google Play services and does not call a custom backend or require an app API key. Android minimum OS support is API 23 for this binding. - iOS uses Apple Vision
VNRecognizeTextRequestwith accurate recognition and language correction. The iOS target builds in this environment; real-device OCR still needs manual verification on iPhone or iPad hardware. - Windows and other development targets still use
MockRecipeTextRecognitionServiceso desktop builds and parser tests stay deterministic. - DEBUG builds include a development provider selector for On-device OCR, Google Cloud Vision, OpenAI Vision, Google + OpenAI Hybrid, and Mock. Google and OpenAI are direct mobile calls for testing only; do not use direct mobile cloud credentials for production release.
- OpenAI Vision uses the Responses API with image inputs and a strict JSON schema. Local originals are preserved, while separate temporary cloud-upload copies are capped to a 2048-pixel long edge and sent with
detail: originalfor handwriting detail. The default development model isgpt-5.6-terra, configurable in DEBUG settings. - The current OpenAI adapter uses a focused
HttpClientResponses request rather than adding a MAUI dependency on a still-evolving typed Responses SDK surface for image input plus strict structured output. The official .NET SDK remains the preferred future replacement once that surface is stable for the app targets.
src/RecipeBox.Core: models, SQLite repository, OCR/parser/category abstractions, deterministic parser, validation, rollback-safe save workflow, diagnostics contracts.src/RecipeBox.App: .NET MAUI UI, manual recipe editor, scanned recipe review, media picker workflow, app-private image storage, native OCR adapters, diagnostic log file.tests/RecipeBox.Core.Tests: automated tests for parsing, validation, category suggestion, repository behavior, OCR normalization, OCR reading order, save rollback, and image lifecycle.manual-test: manual QA notes for OCR/photo testing. Do not add personal recipe photos to source control.
Recipe
IdTitleSourceCategoryIngredientsInstructionsNotesUnsortedTextUncertainLinesIsFavoriteCreatedAtUpdatedAtImages
RecipeImage
IdRecipeIdLocalStoragePathImageOrderImageSideOrLabelIsDraftCreatedAt
Recipe text is stored in SQLite. Image binary data is copied into app-private local storage and referenced by local path. Newly captured or picked images are stored as drafts first, then promoted to permanent recipe image storage only after the recipe validates and saves. Stale draft images are cleaned on startup after 24 hours.
Image promotion is rollback-safe for new files. Missing draft images fail before a recipe record is saved. If promotion fails partway through, already promoted images are deleted. If database save fails after promotion, newly promoted images are deleted so the app does not leave orphaned permanent files.
This slice lets a user open the app, see an empty recipe list, choose Type Recipe or scan from the camera/photo library, save locally, restart, search, open, edit, and delete recipes.
Manual entry supports title, ingredients, directions, notes, source, and category. Ingredient and direction lines are edited as individual fields so scanned recipes can be corrected one line at a time. Images are optional for manual recipes.
Scanning starts with photo staging. Adding, capturing, replacing, removing, relabeling, or reordering photos does not automatically run OCR or parsing. The user taps Read Recipe when ready. OCR runs, raw recognized text is shown, the initial parser output is filled in, and the user can edit both raw text and structured recipe lines.
The review screen includes Parse Recipe and Read Again. Editing raw OCR text does not rerun parsing until the user taps Parse Recipe. Read Again asks before replacing recognized text and refreshed fields, then reruns the same provider or pipeline that created the draft: Google reruns Google, OpenAI Vision reruns OpenAI Vision, Hybrid reruns Google plus OpenAI, Mock reruns Mock, and On-device reruns on-device OCR.
Saved recipes prioritize reading: title first, subtle category/source metadata beneath it, then a Recipe / Original Card selector. Recipe view shows ingredients, instructions, notes, unsorted text, and unresolved uncertainty. Original Card view shows saved card images with multi-image navigation when images exist. Edit remains available near the title, while Delete is separated from the reading controls and still requires confirmation.
Editing an existing recipe updates the same SQLite record rather than creating a duplicate. Existing original images can be viewed, removed, reordered, relabeled, or supplemented with newly selected/captured images. Deletion removes the recipe plus its saved card image files from local storage after confirmation.
The parser is deterministic. It normalizes OCR line endings from external providers, trusts explicit recipe sections, uses conservative heading-free ingredient-to-instruction transitions, joins obvious wrapped instruction lines, and preserves low-confidence OCR lines for review. Text that cannot be safely placed is preserved as unsorted text instead of being discarded. Temperature, time, and yield can be captured internally, but they are not duplicated into visible notes when they already appear in recipe text.
OpenAI review suggestions are classified before display. Formatting-only changes such as capitalization, punctuation, comma spacing, repeated whitespace, and harmless sentence punctuation are auto-applied without adding review work. Numeric, measurement, unit, fraction, duration, temperature, yield, package-count, uncertainty-marker, and meaningful word changes remain reviewable.
The app intentionally uses one polished light theme. Dark OS mode does not switch the app into dark colors yet; this avoids partial dark-mode behavior such as white text on white fields until a complete dark theme is designed.
Prerequisites:
- .NET 10 SDK.
- .NET MAUI workloads for the target platforms you want to build.
- Windows is the easiest local functional-test target in this workspace.
Restore workloads and packages:
dotnet workload restore
dotnet restore RecipeBox.slnxRun the Windows app:
dotnet run --project src/RecipeBox.App/RecipeBox.App.csproj -f net10.0-windows10.0.19041.0Build Android:
dotnet build src/RecipeBox.App/RecipeBox.App.csproj -f net10.0-androidCreate a debug-only APK for device testing:
dotnet publish src/RecipeBox.App/RecipeBox.App.csproj -f net10.0-android -c Release -p:AndroidPackageFormat=apkThe signed APK is written under:
src/RecipeBox.App/bin/Release/net10.0-android/publish/
The local diagnostic log is written under the app data directory. On this Windows development machine it is:
C:\Users\A1\AppData\Local\User Name\com.recipebox.localfirst\Data\logs\diagnostic.log
dotnet test tests/RecipeBox.Core.Tests/RecipeBox.Core.Tests.csproj
dotnet build src/RecipeBox.App/RecipeBox.App.csproj -f net10.0-windows10.0.19041.0
dotnet build src/RecipeBox.App/RecipeBox.App.csproj -f net10.0-android
dotnet build src/RecipeBox.App/RecipeBox.App.csproj -f net10.0-iosCurrent verified baseline for this workspace:
- Core tests: 114 passing.
- Windows build: passes with 0 warnings.
- Android build: passes with 0 warnings.
- iOS build: passes with 0 warnings for
iossimulator-x64.
Cloud OCR and contextual analysis are available only as development comparison aids. In DEBUG builds, the scan staging page exposes:
- Provider selector: On-device OCR, Google Cloud Vision, OpenAI Vision, Google + OpenAI Hybrid, and Mock.
- SecureStorage-backed development credential fields for Google and OpenAI API keys. If a key cannot be saved securely, the app reports failure and does not write the key to Preferences.
- OpenAI model selector with
gpt-5.6-terra,gpt-5.6-luna, andgpt-5.6-sol. Compare Providers, which runs all five development providers against the same staged images. OCR providers display raw OCR metrics and text. OpenAI and Hybrid display provider, model, duration, title, counts, review-item count, warnings, transcription character count, and transient token counts.Copy Report, which copies the comparison report without API keys, access tokens, or full private paths.
Direct API keys in this app are for local DEBUG experimentation only. Do not commit keys, paste them into source files, include them in screenshots, or use this pattern for a production mobile release.
OpenAI Vision:
- Create or sign in to an OpenAI platform account.
- Create an API key from the OpenAI API keys page: https://platform.openai.com/api-keys.
- Make sure the project/account has access to the selected model.
- In a DEBUG build of Recipe Box, open the scan page, select
OpenAI VisionorGoogle + OpenAI Hybrid, paste the key intoOpenAI API key, choose the model, and tapSave OCR Settings.
Google Cloud Vision:
- Create or select a Google Cloud project.
- Enable billing if the project requires it for Cloud Vision.
- Enable the Cloud Vision API: https://docs.cloud.google.com/vision/docs/setup.
- Create an API key in Google Cloud Console credentials, then restrict it to the Cloud Vision API where practical. Google documents API-key authentication for Vision here: https://docs.cloud.google.com/vision/product-search/docs/auth.
- In a DEBUG build of Recipe Box, open the scan page, select
Google Cloud VisionorGoogle + OpenAI Hybrid, paste the key intoGoogle Cloud Vision API key, and tapSave OCR Settings.
Direct cloud credentials inside a mobile application are temporary for development testing and are not suitable for production release. A production release will require a server-side proxy to protect credentials. The provider resolver and analysis service keep the scan workflow independent from direct cloud calls so that proxy can replace them without changing the user flow.
Google Cloud Vision uses document text detection. OpenAI Vision sends prepared upload copies through the Responses API with strict Structured Outputs. Google + OpenAI Hybrid preserves both Google raw OCR text and OpenAI full transcription in memory for review; if OpenAI fails after Google succeeds, the Google transcription remains available and the deterministic parser output is shown with a warning. Automated tests must not call real cloud services.
OpenAI token usage is captured transiently as input, output, and total token counts for comparison reports and sanitized diagnostics. Usage is not persisted as recipe data, and the app does not hardcode pricing.
Sending recipe images to Google or OpenAI sends those images to cloud providers; use non-private test images unless the user has explicitly accepted that privacy tradeoff.
- Real-device Android and iOS OCR quality still requires manual QA with actual recipe cards.
- Direct API-key use is DEBUG-only and temporary. Production secret handling still requires a server-side proxy or another credential-safe architecture.
- Real-device visual QA is still needed for the platform image-resize path and for actual Android/iOS OCR quality with family recipe cards.
- Cloud provider adapters normalize raw text and warnings into the shared OCR model. Google and OpenAI failures are mapped to sanitized user-facing categories such as disabled API, billing issue, quota/rate limit, timeout, and provider unavailable. Richer provider block/word geometry is not yet surfaced in the UI.
This project intentionally does not include accounts, backend sync, cloud recipe storage, grocery lists, nutrition tracking, social sharing, recipe discovery, or AI recipe generation.