Claude Code-inspired personal website for Richie Tan, built as a browser-based terminal experience on Next.js 16.
- Recreates the feel of Claude Code in the browser, including a terminal-style transcript, prompt, shortcuts, slash commands, and local help surfaces.
- Answers questions about Richie using an Anthropic model through the Vercel AI SDK.
- Pulls live portfolio data from GitHub through tool calls for projects, skills, resume source, and profile stats.
- Includes a macOS-style desktop/window shell with a floating application launcher for reopening Claude.
- Randomly serves a macOS-style AI wallpaper on each full page load from a Blob-backed wallpaper pool.
- Next.js 16 App Router
- React 19
- Tailwind CSS 4
- Vercel AI SDK (
ai,@ai-sdk/react) - OpenAI provider (
@ai-sdk/openai) for wallpaper generation - Anthropic provider (
@ai-sdk/anthropic) - Vercel Blob (
@vercel/blob) for generated wallpaper storage marked+highlight.jsfor terminal-style markdown rendering- GitHub REST + GraphQL fetches for live portfolio data
-
Install dependencies:
npm install
-
Create or update
.env.localwith:ANTHROPIC_API_KEY=... OPENAI_API_KEY=... BLOB_READ_WRITE_TOKEN=... CRON_SECRET=... # required for production cron auth GITHUB_TOKEN=... # optional but recommended
-
Start the app:
npm run dev
-
Open
http://localhost:3000.
Useful scripts:
npm run dev
npm run lint
npm run build
npm run startANTHROPIC_API_KEYRequired. Used byapp/api/chat/route.tsto stream model responses.OPENAI_API_KEYRequired for automatic wallpaper generation viagpt-image-1.5.BLOB_READ_WRITE_TOKENRequired for reading/writing the wallpaper pool and manifest in Vercel Blob.CRON_SECRETRequired in production so the wallpaper cron route only accepts trusted Vercel cron invocations.GITHUB_TOKENOptional but recommended. Enables GitHub GraphQL-backed features like pinned repos and contribution stats. Without it, some GitHub-derived data gracefully degrades.
app/page.tsxServer-rendered entrypoint that chooses a wallpaper per request and renders the client shell on top.components/home-shell.tsxComposes the desktop, macOS-style window, and terminal.components/home-shell-loader.tsxClient wrapper that keeps the desktop/window shell client-only without blocking the server-rendered wallpaper.components/desktop.tsxOwns the transparent desktop surface, snap preview, and floating application launcher.components/mac-window.tsxHandles window drag, resize, minimize, maximize, and close behavior.
components/terminal.tsxMain state machine for chat, local history, reverse search, slash-command handling, and local panels.components/message.tsxRenders transcript rows.components/input-area.tsxPrompt, caret, footer, and shortcuts/help affordances.components/markdown.tsxTerminal-style markdown renderer tuned to match Claude Code behavior as closely as possible in the browser.
app/api/chat/route.tsStreams chat responses, enforces origin allowlisting, and applies a simple in-memory per-IP rate limit.lib/system-prompt.tsSystem prompt for the Claude Code-style terminal persona.lib/tools.tsAI tool definitions exposed to the model.lib/github.tsGitHub fetch layer with in-memory TTL caching.lib/transcript.tsNormalizes model/tool output into UI transcript nodes.lib/constants.tsHeader/footer text plus slash-command definitions.lib/wallpapers.tsBlob-backed wallpaper manifest, random selection, and AI generation/top-up logic.
Supported prompt commands:
/help/resume/projects/skills/contact/clear
Prompt-style commands are transformed server-side into richer prompts before being sent to the model. Local commands are handled entirely in the client transcript flow.
- Allowed browser origins are hardcoded in
app/api/chat/route.ts. If you add a new domain or preview host, update that list. - Rate limiting is in-memory and resets on restart or redeploy.
- Wallpaper generation runs through
app/api/cron/wallpapers/route.tsand is intended to be invoked by Vercel Cron. - App/browser icons use Next.js app metadata file conventions from
app/:app/favicon.icoapp/icon.pngapp/apple-icon.png
vercel.jsonconfigures the automatic wallpaper top-up schedule.
Before shipping changes, run:
npm run lint
npm run buildThere is no dedicated test suite yet; lint and production build are the current safety checks.