Skip to content

Build the nickcatalano.com site on Next.js 16#1

Merged
nickcatal merged 1 commit into
mainfrom
ai-bio-rewriter
May 30, 2026
Merged

Build the nickcatalano.com site on Next.js 16#1
nickcatal merged 1 commit into
mainfrom
ai-bio-rewriter

Conversation

@nickcatal

@nickcatal nickcatal commented May 30, 2026

Copy link
Copy Markdown
Owner

Replaces the static one-pager with a full Next.js 16 app (App Router, React 19, TypeScript, Tailwind v4). The original photo, biography, and links are preserved — all content has a single source of truth in lib/bio.ts. The headline feature is a playful "rewrite my bio in a funny voice" button, but the scope is the whole site: rendering, styling, SEO, analytics, and the supporting infrastructure.

Site

  • Server-rendered homepage with the original content, refreshed typography (Fraunces) and a warm editorial palette.
  • SEO/social metadata (Open Graph, Twitter card, canonical, robots) + JSON-LD Person structured data.
  • Google Analytics preserved (production-only so dev traffic doesn't pollute it).
  • PostHog web analytics — gated on POSTHOG_TOKEN and lazy-loaded out of the initial bundle (first-load JS ~111 kB).

AI bio-rewriter

  • Server Actions generate five funny rewrite concepts via OpenAI Structured Outputs (GPT-5 Nano, minimal reasoning for latency); each prompt is HMAC-signed. Picking one rewrites the bio inline, rendered as markdown. The original always stays visible.
  • The signed payload is authoritative — the browser is never trusted to supply a prompt.
  • $ai_generation LLM observability via PostHog.

Infrastructure

  • Swappable Redis behind lib/cache + lib/rate-limit factories: local ioredis in dev, Upstash over REST in prod (reads Vercel's KV_REST_API_*). Caching fails open; rate limiting fails closed in production.
  • Daily per-IP limits (client IP from the non-forgeable x-real-ip header); rewrites cached 30 days.
  • Env validation: lenient in dev, fail-fast in prod.

Tooling & docs

  • Jest signing tests, ESLint (flat config), GitHub Actions CI (lint/typecheck/test), Docker Compose for local Redis, .env.example, README, AGENTS.md, CLAUDE.md.

Deploy notes

  • Set in Vercel: OPENAI_API_KEY, BIO_SIGNING_SECRET, a Redis store (injects KV_REST_API_*), and optionally POSTHOG_TOKEN.

Verification

typecheck · lint · test (6/6) · production build all green on Next 16; homepage prerenders static (no AI on load).

Note: npm audit still flags a moderate XSS in the postcss bundled inside Next; the advisory range includes 16.2.6, so no released Next fixes it yet. Low real-world impact for this app.

🤖 Generated with Claude Code

@vercel

vercel Bot commented May 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
website Ready Ready Preview, Comment May 30, 2026 7:59pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Rebuilds nickcatalano.com from a minimal placeholder into a full Next.js 16 App Router site with a server-action–driven “fun bio rewrite” feature, Redis-backed caching/rate-limiting, and analytics/SEO infrastructure.

Changes:

  • Upgrade to Next.js 16 + React 19 with App Router, Tailwind v4 styling, and improved homepage layout/typography.
  • Add AI “bio rewriter” feature using OpenAI Structured Outputs with HMAC-signed prompts, per-IP rate limiting, and cached rewrites.
  • Add analytics (PostHog + production-only GA), SEO metadata + JSON-LD, and supporting tooling (env example, CI, Jest, ESLint, local Redis via Docker Compose).

Reviewed changes

Copilot reviewed 35 out of 39 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsconfig.json Updates TS compiler settings for the new Next.js app setup.
README.md Documents the new Next.js app, AI feature, env vars, and workflows.
package.json Upgrades to Next.js 16 and adds dependencies/scripts for AI, Redis, linting, typecheck, and tests.
next.config.ts Configures PostHog proxy rewrites and externalizes posthog-node for server bundling.
lib/signing.ts Implements HMAC signing + verification for prompt tokens.
lib/signing.test.ts Adds Jest tests covering signing/verifying, tampering, and expiry.
lib/schemas.ts Defines Zod schemas for Structured Outputs and request validation.
lib/rate-limit/upstash.ts Implements Upstash-based rate limiting adapter.
lib/rate-limit/types.ts Defines rate limiter interfaces/types.
lib/rate-limit/local.ts Implements local Redis rate limiting adapter.
lib/rate-limit/index.ts Provides a unified limiter with dev/prod failover policy.
lib/posthog.ts Adds server-side PostHog client + $ai_generation capture helper.
lib/openai.ts Adds OpenAI calls for suggestions and rewrites with Structured Outputs + observability.
lib/env.ts Adds environment resolution/validation with dev/prod behavior differences.
lib/dto.ts Defines DTOs returned by server actions to the client.
lib/cache/upstash.ts Implements Upstash REST cache adapter (fail-open).
lib/cache/types.ts Defines cache store interface.
lib/cache/local.ts Implements local Redis cache adapter (fail-open).
lib/cache/index.ts Provides cache factory selecting local/upstash/noop by env.
lib/bio.ts Centralizes all site content (profile, bio, links, GA id).
jest.config.mjs Configures Jest via next/jest.
eslint.config.mjs Adds ESLint flat config using Next’s config + ignores.
docker-compose.yml Adds local Redis service for dev.
components/posthog-provider.tsx Lazy-loads posthog-js and provides client analytics when configured.
components/posthog-pageview.tsx Manually captures $pageview for App Router navigations.
components/markdown.tsx Renders rewrite output as Markdown via react-markdown + GFM.
components/BioRewriter.tsx Client UI to generate suggestions, select a rewrite, and display results.
CLAUDE.md Points Claude-specific guidance at AGENTS.md.
app/page.tsx Implements the new homepage rendering from lib/bio.ts plus BioRewriter.
app/layout.tsx Adds SEO metadata, JSON-LD Person schema, PostHog provider, and production-only GA.
app/globals.css Defines site palette/typography variables and scoped Markdown styling.
app/actions.ts Adds server actions for suggestions/rewrites with signing, rate limiting, caching, and analytics flush.
AGENTS.md Adds contributor/agent conventions and hard rules for the repo.
.nvmrc Pins Node.js major version for local/dev parity.
.gitignore Ignores .swc artifacts.
.github/workflows/ci.yml Adds CI for lint/typecheck/test on pushes/PRs.
.env.example Provides documented env var template for local/prod configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread AGENTS.md Outdated
@nickcatal

Copy link
Copy Markdown
Owner Author

Both Copilot review comments addressed in ff9c9d4: README and AGENTS.md now say Next.js 16 (they were the only two stale Next.js 15 references). Threads resolved.

Replaces the static one-pager with a full Next.js 16 (App Router, React 19,
TypeScript, Tailwind v4) application. The original photo, biography, and links
are preserved; all content has a single source of truth in lib/bio.ts.

Site
- Server-rendered homepage with the original content, refreshed typography
  (Fraunces) and a warm editorial palette.
- SEO/social metadata (Open Graph, Twitter, canonical, robots) and JSON-LD
  Person structured data. Google Analytics preserved (production only).
- PostHog web analytics, gated on POSTHOG_TOKEN and lazy-loaded out of the
  initial bundle.

AI bio-rewriter
- A "rewrite my bio in a funny voice" button: Server Actions generate five funny
  concepts via OpenAI Structured Outputs (GPT-5 Nano, minimal reasoning), each
  HMAC-signed; picking one rewrites the bio inline as markdown. The signed
  payload is authoritative -- the browser is never trusted to supply a prompt.
- $ai_generation LLM observability via PostHog.

Infrastructure
- Swappable Redis behind lib/cache + lib/rate-limit factories: local ioredis in
  dev, Upstash over REST in prod (Vercel's KV_REST_API_* vars). Caching fails
  open; rate limiting fails closed in production. Daily per-IP limits (client IP
  from the non-forgeable x-real-ip header); rewrites cached 30 days.
- Env validation (lenient in dev, fail-fast in prod).

Tooling and docs
- Jest signing tests, ESLint (flat config), GitHub Actions CI, Docker Compose
  for local Redis, .env.example, README, AGENTS.md, CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nickcatal nickcatal merged commit 12e298e into main May 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants