Overview
I created an app to view OCR results published by the National Diet Library’s “Next-Generation Digital Library” in an IIIF viewer. The usage instructions are summarized in the following article.
This time, I will explain how to build the above app.
Build Method
Backend
I used AWS. The system was primarily built using SAM (Serverless Application Model).
Creating IIIF Manifests & Curation Lists
The flow for generating IIIF manifests and curation lists reflecting the OCR results published by the Next-Generation Digital Library is as follows.

A key point is that AWS Step Functions was introduced because the processing handled by AWS Lambda took a long time.
Specifically, AWS Lambda handles the conversion of OCR results into IIIF manifests and curation lists, as well as uploading the conversion results to S3, but this exceeded the API Gateway timeout (29 seconds). Therefore, asynchronous processing using Step Functions was adopted, referencing the following article.
https://dev.classmethod.jp/articles/apigateway-stepfunctions-asynchronous/
Building the IIIF Content Search API
Another innovative aspect of this app is the IIIF Content Search API implementation.
https://iiif.io/api/search/1.0/
For this, a simple architecture was adopted as shown below. An AWS Lambda function was created that returns data (strings and coordinate information) corresponding to search terms from the IIIF manifest retrieved from S3.

Frontend
The frontend was developed using Nuxt.js. The source code is available below. It is published using GitHub Pages.
https://github.com/ldasjp8/ndl-ocr-iiif
After executing Step Functions, the status is periodically checked (every 3 seconds), and when it becomes SUCCEEDED, links to Mirador and Curation Viewer (provided by CODH) are displayed.
For Mirador, as shown below, it is configured to display all annotations by default with highlightAllAnnotations: true, and to show annotations in the side panel with defaultSideBarPanel: 'annotations'.
Summary
I am still learning about AWS, but I hope there are parts of this that serve as useful references for others.