MGTEKENINGENSETmichaelgoldman.dev

BLAD 03Projecten

ENNLCV
BLADEN
ENNLCV
BLAD 03 · TEKENINGENREGISTER

DETAILBLAD 03.4 — P-04

Journal

A journal where one AI call turns each entry into a summary, tags, a mood and to-dos — and the entry is still saved if the AI is down. Part 3 of the series: hexagonal architecture and a rich domain model.

REPOSITORY OP GITHUB

JUL 2026 – NOW · DEEL 3 VAN DE SERIE · IN UITVOERING

FIG. 1 — PORTS & ADAPTERS
WebREST adapter · planned
EntryUseCases
Applicationservices · ports in / out
DomainEntry · Tag · Todo
EntryStore · TagStore
PersistenceSpring Data JPA · in progress
EntryEnricher
AISpring AI · planned

SPECIFICATIE

ARCHITECTURE
Hexagonal: domain/model, application/port/in and out, adapter/in/web, adapter/out/persistence and ai. ArchUnit fails the build if a boundary is crossed.
DOMAIN
A rich domain model — Entry, Tag, Todo — whose objects reject invalid state themselves; application services work through ports only.
AI
Planned: one Spring AI call turns an entry into a summary, tags, a mood and to-dos. If the call fails, the entry is still saved (graceful degradation).
PERSISTENCE
In progress: a Spring Data JPA adapter on PostgreSQL 18 with Flyway, MapStruct mapping between the domain and JPA entities.
CONCURRENCY
Optimistic locking on entries: a concurrent edit is detected by a version column and surfaced as a conflict for the user to resolve.
API
Design-first OpenAPI 3.1 contract, written before the code; the planned REST adapter is generated from it.
TESTING
79 tests, written test-first: domain and service unit tests with in-memory fakes, persistence on Testcontainers, ArchUnit on the hexagonal boundaries.