Files
motovaultpro/backend/src/features/ocr/CLAUDE.md
Eric Gullickson f590421058 chore: remove NHTSA code and update documentation (refs #227)
Delete vehicles/external/nhtsa/ directory (3 files), remove VPICVariable
and VPICResponse from platform models. Update all documentation to
reflect Gemini VIN decode via OCR service architecture.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:51:38 -06:00

2.4 KiB

ocr/

Backend proxy for the Python OCR microservice. Handles authentication, tier gating, file validation, and request forwarding for VIN extraction, fuel receipt scanning, and maintenance manual extraction.

Files

File What When to read
README.md Feature documentation with architecture diagrams Understanding OCR proxy, data flows
index.ts Feature barrel export Importing OCR services

Subdirectories

Directory What When to read
api/ HTTP endpoints, routes, request validation API changes, adding endpoints
domain/ Business logic, TypeScript types Core OCR proxy logic, type definitions
external/ HTTP client to Python OCR service OCR service integration, error handling
tests/ Unit tests for receipt and manual extraction Test changes, adding test coverage

api/

File What When to read
ocr.controller.ts Request handlers for all OCR endpoints (extract, extractVin, extractReceipt, extractManual, submitJob, getJobStatus) Adding/modifying endpoint behavior
ocr.routes.ts Fastify route registration with auth and tier guard preHandlers Route configuration, middleware changes
ocr.validation.ts Request/response type definitions for route schemas Changing request/response shapes

domain/

File What When to read
ocr.service.ts Business logic layer: file validation, size limits (10MB sync, 200MB async), content type checks, service delegation Core logic changes, validation rules
ocr.types.ts TypeScript types: OcrResponse, VinExtractionResponse, ReceiptExtractionResponse, ManualExtractionResult, JobResponse, ManualJobResponse Type changes, adding new response shapes

external/

File What When to read
ocr-client.ts HTTP client to mvp-ocr Python service (extract, extractVin, extractReceipt, decodeVin, submitJob, submitManualJob, getJobStatus, isHealthy) OCR service communication, error handling

tests/

File What When to read
unit/ocr-receipt.test.ts Receipt extraction tests with mock client Receipt flow changes
unit/ocr-manual.test.ts Manual PDF extraction tests Manual extraction flow changes