This api takes in an image, analyzes it's content with OCR, then saves an original and a copy with the embedded text information.
It uses tesseract.js
.
Rename .env.template to .env and change the relevant data.
npm install
npm run dev
*no testing yet*
The REST API to the example app is described below.
GET /api/ocr/upload
curl -H 'Accept: application/json' -H 'x-api-key: my_api_key' http://localhost:8000/api/ocr/upload
Ocr upload api feeling fine and dandy
POST /api/ocr/upload
curl --location --request POST 'http://localhost:8000/api/ocr/upload' \
--header 'x-api-key: my_api_key' \
--form 'image=@"/Users/nytoair/Downloads/Egresos/test pic.jpeg"'
{
"uuid": "uuid",
"text": "text"
}
For local development:
docker compose up
For production you can find files under the docker-prod dir. Don't forget to create your own .env file inside the same dir.
- Docker compose
- Ocr to pdf
- Easy ssl setup with caddy
- Reverse proxy option with traefik
- Ocr orientation auto-detect not working.
- traineddata lost whenever image is mounted again.
- Healthcheck not done.