DiárioLX

The platform behind a digital newspaper.

What
A newsroom backoffice and a public news site
Where
Final project at ISEL, with ESCS and LIACOM
Stack
Kotlin, Spring Boot, React, PostgreSQL, SeaweedFS
When
Presented in July 2026, graded 18/20

TL;DR

  • Architecture React, Kotlin with Spring Boot, PostgreSQL and SeaweedFS, in Docker on one server.
  • Uploads Files go straight to storage with a 15-minute signed link, never through the backend.
  • Workflow Four states and three roles, checked on the server at every step.
  • Security bcrypt, HttpOnly cookies, and a minimum role on every route.
  • CI/CD JUnit on every backend layer on every push, and Playwright on Chromium, Firefox and phone sizes on main and every pull request. The server only pulls ready-made images.
  • Improvements Server rendering, a policy engine for permissions, and a cache that clears itself when an article changes.

Architecture

One server, two Nginx in front. Click a box.

HTTPS
Server (VM)
Docker Compose
/
/api
/media

Nginx · routing

The single way into Docker, so the database and storage are never reachable from outside. It serves the React build, sends /api to Spring Boot and /media straight to storage, applies the cache rules, and serves link previews to social media crawlers.

Only Nginx is exposed. The database and storage never are.

Caching

I set up a basic cache in Nginx, route by route. It only relies on time: each entry simply expires.

PathCached forWhy
/api (bootstrap)neverThe answer depends on who's logged in.
/api/backoffice, /api/authneverPrivate data, and editors must always see the latest version.
/api (public)30 secondsA burst of readers doesn't reach the backend.
/media30 daysA file never changes once it's uploaded.
JS, CSS, fonts, images30 daysBuild files have new names on every build.
/ (the app)revalidatedA new release shows up right away.

Every cached response carries an X-Cache-Status header, so a hit or a miss is easy to see. What it's missing, clearing itself when an article changes, is in Improvements.

Decisions

Why each part is the way it is. Click one.

Platform

Our own platform · over WordPress · Ghost

The project started as a WordPress proof of concept, and it showed its limits in control, customisation and long-term growth. Ghost was closer, but it has no rejection step for contributors, its roles can't be extended, and its frontend is tied to its themes. Building our own put the editorial rules in the code itself.

Frontend

Backend

Data

Media

Infra

Access

Uploads

Files can be up to 2 GB, so they never go through the backend. Step through it:

BrowserSpring BootSeaweedFS

Step 1 of 5

The browser sends only the details: type, accessible description and credits.

media.api.ts
const result = await post<SignedUpload>(endpoints.backoffice.medias.signedUrl.href, {
  altText: media.altText,
  credits: media.credits.map((credit) => ({ userId: credit.userId, role: credit.role })),
  originalFileName: media.file.name,
  mimeType: media.file.type,
  uploadType: media.uploadType
});

Workflow

Pick a role. Every change is checked against the route's minimum role, and contributors are also limited to their own unpublished articles.

  • DraftIn reviewsubmit for reviewAllowed
  • In reviewApprovedapprove, now or on a set dateNot allowed
  • In reviewRejectedreject, with a commentNot allowed
  • RejectedDraftedit and try againAllowed
  • DraftApprovedapprove directlyNot allowed
  • RejectedApprovedapprove directlyNot allowed
  • ApprovedDraftedit a live articleNot allowed
  • Any stateOff the sitearchiveNot allowed

Each role includes the ones below it. Admins also manage the team and the site.

Security

Who can do what is declared on every route, with one annotation.

ActionContributorEditorAdmin
Write and edit drafts✓✓✓
Upload media✓✓✓
Submit for review✓✓✓
Approve, schedule and reject—✓✓
Edit a live article—✓✓
Archive—✓✓
Curate the homepage——✓
Categories and tags——✓
Users, invites and settings——✓

Logins and sessions

NameExpiresHttpOnlySameSite
accessToken10 min✓Strict
refreshToken7 days✓Strict
Both are set at login. No script on the page can read either of them.

Hashed passwords

Passwords are only ever stored as bcrypt hashes.

One refresh

Requests that hit an expired token together share a single refresh.

Single-use reset links

Reset links are long random tokens, and each one works only once.

Hidden backoffice

Its endpoints only appear in the bootstrap after logging in.

CI/CD

CI, on every push and pull request

git pushGitHub ActionsTestsgradle check · Playwright

CD, on each version tag

Three imagesbackend · web + Nginx · PostgreSQL + schemaGitHub registryGHCRServeronly pulls and runs
The server never builds anything. Secrets and data stay on it: secrets in files only it has, data on Docker volumes, so the whole stack can be recreated without losing anything.

What the tests cover

Each layer is tested on its own. JUnit runs on every push, and Playwright on every push to main and every pull request. In CI, a failed Playwright test is retried and leaves a trace to debug.

LayerToolWhat it covers
DomainJUnit 5Article states, publishing and editing rules, invites, value objects.
ServicesJUnit 5Categories, tags and content queries, against a real PostgreSQL, rolled back after each test.
RepositoryJUnit 5 · JDBIUsers, content, tags and categories, against a real PostgreSQL, rolled back after each test.
HTTPWebTestClientFull requests, from logging in to publishing an article.
Public sitePlaywrightHomepage, navigation, articles, listings, search and 404, on Chromium, Firefox and phone sizes.
BackofficePlaywrightSetup, categories and tags. It logs in once and reuses the session.

Details

The API documents itself

@RequireRole(UserRole.CONTRIBUTOR)
@PostMapping(Uris.Media.GET_SIGNED_URL)
@MayReturnSignedUrlOk
@MayReturnUnauthorized
@MayReturnBadRequest
POST/api/backoffice/medias/signed-url
200 OK400 Bad Request401 Unauthorized

The annotations on each route become the OpenAPI docs at /docs, response codes included, so the docs live next to the code they describe.

Routes come from the backend

{
  "api": {
    "auth": { "login": …, "refresh": … },
    "guest": { "homepage": …, "getContent": … },
    "backoffice": null
  }
}

This is what the app receives when it starts. Switch to logged in, and the backoffice routes appear.

Menu without a deploy

From one settings page, admins switch sections on and off, and edit the contacts, social links and the legal details a Portuguese newspaper has to publish. The public site reads it all from the backend, so none of it needs a deploy. Try it.

Blocks as rows

An article is an ordered list of blocks, one row each. Image and video blocks hold a media_id that points to the file and its credits.

Improvements

Where I'd take the project next. Some of these are trade-offs we made on purpose, to keep a final project focused. Others are the natural next steps for a platform meant to be used by a real newsroom. Each card shows where it stands today and where it could go, and "Why?" explains the reasoning.

Server rendering

ThenReact SPA, with Nginx serving link previews to crawlers
NowNext.js
Why?

We chose React, which we already knew well, so the time went into the newsroom's rules. As the project went on, I started thinking about things nobody had asked for. Link previews weren't in the requirements, but as a user I know a newspaper lives on articles shared on WhatsApp and LinkedIn, and a link without a title and an image doesn't get clicked. So I added them: Nginx recognises social media crawlers and sends them to a small page rendered by the backend, with the Open Graph tags. That covers the crawlers we recognise. Full SEO needs every page rendered on the server, so the next step would be a framework like Next.js.

Permissions per person

ThenThree roles with @RequireRole
NowA policy engine, like Casbin
Why?

During the project, we were asked why we weren't using a policy engine for permissions. With three well-defined roles, one annotation per route was the simpler choice. The trade-off is flexibility: letting a single contributor publish would need a new role or a special case in the code. With a policy engine, Casbin for example, it would be one line in a policy.

Lighter media

ThenReaders get the original file
NowResized in a background job
Why?

Today a large photo reaches the reader at full size, even on a phone. Resizing images and pulling video thumbnails in a background job after the upload would make pages lighter, without making the upload itself any slower.

A cache that clears itself

ThenEntries expire after 30 seconds
NowCleared the moment an article changes
Why?

It's a deliberately simple first version: it only relies on time. A published or edited article can take up to 30 seconds to appear. I'd clear it from the backend whenever an article is published or edited, or give editors a button in the backoffice to do it.

Content in two languages

ThenOnly the interface is translated
NowArticles in PT and EN
Why?

The interface already speaks Portuguese and English, from a single translations file. The articles don't: each one exists in one language. The next step is letting an article be written in more than one, and serving each reader the version in their language.