Personal portfolio built with Next.js 16. Bilingual (EN at /, DE at /de), four switchable designs (Ink, Trace, Flow, Type) with dark/light mode, live GitHub figures, self-hosted via Docker and Traefik.
Next.js 16 (App Router) and TypeScript, Tailwind CSS v4, next-intl, next-themes, MDX (next-mdx-remote), Umami analytics. Bun for tooling, Node 24 at runtime, GitHub Actions to GHCR to Docker behind Traefik.
Requires Bun 1.4+, plus git, Node 22+ and npm for the playground build (see Playground).
bun install
bun dev # http://localhost:3000
bun run build # production build
bun run typecheck
bun run test # unit tests (src, scripts)
bun run test:e2e # runs the standalone server; needs `bun run build` firstdev, build, typecheck and test first run bun run playground:assets.
All optional locally.
| Variable | When | Purpose |
|---|---|---|
GITHUB_TOKEN |
runtime | Live stars, releases and PR counts. Without it the site renders without those numbers. |
RESUME_PDF_URL |
runtime | Direct-download URL for the current resume. Without it /resume.pdf serves the bundled copy. |
DESIGN |
runtime | Default design (keynote, thread, flow or type) when the visitor has not picked one. |
DESIGNS |
runtime | Comma list of the designs offered and served, e.g. keynote,type. Unset means all four. |
GERMAN |
runtime | on publishes German under /de. Unset means English only: /de/... redirects to the English page, no language toggle, no German hreflang or sitemap entries. bun dev and the e2e tests turn it on. |
ARTICLES |
runtime | on publishes the articles. Unset means their routes say "coming soon" and nothing links to them. The e2e tests turn it on. |
GITHUB_GRAPHQL_URL |
runtime | Overrides the GitHub GraphQL endpoint (the e2e tests use a stub). |
NEXT_PUBLIC_UMAMI_URL, NEXT_PUBLIC_UMAMI_WEBSITE_ID |
build | Enable Umami. Docker build args; the URL is the full script URL, e.g. https://analytics.marlonkranz.com/script.js. |
BPMNSCRIPT_DIR |
build, dev | Local BPMNscript checkout to build the playground from. Put it in .env.local. |
BPMNSCRIPT_REPO, BPMNSCRIPT_REF |
build | Override the pinned BPMNscript repo and ref. Also Docker build args. |
| Value | Name | What it is |
|---|---|---|
keynote |
Ink | Paper and ink, with a WebGL ink hero and a faint ink wash behind the page. |
thread |
Trace | A line runs down the page and lights up the content as you scroll. |
flow |
Flow | A three.js scene, dark only; falls back to stills without a GPU or with reduced motion. |
type |
Type | Giant type; you scroll through the letters into the next section. |
Resolution order: visitor cookie, then DESIGN, then the default in src/lib/site-config.ts. Open any URL with ?design=<value> to switch; it sets a one-year cookie and redirects, keeping other parameters such as utm_*. The header toggle switches between the enabled ones (DESIGNS, all four by default); a cookie, ?design= or DESIGN naming a disabled design is ignored. Try one locally with DESIGN=flow bun dev.
English lives at /…, German at /de/…. The URL alone decides; there is no language detection. The toggle links to the same page in the other language.
Pages live in src/app/[locale]/. Everything under (site)/ (home, projects) gets the design's header and footer; /playground sits outside it and has its own header. Unknown URLs, including unknown project slugs, get the designed 404 from src/app/global-not-found.tsx with a real 404 status.
/playground (German: /de/playground) is a BPMNscript editor with live diagram, running the BPMNscript language server and compiler in a browser web worker.
Nothing built is committed. bun run playground:assets builds the worker from the BPMNscript repo and writes it, its licenses and third-party notices, the example files and Monaco's editor worker to public/playground/, and the syntax grammar to src/generated/bpmnscript/. These paths are gitignored: don't edit or commit them.
Where the source comes from:
BPMNSCRIPT_DIRset (e.g.BPMNSCRIPT_DIR=/path/to/bpmnscriptin.env.local): builds that checkout withnpm run build:web. It needsnpm installthere once.- Otherwise: clones the repo and ref pinned in
package.jsonunder"bpmnscript"into.cache/bpmnscript/, and builds it. A tag is built once and reused.BPMNSCRIPT_REPO/BPMNSCRIPT_REFoverride the pin; change the pinned version only inpackage.json.
The worker answers LSP requests plus bpmnscript/compile and bpmnscript/decompile (types in src/lib/playground/protocol.ts). The data-pg-* attributes in src/components/playground/ are the e2e test hooks.
CI and the Docker image fetch the pinned tag from GitHub, so they fail until it exists. The error says what to do. Steps:
- In the BPMNscript repo, push
feat/browser-entryand merge it (git push -u origin feat/browser-entry, thengh pr create --fill). - Do the release commit on
main(version 0.2.0), then tag it:git tag v0.2.0 && git push origin v0.2.0. If you pick another tag, change only"bpmnscript" → "ref"inpackage.json. - Check the image:
docker build -t portfolio-test . && docker run --rm -p 3000:3000 portfolio-test, then openhttp://localhost:3000/playground.
Don't merge this repo to main before step 2.
Everything is in content/{en,de}/; no application code needs to change.
| File | Content |
|---|---|
data/about.json |
Name, intro lines, statement, links |
data/work.json |
Jobs (start/end as YYYY-MM, end: null for current) |
data/education.json |
Schools, status, GPA |
data/bpmnscript.json |
BPMNscript section |
data/dux.json |
Dux section, featured PRs (repo#123), projects |
data/projects.json |
Other projects |
data/contact.json |
Email and links |
data/article-{bpmnscript,dux,devline}.json |
Facts for the three articles (/bpmnscript, /dux, /devline) |
articles/*.mdx |
Article prose |
projects/*.mdx |
Project write-ups; the file name is the URL slug |
Rules:
- Both languages carry the full facts. When you change an id, date, URL, repo, PR ref or number in one language, change it in the other too;
bun run testfails with the JSON path of the first mismatch. - If a German file is missing, the English one is used.
- Repos and PR refs mentioned in content are fetched from GitHub automatically.
panelentries are the expandable details:did(a list) and an optionalsignificantline.- After a claude-devline release, edit
article-devline.json, then runbun scripts/devline-check.ts <path to the claude-devline checkout>; it lists what drifted (exit 1) and what to change. - Never type a number GitHub supplies (stars, PR counts); use the components so it renders without numbers when GitHub is unavailable.
- Company and school logos live in
public/images/logos/; sources and usage notes are indocs/assets.md.
/resume.pdf serves the file at RESUME_PDF_URL (cached for an hour, last good copy kept if the source goes down) and falls back to content/resume.pdf. Copy a fresh PDF over the fallback now and then.
To refresh the GitHub figures in the Typst resume source and recompile:
GITHUB_TOKEN=... bun run resume:figures path/to/resume.typ # or rely on `gh auth login`It writes github-figures.json next to the .typ file and runs typst compile (--no-compile to skip).
bun run build
bun run shots -- --routes /,/projects/minj --locales en,de --label checkNeeds the Playwright Chromium (revision 1228) in ~/.cache/ms-playwright. It screenshots each route in every design, both color modes and desktop/mobile widths, and fails on page errors, failed same-origin requests, horizontal overflow or scroll jank. Jank means any long task or a p95 frame time over budget while scrolling; frames over 50 ms are reported too. See the header of scripts/shots.ts for all flags.
Umami events (section views with dwell time, scroll depth, outbound/resume/email clicks, design, language and color-mode switches) are sent through the typed trackEvent helper in src/lib/analytics.ts. The full event list is in EventMap there; panel_open, panel_close and email_copy are declared but not yet emitted.
Pushing to main runs typecheck and tests, builds the image (which fetches and builds BPMNscript at the pinned tag), pushes it to GHCR and restarts the container on the server over SSH. Pull requests run the checks only.
Under Settings, Secrets and variables, Actions:
| Secret | Value |
|---|---|
DEPLOY_HOST |
Server IP or hostname |
DEPLOY_USER |
SSH user |
DEPLOY_KEY |
Private SSH key (unencrypted) |
DEPLOY_PATH |
Absolute path of the directory with docker-compose.yml on the server |
NEXT_PUBLIC_UMAMI_URL |
Umami script URL, e.g. https://analytics.marlonkranz.com/script.js |
NEXT_PUBLIC_UMAMI_WEBSITE_ID |
Website ID from the Umami dashboard |
One-time steps on the VPS:
-
Install Docker and Compose, and add the deploy public key to
~/.ssh/authorized_keys. -
Add the service to the server's
docker-compose.yml:portfolio: image: ghcr.io/conava/portfolio-website:latest restart: unless-stopped environment: GITHUB_TOKEN: ${PORTFOLIO_GITHUB_TOKEN} RESUME_PDF_URL: ${PORTFOLIO_RESUME_PDF_URL} # DESIGN: keynote # First release: Ink and Type, English only, articles unpublished. Set GERMAN / ARTICLES to "on" to publish. DESIGNS: keynote,type # GERMAN: "on" # ARTICLES: "on" labels: - "traefik.enable=true" - "traefik.http.routers.portfolio.rule=Host(`marlonkranz.com`)" - "traefik.http.routers.portfolio.entrypoints=websecure" - "traefik.http.routers.portfolio.tls.certresolver=letsencrypt" - "traefik.http.services.portfolio.loadbalancer.server.port=3000" networks: - traefik
-
GitHub token. Create a fine-grained personal access token (GitHub, Settings, Developer settings): resource owner = your account, access to public repositories only, no extra permissions. Put it in the server's
.envasPORTFOLIO_GITHUB_TOKEN. The GraphQL search API requires a token even for public data. If the Dux org repos are not visible with it, select that organization as resource owner (it may need to approve the token). -
Resume URL. In Nextcloud, create a public share link of the resume PDF (no password, no expiry). Append
/downloadto the link, givinghttps://<nextcloud-host>/s/<token>/download, and put that in.envasPORTFOLIO_RESUME_PDF_URL. Check withcurl -sIL <url>: it should return200andapplication/pdf. When the file changes in Nextcloud, the site picks it up within an hour. -
Umami version. The Sessions view and the Journey report need a recent Umami release. Check the version in the Umami footer or under Settings; if it is old, back up the PostgreSQL database, bump the image tag in the Umami compose file, then
docker compose pull umami && docker compose up -d umami. -
Apply the env changes:
docker compose up -d portfolio.