OCR is a full-stack application that ingests PDF documents, runs them through an asynchronous OCR pipeline, and delivers structured archives back to the user.
Production app: ocr.tuturu.io
- Authenticated document upload
- Process creation and live status tracking
- PDF split into pages
- OCR transcription on generated page images
- Post-processing and downloadable archive delivery
- Backend metrics endpoint for observability
The repository is a pnpm monorepo split into a few clear areas:
apps/frontend: React, Vite, TanStack Router UIapps/backend: Node.js, TypeScript, tRPC API and metrics endpointworkers/*: queue-driven pipeline workers for splitting, transcription, post-processing, and cleanuppackages/*: shared business services, infra utilities, and common typesdb: Drizzle schema, migrations, and database toolingmonitoring: Grafana dashboard and Prometheus scrape notesdoc: RFC notes and generated OpenAPI document
- Frontend: React, TypeScript, Vite, TanStack Router, Radix UI
- Backend: Node.js, TypeScript, tRPC
- Database: PostgreSQL with Drizzle ORM
- Messaging and cache: RabbitMQ, Redis
- Object storage: MinIO / S3-compatible storage
- Tooling:
pnpm, Biome, Docker Compose
- A user uploads a PDF from the frontend.
- The backend creates a process and stores the source file.
- A split worker turns the PDF into page images.
- OCR workers transcribe the pages.
- A post-processing worker assembles the final result.
- The frontend receives live process updates and exposes download actions when the run is complete.
Install dependencies:
pnpm installPrepare environment variables from one of the provided templates:
.env.exemplefor local development.env.docker.examplefor Docker-based runs
FRONTEND_ALLOWED_HOSTS can be used to add extra hostnames accepted by vite preview in the frontend container. Use a comma-separated list when internal probes or reverse proxies access the frontend with hostnames that differ from localhost or BETTER_AUTH_URL.
Start local infrastructure:
docker compose up -dRun the full app in development mode:
pnpm devpnpm dev first builds the runtime packages, then starts the backend, frontend, and all workers concurrently.
pnpm dev
pnpm build
pnpm lint
pnpm db:generate
pnpm db:migrate
pnpm scripts:generate-openapi
pnpm scripts:serve-openapiDevelopment infrastructure is defined in docker-compose.yaml.
Production services are defined in docker-compose.prod.yaml:
docker compose -f docker-compose.prod.yaml up -d --buildMain exposed production ports:
- Backend:
4010 - PostgreSQL:
5436 - Redis:
6380 - RabbitMQ:
5673 - MinIO API:
9002
Current deployment note: the production compose file does not include the frontend service.
- Monitoring guide:
monitoring/README.md - Grafana dashboard:
monitoring/grafana/dashboards/ocr-observability.json - OpenAPI artifact:
doc/openapi.json - Project notes:
doc/rfc.md
The backend metrics endpoint is exposed on /metrics.
The frontend also exposes /metrics; if it is served through vite preview, make sure the probe hostname is allowed through FRONTEND_ALLOWED_HOSTS when needed.
This project is licensed under the ISC License.