Life ConnectLife Connect
Wiki index
Architecture
Services
Concepts
Runbooks
Infra
Swagger Docs
GitHub
Wiki index
Architecture
Services
Concepts
Runbooks
Infra
Swagger Docs
GitHub
  • Backend (Java / Spring Boot)

    • adb
    • adb-persons
    • adb-parts
    • adb-contracts
    • adb-accounting
    • adb-files
    • adb-utilities
    • adb-aggregates
    • adb-views
    • adb-reports
  • Frontend

    • adb-ui
    • adb-web
  • Infrastructure & tooling

    • adb-charts
    • adb-infrastructure
    • adb-tests-artillery
    • adb-doc
  • External services (out-of-monorepo)

    • adb-tickets
    • adb-notes
    • adb-graph
Last updated 2026-05-03

adb-reports

AI-generated content

This document was generated by an AI assistant. Verify accuracy before relying on the details.

Role

PDF document generation service: signed contracts, termination letters, accounting reports, notifications. It combines FreeMarker (HTML templates stored in the database) with iTextPDF (HTML → PDF rendering).

It is the only direct consumer of adb-aggregates: it calls it to fetch consolidated models (contract + persons + parts) and feeds them into the templates.

Tech stack

ItemValue
Spring Boot3.1.3
Java18
Port8090
DatabaseMongoDB Atlas — database adb-reports
AuthKeycloak (resource server)
Reactive stackSpring WebFlux + Reactive MongoDB
PDFiTextPDF v4.0.2 (com.itextpdf:html2pdf)
TemplatingFreeMarker (spring-boot-starter-freemarker)
StorageAWS S3 (BUCKET_TEMPLATES)
TracingMicrometer Tracing (Brave)
Version0.18.0-SNAPSHOT

Depends on the module: adb-aggregates-model (consumed as a Maven dependency for aggregate DTOs).

Internal architecture

flowchart TB
    Client[Client adb-ui<br/>or adb-web]

    subgraph adb-reports
        RC[ReportsController]
        TC[TemplateController]
        TMC[TemplateMetaDataController]
        NGC[NotificationGeneratorController]

        RS[ReportService]
        TS[TemplateService]
        FM[FreeMarker engine]
        IT[iText html2pdf]
    end

    Mongo[(adb-reports<br/>templates,<br/>template_meta_data)]
    S3[(S3 templates)]
    Aggregates[adb-aggregates]
    Contracts[adb-contracts]

    Client -->|GET /reports/contracts/:id| RC
    Client -->|GET /reports/templates| TC

    RC --> RS
    TC --> TS
    TMC --> TS

    RS -->|fetch enriched data| Aggregates
    RS -->|fetch template values| Contracts
    RS --> TS
    TS --> Mongo
    TS --> S3

    RS --> FM
    FM --> IT
    IT -->|PDF bytes| Client

Endpoints

ControllerPathRole
ReportsController/reportsReport generation
TemplateController/reports/templatesTemplate management
TemplateMetaDataController/reports/metadataTemplate metadata
NotificationGeneratorController/notificationsNotification generation

Key endpoints

  • GET /reports/contracts/{contractId} → contract PDF.
  • GET /reports/contracts/{contractId}/resumptionOfLeasePDF → termination PDF.
  • GET /reports/info → module info.

Data model

erDiagram
    TemplateEntity ||--|| TemplateMetaDataEntity : "metadata"

    TemplateEntity {
        string _id
        string name
        string content "HTML + FreeMarker"
        string version
    }
    TemplateMetaDataEntity {
        string _id
        string templateId
        string description
        array variables
    }

Collections: templates, template_meta_data.

Events

None. adb-reports is purely synchronous (consumed on demand).

Inter-service dependencies

flowchart LR
    reports[adb-reports]
    aggregates[adb-aggregates]
    contracts[adb-contracts]

    reports -->|GET /aggregates/contracts/:id| aggregates
    reports -->|GET /contracts/.../templateValues| contracts

    ui[adb-ui] -->|GET /reports/...| reports
    web[adb-web/bff] --> reports

Configuration / deployment

Environment variables

VariableRole
MONGO_DB_URIMongoDB connection string
SECURITY_ISSUER_URI / SECURITY_TOKEN_URIKeycloak
CLIENT_ID / CLIENT_SECRETOAuth2
AWS_REGION / AWS_ACCESS_KEY / AWS_SECRET_KEYAWS
BUCKET_TEMPLATESS3 templates bucket

Helm chart

adb-charts/charts/services/templates/adb-reports.yaml. Image: lifeconnect/adb-reports.

Links

  • Code: adb-reports/
Edit this page
Last Updated:
Contributors: Yevhenii Khudolii
Prev
adb-views