FelpsXP Hub
This site: a portfolio rebuilt from scratch in a public repository, with no database and no sign-in, every decision recorded as an ADR and security and tests running on every pull request.
Problem
The previous Hub lived inside a private monorepo, coupled to the platform’s authentication and database. The portfolio could not be shown as code, and a public page depended on infrastructure it did not need.
Solution
Start again in a public, standalone repository instead of extracting the old history (ADR-0002). Content is typed TypeScript validated with Zod at build time, pages in Portuguese and English were prerendered and served from the CDN until the strict CSP required a per-request nonce (ADR-0009), and v1 has no database and no authentication, because no public page needs them (ADR-0003).
Architecture highlights
- No database and no sign-in, so there is no visitor data to leak; pages come from typed content, in both languages
- Zod schemas as the single source of truth: TypeScript types are inferred from them, and the build fails naming the record and field when something is wrong, including links that are not HTTPS
- Security headers from the first commit: a CSP without unsafe-eval in production, frame-ancestors none, nosniff and a strict Referrer-Policy; a Secure, SameSite locale cookie
- Light and dark themes without a flash, through an inline script that accepts only two values and carries each request’s nonce
- A strict CSP with a per-request nonce and strict-dynamic, without unsafe-inline, in report-only mode until it runs clean in production (ADR-0009)
- Language as a route segment, with hreflang, a canonical URL on the production domain, a sitemap with alternates and a share image generated at build time
- Every decision that is costly to reverse becomes an ADR before code; small squash-merged PRs; CI with gitleaks, lint, typecheck, tests and build
Challenges
- Next.js 16 renders the 404 on the client when the root layout sits under a dynamic segment. Before blaming the change, the same failure was reproduced on main; the limitation was documented instead of adopting an experimental flag
- The default locale’s share image went through a 307 redirect, which social media crawlers do not follow for images. It only showed up when serving the production build, and a test now prevents the regression
- An accepted ADR described the content layer differently from the actual code. It was corrected by a new ADR, without rewriting history
- The recorded plan was to allow the theme script by SHA-256 hash. Inspecting the build showed a different inline hydration payload on every page, so a hash alone would have broken the whole site. The alternative was decided in an ADR, measured before and after and shipped in report-only mode first, with tests that fail on any violation
Responsibilities
- Architecture and recording decisions as ADRs
- Implementing the pages, the site shell and the content layer
- Security hardening: headers, cookie, validation and JSON-LD escaping
- Testing, CI and deployment on Vercel
- Content and internationalisation in Portuguese and English
Outcomes
- A portfolio that is itself the evidence: code, history, ADRs and pull requests open to any reviewer
- Lighthouse scores of 100 for accessibility, best practices and SEO on the four pages measured, and a strict CSP with no violation across the end-to-end suite
- A test suite covering schemas, cross-language consistency, SEO and the repository’s own writing rules
Learnings
- Starting again was cheaper than extracting: the old history carried couplings and private details that would have cost more to clean than to rebuild
- Check the served build, not only the source: the two subtlest bugs of this rebuild only showed up that way
- Supply chain is a product decision too: new dependencies come in at a version a few weeks old, not the one released yesterday