Powered by VoxNemesis Read

ForkMyFolio v1.4.x dev diary — one profile, three presentations, stateless DTO caching and load testing

ForkMyFolio started as a multi-user portfolio platform. It has since grown into a genuinely multi-format publishing system: one master profile, three presentations, a hardened auth path, tunable rate limits, stateless shared caching, and a much clearer picture of what this hardware can and cannot do.

A follow-up to Designing a Modern Multi-User Portfolio Platform in Spring Boot. Pairs well with Spring Boot Patterns for Multi-Tenant SaaS and the Shared Identity Layer.

TL;DR

  • One profile, three formats — Online Portfolio, Brief CV and Full CV, each with independent section order and item visibility.
  • Real previews — the public SSR page in an iframe, and real PDFs from the real export pipeline, including unsaved drafts.
  • Cache DTOs, not entities — the final design is stateless, per-user UUID keyed, and shared across replicas in Redis.
  • Closed-loop load tests lie — open-loop constant-arrival testing revealed the real ceiling and a Docker CFS throttling trap.
  • One maintained home — the old split repos are archived; everything lives in the OSS monorepo.
Spring Boot 3 Java Vue 3 Nuxt 4 Redis Keycloak k6

What You’ll Learn

Multi-format profiles

How one master profile serves a website, a short CV and a full CV without a second exporter.

Honest previews

Real SSR iframes and real PDF blobs, with saved and draft state clearly labelled.

Stateless caching

Why JPA entities fail in Redis and DTOs are the correct shared-cache payload.

Load testing

Why open-loop arrival rates matter, and what container CPU caps did to throughput.

Account lifecycle

Restore, hard delete, email change and a logout fix that actually sticks.

One OSS monorepo

Why three repos became one, and what that changed about shipping a release.

The public site, end to end

Before the new work, it is worth seeing what the platform actually renders. The public site is Nuxt 4 server-rendered from one owner profile — no client-side data fetch, no second content store.

Public portfolio home with headline, bio, links and share icons

The home page carries the headline, bio, links and share icons. Everything below it — projects, skills, experience, qualifications and testimonials — is owned content, presented from the same master profile.

Public projects grid with media-aware cards
Public skills page with categories and levels

Projects use media-aware cards and skills render with categories and levels. A visitor contact form feeds the owner’s inbox, and a private portfolio can be shared with a time-limited guest pass when needed.

One profile, three presentations

The big feature in this stretch of work is Phase 1 of the Multi-Format Professional Profile & CV system. One master profile can now be presented as an Online Portfolio, a Brief CV and a Full CV, with independent section inclusion and ordering for each format.

The section keys mirror the existing export preference keys — summary, experience, projects, skills, qualifications, testimonials and contact — so nothing new had to be invented for the data model. Item visibility gained a third state: INCLUDE, EXCLUDE or INHERIT. INHERIT means “use the item’s existing visible flag”, which preserves existing behaviour. The new website flag is ANDed with that existing flag, so a hidden public item can never be forced public by presentation config.

Flyway migration V15 adds two tables — presentation_section_config and presentation_item_visibility. No existing migration from V1 to V14 was edited. Every existing item was explicitly backfilled to INHERIT to avoid primitive-boolean default bugs, and existing PDF and Markdown exports are byte-identical by default when no new config is set.

Existing export settings with Brief Resume and cover letter options, reused by the new presentation formats

The presentation formats reuse those export preferences instead of duplicating them. Export mode and cover-letter settings remain where they always were.

Presentation page, Online Portfolio tab, with independent section order controls

The website format is configured separately from the two CV formats. Changing one never changes another.

Brief CV tab with a shorter, independently reordered section list

In the demo profile, Brief excludes qualifications and testimonials and puts projects before experience. Full CV keeps everything.

Full CV tab with all sections enabled and configured separately

Underneath the section toggles sits the item visibility matrix — the part that makes the formats genuinely independent. Each item can be INCLUDE, EXCLUDE or INHERIT for the website, Brief CV and Full CV separately.

Tri-state item visibility matrix across Website, Brief CV and Full CV

Lesson: extend the pipeline, don’t fork it

The multi-format feature works by extending the existing export pipeline, not by building a second exporter. PUBLIC exports still ignore owner presentation preferences — the privacy rule from the earlier security work stays intact — and backup/restore round-trips the new config additively. Legacy backups without a presentation block restore cleanly.

A preview that tells the truth

A configuration UI is only as good as its preview. The Presentation page now has three tabs and a real preview for each one.

The website preview is the actual public SSR page in an iframe, with a clear “PREVIEW — public view” banner. The Brief and Full previews are real PDFs generated by the real export pipeline, displayed inline from a Blob URL. There is no mock-up and no second rendering path to drift.

Website preview dialog showing the real public SSR page in an iframe with a preview banner
Brief CV preview dialog showing the generated two-page PDF inline
Full CV preview dialog showing the complete generated PDF

POST /api/v1/me/presentation/preview/{format} renders an unsaved draft config without persisting it. GET renders the saved config. Draft previews apply submitted config over saved values, validate enums and section keys, and ignore foreign item UUIDs. The UI labels whether it is showing saved or draft state, so there is no ambiguity about what you are looking at.

Account lifecycle and the admin UX

Admin dashboard with cards for users, settings, statistics, messages, PDF settings and system tools

Admins now have Restore and Hard Delete actions for users. Restore re-enables a soft-deleted account without touching password, roles, slug or portfolio data. Hard Delete sits behind an explicit permanent-delete confirmation and cleans child rows in FK-safe order, with guards against self-delete and deleting the last active admin.

Row actions were restyled into compact icon buttons with distinct icons for view, edit, restore, deactivate and hard delete — confirmation wording stayed unchanged. A project form modal that stayed open when Save was clicked during Bootstrap’s show transition now forces cleanup when hide() no-ops.

The Edit User form’s Email field had always been present but was previously ignored. It is now validated, trimmed and saved. Duplicate emails owned by another account are rejected with 409 instead of a database constraint error, and the account id, password hash, roles, slug and portfolio rows are preserved on change.

Account edit form with the now-working Email field

SSO, sessions and the sticky logout

A second SSO link — “Use a different account” — now sends prompt=login to Keycloak so a different identity can be chosen even with an existing SSO session. The vendor-neutral “Sign in with SSO” label stays, because Google and GitHub are configured as Keycloak Identity Providers: the chooser appears on Keycloak’s login form without adding direct app buttons.

Login page with Sign in with SSO and Use a different account options

Test accounts were consolidated during verification, and duplicate staged accounts were removed once provider linking was confirmed.

The nastier bug was a sticky logout regression: a surviving refresh cookie silently restored the session after logout. Logout now sets a shared marker that blocks silent refresh until the next login.

Reliability fixes worth writing down

PUT /api/v1/me returned HTTP 500 on every account edit. The root cause was a stale @CacheEvict(key = "#currentUser.slug") referencing a parameter removed during an earlier refactor. Spring evaluated the key to null and threw EL1007E before the method body ran. Replacing it with programmatic cache eviction using the loaded user’s real slug fixed it.

Fix What was wrong
Immutable-role merge guard Programmatic Set.of(...) roles threw UnsupportedOperationException during Hibernate merge in the admin update path.
Guest endpoint visibility Two legacy guest qualification/testimonial endpoints did not filter isVisible, leaking hidden content.
BadRequestException mapping An explicit 400 mapping replaced a generic 500.
OAuth2 state cookie Signed cookie replaced Java native deserialization in the earlier rate-limiter hardening pass.
Disabled accounts Rejected on JWT, refresh and guest paths.
Trusted client IP Auth routes rate-limited by client IP; CF-Connecting-IP ignored and only the trusted last XFF hop used.

A private-portfolio cache leak was documented with an owner-facing advisory and remediation steps. We decided not to backport or re-publish old tags — the fix ships in v1.2.11+ and later, and the remedy is to upgrade. The nginx /admin* routing deviation was resolved by blessing the current behaviour in the proxy spec: slugs beginning with admin are reserved.

Lesson: an annotation can be a runtime bomb

A stale SpEL key in a cache annotation failed before the method body ever ran. Programmatic eviction with a real, loaded value is less clever and far easier to reason about.

Rate limits you can actually tune

The six Bucket4j budgets are now environment-configurable through APP_RATELIMIT_* variables. Defaults are unchanged, so behaviour is identical unless explicitly overridden. Non-positive capacity, refill or period values fall back to safe defaults rather than creating zero or unlimited buckets.

The guest public-portfolio budget on staging was raised from 1000/min to 5000/min for load testing. That moved the hard ceiling from roughly 16.7 requests per second to roughly 83 sustained. A 15,060-request public run completed with zero 429 responses.

Configurable limits matter because they let a deployment match the actual capacity of its rack instead of inheriting someone else’s idea of a safe number.

How the caching evolved

Initial per-endpoint profiling found /me at about 190 req/s, /me/settings at 139, /me/skills at 125, and /me/projects at only 74 req/s with p95 latency of 11 seconds. The bottleneck was repeated database reads and DTO mapping on rarely-changing owner data.

Attempt Result
In-process ConcurrentMapCacheManager holding JPA entities Improved DEV numbers, but per-instance state — not stateless.
Redis serialization of JPA entities Failed with LazyInitializationException on lazy relations such as user.roles.
Cache DTOs in shared Redis The final design: stateless, per-user UUID keyed, shared by every backend replica.

com.forkmyfolio.cache.OwnerReadCache lives outside the service layer to respect the ArchUnit NAG-01 rule that forbids DTOs in services. The cached payloads are List<ProjectDto>, List<SkillDto> and List<UserSettingDto>.

Every mutation evicts the affected caches: project create, update and delete; skill add, update and remove; user setting update; global setting update; and backup restore, which bypasses the normal service paths. Per-cache Jackson typing uses DefaultTyping.EVERYTHING so final DTO elements round-trip correctly. The existing publicPortfolios cache configuration was left untouched, preserving the earlier security fix.

Lesson: cache DTOs, not entities

JPA entities carry lazy relationships and persistence context assumptions that do not survive serialization. A DTO is a plain value you can put in Redis, share between replicas and evict with confidence.

Load testing without lying to yourself

The first useful discovery was about the test itself. Closed-loop Virtual User tests self-throttle: when responses slow down, each VU waits, which hides the real server limit. Switching to open-loop constant-arrival-rate tests pushes a fixed request rate regardless of latency. The load generator’s VU cap was raised after we found the generator itself was dropping iterations.

Run Result
DEV, 200 req/s with DTO caching p95 9.7 ms, 0 errors
DEV, 400 req/s with DTO caching p95 8.0 ms, 0 errors
Staging, two concurrent streams 220 req/s aggregate, p95 around 850 ms, 0 errors
Individual staging endpoints Each sustained 200 req/s

We measured individual endpoints rather than trusting a single mixed workload number. Then the rack taught two hardware lessons. Adding a Docker CFS CPU cap to the edge proxy collapsed throughput from about 220 req/s to 46–115 req/s. Increasing staging from 4 vCPU to 8 vCPU on a dual-socket Xeon host made performance worse, likely due to NUMA-crossing on an old E5620 platform.

More container limits are not the answer on this rack. VM placement, socket topology and real CPU capacity matter more than application code.

Full load-test evidence, including raw logs and JSON summaries, is kept in the repository’s load-tests/ folder.

From split repositories to one OSS monorepo

ForkMyFolio used to live across a backend repo, a Vue frontend repo and a private collection of docs and deployment files. That meant version drift, documentation spread across several places, more repos to maintain, and an unclear answer to “where do I report issues?”

Everything now lives in one public OSS monorepo under MIT. One repo means one version number, one git tag per release, one set of Docker images built from one tree, one changelog, and one issue and PR destination.

Directory What it holds
backend/ Spring Boot REST API, PDF/Markdown/vCard generation, auth, Flyway migrations
frontend-admin/ Vue 3 admin dashboard and CMS
frontend-public/ Nuxt 4 server-rendered public portfolio sites
deploy/proxy/ nginx reverse-proxy image and templates
docs/ Feature list, architecture diagrams, assessments
load-tests/ k6 capacity scripts and evidence

The old public repos, ForkMyFolio-backend and ForkMyFolio-frontend, were archived on 2026-11-27, each with a README banner pointing to the monorepo. The private outer workspace still holds project documentation, deployment notes and historical snapshots, but it has no remote and is not a product destination.

The multi-format feature touched backend, admin frontend, public SSR, proxy docs, migrations, tests and deployment docs. In a monorepo all of that shipped as one coherent release instead of coordinating version bumps across three repos. Documentation was updated so every README, agent guide and profile points to the monorepo, and the GitHub profile README was refreshed from the live portfolio data with a cleaner badge set.

Environments, images and live links

Environment Role Access
DEV Local machine under Docker/WSL. Building, UAT, screenshots, browser and load testing. Local only
STAGING Rack VM under owner-managed Portainer, for the owner’s UAT. forkmyfolio-staging.nemesisnet.co.za
PRODUCTION Live users. Owner-only deploys; no agent access without explicit approval. forkmyfolio.nemesisnet.co.za

The live demo portfolio is the public face of all this. Each release publishes four images with the same tag — nemesisguy/forkmyfolio-backend-oss, frontend-oss, nuxt-oss and proxy-oss — for example v1.4.6.

Deployments are file-based Portainer stacks kept in the private audit folder, referencing ${ENV:?} variables so no credentials are ever baked into a repo, image or changelog. Staging has its own Keycloak client in the nemesisnet realm at https://auth.nemesisnet.co.za; the prod client is still pending before prod SSO goes live.

There is a lot more in the platform

The multi-format work was the headline, but a second wave of screenshots makes it clear how much surrounds it. Visitors can send a message straight from a public portfolio, and those messages land in an owner inbox with read, replied, priority and archive controls.

Public contact form on a portfolio page
Owner inbox with read, replied, priority and archive controls

Registration captures a terms version, and a private portfolio can be opened with a time-limited guest pass. Those two paths share the same auth contract as the rest of the app — no separate login system for guests.

Registration form with terms version capture

Behind the scenes there are CRUD screens for experience, qualifications, testimonials and skills, per-user display and PDF settings, Markdown and vCard downloads, an optional analytics provider configuration, and an admin area for platform-wide messages, statistics, settings and system backups.

System backup and restore tools in the admin area

Lesson: features share a spine

Inbox, guest passes, exports, analytics and the tracker all read and write the same owner data through the same API. That is why one coherent monorepo release could carry all of them without a second content store or a second auth path.

Bonus: the job tracker

The earlier backlog included a job application tracker, and it is now a working part of the admin dashboard with statuses, follow-ups and a Kanban board. It is a good example of the monorepo effect: a feature that touches the API, the admin UI and the docs shipped with the same release train as the multi-format work.

Job application tracker in dark mode with readable status cards after the theme fix

The tracker cards had a light/dark mode bug — unreadable text in dark mode — which is now fixed. The grid view below is the corrected dark theme.

Job application tracker cards in light mode after the theme fix

The same cards in light mode, with the same contrast and hierarchy. Card styling is theme-aware rather than tuned once for one mode.

Native drag-and-drop Kanban board view of the job tracker

The board view is native drag-and-drop, not a separate tracker bolted onto the portfolio. Statuses, follow-ups and salary notes all come from the same job application records.

What shipped, release by release

Release What landed
v1.4.0 Admin Restore and Hard Delete; sticky logout fix
v1.4.1 “Use a different account” SSO option using prompt=login
v1.4.2 Admin email change, immutable-role merge guard, compact row actions
v1.4.3 PUT /me HTTP 500 fix from the stale cache key
v1.4.4 Multi-Format Presentations Phase 1 plus configurable rate limits
v1.4.5 First owner-read caching pass, in-process
v1.4.6 Stateless DTO caching in shared Redis

Guard tags v1.0.0 through v1.4.5 were left untouched at each release. Every release had full gate records: backend 523/523 at the latest releases, admin vitest 259/259, public vitest 72/72, Playwright e2e 109 passed and 2 intentionally skipped, ESLint clean on touched files, and clean secret scans. No secrets were committed at any point.

Alongside the code, a formal Phase 0 functionality audit with 14 source-cited findings and a Phase 0 implementation plan with decision labels D1–D9 were published. Implementation stayed gated behind written planning and owner approval.

What’s next

Staging performance needs verification after reverting the VM to 4 vCPU while keeping the extra RAM, then the 110+110 open-loop streams need a re-run to confirm the 220 req/s baseline. Phase 2 of multi-format remains: tags, presets, preset relevance from job applications, per-format item ordering and unsaved website-config preview overrides.

Production deployment stays owner-controlled, and the prod Keycloak client still needs to be created before prod SSO goes live. What is already true is that multi-format is a real working foundation — not a mock-up and not a design doc.

Short takeaway

We shipped a real multi-format CV system by extending the existing export pipeline rather than building a second exporter. We used additive Flyway migrations and explicit backfill to avoid silent data-default bugs. We learned that caching entities is easy but caching DTOs is the correct stateless design, that load-test tooling can lie if the test is closed-loop, and that on old hardware container CPU caps and VM socket topology can matter more than application code.

Most importantly, the public website, existing exports, backup and restore, and the auth contract all stayed unchanged while this landed.

Need a portfolio platform built for real deployment, not a demo?

We build multi-user Spring Boot platforms, Nuxt frontends and the auth, caching and deployment work that makes them safe to run. If you want a system you can actually operate, let’s talk.

Discuss Your Project SaaS / Multi-Tenant Development

Related Reading

Repository: github.com/NemesisGuy/forkmyfolio-oss · Live demo: forkmyfolio.nemesisnet.co.za/nemesis