Getting Started

Introduction

Learn about LAREX, a full-stack web application for layout analysis and recognition on facsimiles.

LAREX - Layout Analysis and Recognition

LAREX is a full-stack web application for layout analysis and recognition on facsimiles of early printed books with extra-large pages. The application enables users to annotate documents, correct OCR results, and create ground truth data for machine learning applications.

Architecture Overview

LAREX uses a layered architecture with a Nuxt frontend (including server-side API routes), a Spring Boot backend, and infrastructure services.

┌──────────────────────────┐
│ Browser Client           │
└──────────────┬───────────┘
               │
               ▼
┌──────────────────────────────────────────┐
│ Frontend (Nuxt.js 4)                     │
│ - UI + SSR                               │
│ - BFF routes under /api/*                │
└──────────────┬───────────────────────────┘
               │ (internal service-to-service)
               ▼
┌──────────────────────────┐    ┌──────────────────────────┐
│ Backend (Spring Boot)    │───►│ PostgreSQL               │
└──────────────────────────┘    └──────────────────────────┘
               ▲
               │ OAuth2 / OIDC / JWT
               ▼
┌──────────────────────────┐
│ Keycloak IAM             │
└──────────────────────────┘

Nuxt BFF Pattern

LAREX uses a Backend-for-Frontend pattern in Nuxt:

  • The browser talks to the Nuxt app (same-origin /api/*).
  • Nuxt server routes proxy authenticated requests to the backend using internal service URLs (NUXT_API_BASE_INTERNAL).
  • Access tokens stay in server-side session handling and are forwarded server-to-server.
  • The backend does not need direct browser exposure for normal application usage.

Technology Stack

Frontend

  • Framework: Nuxt.js 4 with Vue.js (client-side rendering)
  • UI Components: Nuxt UI (v4) with Tailwind CSS
  • State Management: Pinia
  • Package Manager: pnpm

Backend

  • Framework: Spring Boot 3.5.5
  • Language: Java 21
  • Database: PostgreSQL with JPA/Hibernate
  • Security: OAuth2 with Keycloak integration

Infrastructure

  • Containerization: Docker & Docker Compose
  • Reverse Proxy: Traefik
  • Identity Provider: Keycloak 26.x
  • Task Runner: Taskfile for monorepo orchestration

Key Features

  • Document Annotation: Create and edit annotations on document facsimiles
  • OCR Correction: Correct and refine OCR results
  • Ground Truth Creation: Generate training data for machine learning
  • Multi-user Support: Collaborative workspaces with Keycloak authentication
  • Undo/Redo System: Command pattern for comprehensive history management
  • Annotation Tools: Region, textline, and baseline annotation workflows with polygon/rectangle drawing modes

Service URLs

ServiceDevelopment URLProduction URL
Frontendhttp://larex.localhosthttps://your-domain.com
Keycloakhttp://keycloak.localhosthttps://auth.your-domain.com
Backend API (direct access, optional)http://api.localhostInternal-only or deployment-specific
Swagger UI (direct access, optional)http://api.localhost/swagger-ui.htmlInternal-only or deployment-specific
Databaselocalhost:5432postgres:5432

Next Steps

Copyright © 2026