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.
//api/mediaNginx · 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.
Caching
I set up a basic cache in Nginx, route by route. It only relies on time: each entry simply expires.
| Path | Cached for | Why |
|---|---|---|
/api (bootstrap) | never | The answer depends on who's logged in. |
/api/backoffice, /api/auth | never | Private data, and editors must always see the latest version. |
/api (public) | 30 seconds | A burst of readers doesn't reach the backend. |
/media | 30 days | A file never changes once it's uploaded. |
JS, CSS, fonts, images | 30 days | Build files have new names on every build. |
/ (the app) | revalidated | A 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:
Step 1 of 5
The browser sends only the details: type, accessible description and credits.
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.
| Action | Contributor | Editor | Admin |
|---|---|---|---|
| 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
| Name | Expires | HttpOnly | SameSite |
|---|---|---|---|
accessToken | 10 min | ✓ | Strict |
refreshToken | 7 days | ✓ | Strict |
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
CD, on each version tag
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.
| Layer | Tool | What it covers |
|---|---|---|
| Domain | JUnit 5 | Article states, publishing and editing rules, invites, value objects. |
| Services | JUnit 5 | Categories, tags and content queries, against a real PostgreSQL, rolled back after each test. |
| Repository | JUnit 5 · JDBI | Users, content, tags and categories, against a real PostgreSQL, rolled back after each test. |
| HTTP | WebTestClient | Full requests, from logging in to publishing an article. |
| Public site | Playwright | Homepage, navigation, articles, listings, search and 404, on Chromium, Firefox and phone sizes. |
| Backoffice | Playwright | Setup, 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/api/backoffice/medias/signed-urlThe 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
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
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
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
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
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.