My desire to practice my skills and share my acquired knowledge fuels my endeavors.
v2 (Astro Γ Bun) runs on karhdo.dev from main Β· v1 (Next.js) stays on v1.karhdo.dev from the v1 branch.
Astro 7 + Bun, TypeScript strict, Tailwind CSS v4 with Tokyonight Day / Night tokens, MDX with Expressive Code, Drizzle on Neon Postgres, Pagefind search, Satori OG images, Biome, deployed on Vercel (Functions on Node 24). Interactivity is vanilla <script> modules; React 19 is used only for Giscus comments and the βK palette.
- Bento homepage: typed bios, latest post, now playing (Last.fm), GitHub activity heatmap, blog stats, Token burn (Claude Code usage), stack marquee, projects.
- Blog with tags, RSS, βK search, TOC scrollspy, code blocks with filename tabs, callouts, image zoom, views and reactions, Giscus comments and a newsletter.
/aboutterminal card,/careeras agit log --graph, site-wide snowfall, light/dark/system theme and view transitions.
Requires Bun 1.3.14 and Node β₯ 22.12. Every env var is optional: without them each feature shows an empty state.
bun install # also installs the lefthook pre-commit hook
cp .env.example .env.local
bun dev # http://localhost:4321 (plus dev-only /dev/* pages)| Command | What it does |
|---|---|
bun test |
Unit tests (*.test.ts next to the code) |
bun run check |
astro check + biome check . (bun run check:fix to fix) |
bun run lint:palette |
Fails on colour literals outside the Tokyonight token files |
bun run build |
Production build into .vercel/output |
bun run cv:build |
cv/resume.tex β public/static/resume.pdf |
@astrojs/vercel doesn't support astro preview. Serve .vercel/output/static with a static server, use bunx vercel dev, or deploy a preview. On-demand routes (/api/*, /projects, /newsletter) need bun dev.
βββ astro.config.mjs # adapter, integrations, markdown pipeline, astro:env schema
βββ cv/ # resume source
βββ public/static/ # images, favicons, resume.pdf, Twemoji SVGs
βββ scripts/ # build info, palette lint, token-burn setup
βββ src/
βββ pages/ # routes (api/*, projects, newsletter are on-demand; the rest is prerendered)
βββ components/ # grouped by feature
βββ content/ # blog and author MDX
βββ config/ # site data, navigation, projects, experiences
βββ lib/ # pure, tested logic + thin services (db, stats, github, lastfm, token-burn, og)
βββ styles/ # theme.css (the only colour tokens), global, prose, animations
Declared in the astro:env schema in astro.config.mjs; see .env.example. The v1 names are kept so Vercel needs no renames.
| Variable | Used for |
|---|---|
POSTGRES_URL |
Views, reactions, blog stats (Neon -pooler host) |
GITHUB_API_TOKEN |
/projects, GitHub cards, footer stars |
LASTFM_API_KEY, LASTFM_USERNAME |
Now playing |
BUTTONDOWN_API_KEY |
Newsletter (read at build too: adding it needs a redeploy) |
TOKEN_BURN_INGEST_KEY |
Token burn ingest (Production only) |
NEXT_PUBLIC_GISCUS_* |
Giscus comments (repo, repository ID, category, category ID) |
UMAMI_WEBSITE_ID |
Umami analytics |
Claude Code's OpenTelemetry export sends token and cost metrics to POST /api/otel/v1/metrics, stored per day and model in token_burn_daily. On each machine, run:
curl -fsSL https://raw.githubusercontent.com/Karhdo/karhdo.dev/main/scripts/setup-token-burn-telemetry.sh | bashIt asks for TOKEN_BURN_INGEST_KEY and merges the CLAUDE_CODE_ENABLE_TELEMETRY and OTEL_* settings (endpoint, Authorization=Bearer <key> header, delta temporality) into ~/.claude/settings.json.
Spotify's Web API needs Premium, so the card reads Last.fm instead: connect Spotify Scrobbling in Last.fm settings (reconnect every 180 days), create an API account, then set LASTFM_API_KEY and LASTFM_USERNAME.
- v2: Vercel project
karhdo-blog, deployed on every push (mainβ production). Keep "Automatically expose System Environment Variables" on (the footer readsVERCEL_GIT_*). - v1: project
karhdo-blog-v1, deployed by hand from av1checkout:vercel link --project karhdo-blog-v1 && vercel deploy --prod.
- Design and code patterns from Leo Huynh's leohuynh.dev and Timothy Lin's Tailwind Next.js Starter Blog.
- Tokyonight colours, Twemoji, simple-icons, Lucide, Outfit and JetBrains Mono fonts.
- Full notices in THIRD_PARTY_NOTICES.md.
MIT Β© Do Trong Khanh (Karhdo). If this project helped you, a β is appreciated.