{"id":14977499,"url":"https://github.com/nenadjakic/ocr-studio","last_synced_at":"2026-02-17T06:31:04.925Z","repository":{"id":255908442,"uuid":"743692427","full_name":"nenadjakic/ocr-studio","owner":"nenadjakic","description":"This application is designed for managing OCR (Optical Character Recognition) tasks. It allows users to define, schedule, and execute OCR tasks through a REST API. The core technologies used are Spring Framework, MongoDB, and Tesseract OCR.","archived":false,"fork":false,"pushed_at":"2025-04-12T07:03:08.000Z","size":194,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T04:32:26.667Z","etag":null,"topics":["apache-tika","mongodb","ocr","restful-api","spring-boot","spring-framework","spring-framework-6","tess4j","tesseract"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nenadjakic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-15T19:27:44.000Z","updated_at":"2025-04-12T07:03:12.000Z","dependencies_parsed_at":"2024-09-07T20:08:50.261Z","dependency_job_id":"789063ce-e764-4e82-bd45-5550bddfdcca","html_url":"https://github.com/nenadjakic/ocr-studio","commit_stats":{"total_commits":35,"total_committers":2,"mean_commits":17.5,"dds":0.02857142857142858,"last_synced_commit":"ac58074bd2c9ccc1e48b7af0fa9c919ecb507ad1"},"previous_names":["nenadjakic/ocr-studio"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nenadjakic/ocr-studio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenadjakic%2Focr-studio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenadjakic%2Focr-studio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenadjakic%2Focr-studio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenadjakic%2Focr-studio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nenadjakic","download_url":"https://codeload.github.com/nenadjakic/ocr-studio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenadjakic%2Focr-studio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29535963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T05:00:25.817Z","status":"ssl_error","status_checked_at":"2026-02-17T04:57:16.126Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-tika","mongodb","ocr","restful-api","spring-boot","spring-framework","spring-framework-6","tess4j","tesseract"],"created_at":"2024-09-24T13:55:46.688Z","updated_at":"2026-02-17T06:31:04.907Z","avatar_url":"https://github.com/nenadjakic.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ocr-studio\r\n**Development in progress**\r\n\r\n## Table of Contents\r\n- [Description](#description)\r\n- [Features](#features)\r\n- [Technologies used](#technologies-used)\r\n- [Getting started](#getting-started)\r\n  - [Requirements](#requirements)\r\n  - [Build and run](#build-and-run)\r\n  - [Dockerize Application](#dockerize-application)\r\n    - [Installing Docker and Docker Compose](#installing-docker-and-docker-compose)\r\n    - [Running Application with Docker Compose](#running-application-with-docker-compose)\r\n- [Configuration](#configuration)\r\n  - [MongoDB Configuration](#mongodb-configuration)\r\n  - [File Upload Configuration](#file-upload-configuration)\r\n  - [OCR Configuration](#ocr-configuration)\r\n- [Usage](#usage)\r\n  - [Important REST methods](#important-rest-methods)\r\n    - [Task controller](#task-controller)\r\n    - [Ocr controller](#ocr-controller)\r\n  - [Use cases](#use-cases)\r\n  - [Licence](#license)\r\n\r\n## Description\r\n\r\nThis application is designed for managing OCR (Optical Character Recognition) tasks. It allows users to define, schedule, and execute OCR tasks through a REST API. The core technologies used are Spring Framework, MongoDB, and Tesseract OCR.\r\n\r\n## Features\r\n\r\n- **Task Definition**: Users can create OCR tasks by specifying parameters such as the language, scheduling time, and other options.\r\n- **Document Upload**: Upload the documents that need to be processed as part of the OCR task.\r\n- **Task Scheduling**: Once the task is fully defined, it can be scheduled to run at a specified time.\r\n- **Task Execution**: The application automatically executes the OCR tasks at the scheduled time.\r\n- **Data Storage**:\r\n    - **Tasks**: All task definitions and metadata are stored in a MongoDB database.\r\n    - **Documents**: Uploaded documents are stored on the file system.\r\n\r\n## Technologies used\r\n\r\n- **Spring Framework**: The backbone of the application, used for dependency injection, REST API creation, and overall application management.\r\n- **MongoDB**: A NoSQL database used to store task definitions and execution logs.\r\n- **Tesseract OCR**: An open-source OCR engine used for processing the uploaded documents according to the defined task parameters.\r\n\r\n## Getting Started\r\n\r\n### Requirements\r\n- **Java 21** or higher\r\n- **Gradle** for dependency management\r\n- **MongoDB** instance\r\n- **Tesseract OCR** installed and configured\r\n- **File System** with sufficient storage for document processing\r\n\r\n### Build and run\r\n\r\nTo run this application locally:\r\n\r\n1. Clone the repository.\r\n\r\n``` git clone https://github.com/nenadjakic/ocr-studio.git ```\r\n\r\n2. Navigate to the project directory:\r\n\r\n``` cd ocr-studio ```\r\n\r\n3. Configure the MongoDB connection and file storage paths in the `application.properties` file.\r\n4. Build the project using Gradle.\r\n\r\n``` .\\gradlew clean bootJar ```\r\n\r\n5. Run the application.  \r\n\r\n```  .\\gradlew bootRun ```\r\n\r\n### Dockerize Application\r\n\r\nFollow these steps to dockerize and run your application using Docker and Docker Compose:\r\n\r\n#### Installing Docker and Docker Compose\r\n\r\nBefore dockerizing your application, ensure that Docker and Docker Compose are installed on your machine. If not already installed, you can follow these guides:\r\n\r\n- [Docker Install Guide](https://docs.docker.com/get-docker/)\r\n- [Docker Compose Install Guide](https://docs.docker.com/compose/install/)\r\n\r\n#### Running Application with Docker Compose\r\n\r\nOnce Docker and Docker Compose are installed, you can use Docker Compose to build and run your application in a container:\r\n\r\n``` docker compose up ```\r\n\r\n## Configuration\r\n\r\nThe application can be configured using the following properties, which can be set in the `application.properties` file. These properties allow you to customize the behavior of the application, including database connections, file upload limits, logging levels, and OCR paths.\r\n\r\n### MongoDB Configuration\r\n\r\n- **`spring.data.mongodb.uri`**: The URI for connecting to the MongoDB database.  \r\n  **Example:** `mongodb://localhost:2010/ocr-studio`\r\n\r\n- **`spring.data.mongodb.uuid-representation`**: Defines how UUIDs should be represented in MongoDB. The `standard` value ensures compatibility with most systems.  \r\n  **Default:** `standard`\r\n\r\n### File Upload Configuration\r\n\r\n- **`spring.servlet.multipart.max-file-size`**: Specifies the maximum file size for uploads.  \r\n  **Default:** `1024MB`\r\n\r\n- **`spring.servlet.multipart.max-request-size`**: Specifies the maximum request size, including the file size and any other request data.  \r\n  **Default:** `1024MB`\r\n\r\n### OCR Configuration\r\n\r\n- **`ocr.task-path`**: Specifies the path where OCR tasks are stored or accessed. This path should be configured according to your file storage setup. If not specified tasks directories will be created in working app directory.   \r\n  **Default:**  \r\n\r\n- **`ocr.tesseract.data-path`**: Path to the Tesseract OCR data files, which include language models and other resources. Ensure that this path is correctly set to avoid errors during OCR processing.  \r\n  **Example:** `\\\\\\\\wsl.localhost\\\\Ubuntu-22.04\\\\usr\\\\share\\\\tesseract-ocr\\\\4.00\\\\tessdata`\r\n\r\n## Usage\r\n\r\nThis application is designed to manage OCR (Optical Character Recognition) tasks efficiently. It provides a REST API for defining, scheduling, and executing OCR tasks. Below is a guide on how to use the key features of the application.\r\n\r\n### Important REST methods\r\n\r\n#### Task controller\r\n\u003e  **Retrieve All Tasks**\r\n\u003e \r\n\u003e To get a list of all the tasks you have, use the following endpoint:\r\n\u003e \r\n\u003e **Endpoint**  \r\n\u003e `GET /task`\r\n\u003e \r\n\u003e **Description**  \r\n\u003e Retrieves all tasks from the system.\r\n\r\n\u003e **Create a New Task**\r\n\u003e \r\n\u003e To add a new task, use the following endpoint. You can provide details about the task and upload any necessary files.\r\n\u003e \r\n\u003e **Endpoint**  \r\n\u003e `POST /task`\r\n\u003e \r\n\u003e **Description**  \r\n\u003e Creates a new task based on the provided model. The request should include details of the task and any files you want to upload.\r\n\u003e Application will save task to database, create task's directories. Main directory will be named as task id. Parent of main direcotry will be specifed with property `ocr.task-path`\r\n\u003e \r\n\u003e ***Created directory tree:***\r\n\u003e - `task_id`\r\n\u003e   - `input`\r\n\u003e   - `output`\r\n\u003e\r\n\u003e If files are provided, they will be stored into directory `task_id/input/`\r\n\r\n\u003e **Create a Draft Task**\r\n\u003e\r\n\u003e To create a draft of a task, use the following endpoint. This is useful for setting up tasks that are not yet finalized.\r\n\u003e\r\n\u003e **Endpoint**  \r\n\u003e `POST /task/draft`\r\n\u003e\r\n\u003e **Description**  \r\n\u003e Creates a new draft task based on the provided model. This draft can be reviewed and updated before finalizing.\r\n\u003e\r\n\u003e ***See `POST/task` for created directories.***\r\n\r\n\u003e **Upload Files to a Task**\r\n\u003e\r\n\u003e **Endpoint**  \r\n\u003e `PUT /task/upload/{id}`\r\n\u003e\r\n\u003e **Description**  \r\n\u003e Uploads files for the specified task, defined with `{id}`. This endpoint helps in attaching files.\r\n\r\n### Ocr controller\r\n\r\n\u003e **Get OCR Job Progress**\r\n\u003e \r\n\u003e **Endpoint**  \r\n\u003e `GET /ocr`\r\n\u003e \r\n\u003e **Description**  \r\n\u003e Retrieves the progress of an OCR job for the specified ID. This endpoint allows you to monitor how far along the OCR process is.\r\n\u003e If task is not scheduled yet, application will return progress information from database.\r\n\r\n\u003e **Interrupt OCR Job**\r\n\u003e \r\n\u003e **Endpoint**  \r\n\u003e `PUT /ocr`\r\n\u003e \r\n\u003e **Description**  \r\n\u003e Interrupts the OCR job for the specified task id. Use this endpoint to stop an ongoing OCR process.\r\n\r\n\u003e ##### Schedule OCR Job\r\n\u003e \r\n\u003e **Endpoint**  \r\n\u003e `POST /ocr`\r\n\u003e \r\n\u003e **Description**  \r\n\u003e Schedules an OCR job for the specified task. If the task has a defined start time, the OCR job will begin as soon as possible after that time and when an executor is available. If no start time is defined, the job will be initiated as soon as possible depending on the availability of an executor.\r\n\u003e If task is already scheduled, or if it has wrong status, application will throw error.\r\n\r\n## Use cases\r\n- **User wants to OCR one image with some english text and as output wants pdf document. User wants to do OCR immediately.**\r\n- **User wants to OCR multiple images. User wants to do OCR immediately.**\r\n- **User wants to OCR multipage pdf document, and as output wants pdf document. User wants to start execution at specified time.**\r\n\r\n## License\r\nThis project is licensed under the Apache License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnenadjakic%2Focr-studio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnenadjakic%2Focr-studio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnenadjakic%2Focr-studio/lists"}