itsashik.dev
Diese Website: ein Portfolio und Blog, gestaltet wie ein homelab Dashboard.
Dieser Artikel wurde maschinell aus dem Englischen übersetzt. Lesen Sie das Original
- Commits
- 96
- vergangenes Jahr
- Sterne
- 1
- Sprache
- TypeScript
- letzter Schub
- Nov. 2026
- MIT License
Auf dieser Seite
Was es ist#
Die Website, die Sie gerade lesen. Sie ist wie ein Dashboard homelab aufgebaut: Projekte werden als Dienste mit einem messbaren Status angezeigt, Schreibvorgänge werden protokolliert, und die Laborseite zeigt meinen dreiknotigen Proxmox Cluster live an.
Warum#
Jedes Portfolio kann behaupten: „Ich betreibe Infrastruktur“. Ich wollte, dass dieses Portfolio es auch zeigt, deshalb ist jede Zahl auf der Seite gemessen, entweder von GitHub oder aus dem Labor, und keine wurde von Hand eingegeben.
Stapel#
Next.js und React basieren auf Vercel, die Inhalte werden in Sanity bereitgestellt und das Studio ist thematisch an die Website angepasst. Tailwind CSS verwendet eine monochrome Farbpalette, wobei Farbe ausschließlich den Status anzeigt. Jeder Lab-Knoten führt einen kleinen Python-Agenten aus, der alle 30 Sekunden ein signiertes Statussignal sendet. Die Website speichert 24 Stunden Verlauf in Upstash Redis und markiert einen Knoten anhand der Meldungen seiner Peers als inaktiv. GitHub Statistiken werden planmäßig oder auf Anfrage aus dem Studio synchronisiert.
Der schwierige Teil#
Ein Fehler, der ausschließlich in der Produktionsumgebung auftrat. Nach einer Refaktorisierung verliefen die Preview-Deployments und der lokale Produktions-Build erfolgreich, das Deployment in der Produktionsumgebung schlug jedoch fehl. Der Unterschied lag in einer einzigen Umgebungsvariablen: Mit einem gesetzten Sanity -Lesetoken forderte die statische Seitengenerierung den Entwurfsmodus an, der zur Build-Zeit nicht zulässig ist. Das Problem ließ sich beheben, indem diese Abfragen auf veröffentlichte Inhalte zurückgeführt wurden. Nun kann ich die Fehler, die nur in der Produktionsumgebung auftreten, lokal reproduzieren, indem ich ein Platzhaltertoken setze.
Status#
Aktiv. Dort probiere ich Dinge zuerst aus.
README.md
MeAshikeqbal/portfolio · master
Portfolio and blog of Ashik Eqbal, styled as a homelab status dashboard: a monochrome UI where colour only ever means status (green = live, amber = attention, red = down, blue = link/info).
Live: www.itsashik.dev · Style guide: /styleguide (preview and local builds only)
Stack
| Area | Choice |
|---|---|
| Framework | Next.js 16 (App Router, static prerendering), React 19, TypeScript |
| Content | Sanity 6 with the Studio embedded at /studio, typed GROQ via TypeGen, Live Content API |
| Styling | Tailwind CSS 4 (CSS-first tokens in app/globals.css), shadcn/ui on Radix, Geist |
| Code highlighting | Shiki, rendered on the server |
| Share images | next/og (opengraph-image.tsx routes) |
| Tests | Vitest + Testing Library, Playwright + axe |
| Hosting | Vercel (Analytics, Speed Insights, Cron) |
Getting started
nvm use # Node 24 (see .nvmrc)
npm ci
cp .env.example .env.local # fill in values; the public Sanity id is prefilled
npm run dev # http://localhost:3000, Studio at /studioWithout the server-side secrets the site still builds and renders. The contact form, GitHub sync and webhook just report that they aren't configured.
Scripts
| Command | What it does |
|---|---|
npm run dev | Dev server (Turbopack); Studio at /studio (workspaces content and inbox) |
npm run build / npm start | Production build / serve it |
npm run check | Lint + typecheck + unit tests |
npm run lint · npm run typecheck · npm test | Individually |
npm run format · npm run format:check | Prettier (with Tailwind class sorting) |
npm run test:e2e | Playwright against a production build (npm run build first) |
npm run typegen | Regenerate sanity.types.ts after changing a schema or a query |
npm run backup | Export the production and inbox datasets (with assets) into backups/ (git-ignored). Needs npx sanity login |
Project layout
app/
(root)/ public site: home, /post, /post/[slug], /projects, /projects/[slug]
studio/ embedded Sanity Studio
styleguide/ living style guide (404 in production)
api/ sanity-webhook (revalidation), sync-github-data (cron), github-sync (Studio)
icons/ self-hosted Iconify SVGs for the skills inventory
opengraph-image.tsx, sitemap.ts, robots.ts, manifest.ts, rss.xml/
components/
dashboard/ design-system primitives (StatusPill, Panel, DataRow, Sparkline…)
home/ blog/ projects/ site/ portable-text/ seo/
ui/ shadcn/ui components
lib/ data access (api.ts), helpers, structured data, OG frame
sanity/ schema types, GROQ queries, clients; Studio dashboard, actions, inputs
scripts/ one-off data migrations (dry run by default) and the backup script
tests/unit, tests/e2eHow things work
- Content and freshness. Every read goes through
sanityFetch(lib/api.ts). Pages are static.<SanityLive />revalidates them when content is published, and the Sanity webhook (/api/sanity-webhook) is the backstop for changes made while nobody is on the site. - Typed queries. All GROQ lives in
sanity/lib/queries.ts. After editing a query or a schema, runnpm run typegen. - GitHub stats.
/api/sync-github-dataruns daily (vercel.json). It updates stars, language, last push and past-year commit activity (including a 12-week series for the sparklines) on every project with a repo, plus the repo's README, which the project page shows below the case study (sanitized, GitHub-hosted images only, starter READMEs hidden; Show README in the project's GitHub tab turns it off). New repositories are not added automatically. In the Studio, Sync from GitHub (a project's ⋯ menu) or Sync all now (Home dashboard) runs it on demand: the Studio stampsgithubSyncRequestedAtwith the editor's own permissions and/api/github-synconly syncs freshly stamped projects, so no secret ever reaches the browser. - Design tokens. Colours are OKLCH tokens in
app/globals.css.tests/unit/tokens.test.tsfails the build if any text/background pair drops below WCAG AA. - Contact messages. The form stores each message in a private
inboxdataset, shown in the Studio as the Inbox workspace (/studio/inbox, Unread / Read / Archived). Messages never go to the publicproductiondataset. - Security.
next.config.tssends HSTS,nosniff, a referrer policy, a permissions policy and a Content Security Policy. The CSP applies to production builds only and doesn't cover the Studio.tests/e2e/security.spec.tsfails on any CSP violation.
Content tips (Sanity Studio)
- Project
status(active / maintained / archived) turns on status pills. Nothing is claimed until it's set. - Project
featuredand the drag-and-drop order of the Projects list decide what leads the home page (skills follow the order of the Skills list). Addingtechand a case-studybodyfills/projects/[slug]and the filters. A Demo video (Overview tab) replaces the cover at the top of the project page. excerptand the SEO fields (title, description, social image, noindex) override the generated defaults for posts and projects.- Skill icons are Iconify names (
logos:aws,mdi:security) from thelogos,mdi,simple-iconsandrisets. The icon field has a search and warns when a name doesn't exist. - Rich text has code blocks (language, filename, highlighted lines), note/warning
callouts, videos, numbered lists and inline code.
/styleguideshows every block type. - Videos (demo video or a block in any case study or post) are either an upload (MP4/WebM on Sanity's CDN; keep clips short, every view counts against Sanity bandwidth; "Play like a GIF" loops them muted) or a YouTube link, which loads the youtube-nocookie player only when played. RSS readers get a link instead.
- Open on site (⋯ menu) opens a published post, project, Homecave or
/nowin a new tab. - Homecave (
/homecave, formerly/uses, which now redirects) is the live homelab dashboard. Each Proxmox node's agent (scripts/lab-heartbeat/) posts a signed, anonymized report every 30s to/api/lab-heartbeat. Reports are stored in Upstash: the latest per node, plus 24h of 5-minute samples, one LuaEVALper write./api/lab-statusserves them, re-allowlisted. The page is server-rendered every 30s and kept fresh in the browser.- A root collector on each node (
collect.py, every 60s, local only) adds what the read-only token can't see: named public services up/down (badges on the self-hosted and network rows), container health, temperatures, GPU, scrubs, backups, WAN, edge traffic, DNS and media savings, all reduced to public names and counts before the sender signs them. - Its copy comes from the Homecave singleton (Sanity type
uses): the intro; the "Homelab" rows, whose names match the lab's public node names and whose descriptions become the node spec lines; and the self-hosted and setup sections. - The hero's homelab list shows the first five Homelab rows, with measured badges.
- Snapshot (button by the verdict) saves
/homecave/snapshot, a PNG of the lab right now, rendered withnext/ogfrom the same public status and CDN-cached for 30s. - Env vars:
LAB_HEARTBEAT_SECRET, plus Upstash (UPSTASH_REDIS_REST_*orKV_REST_API_*).
- A root collector on each node (
/nowis a singleton under Personal Info. It stays a 404, and isn't linked from the footer, ⌘K palette or sitemap, until it has published content. It turns its date pill amber once it hasn't been edited forsiteConfig.nowStaleAfterDays.- Content seeds stay local. Sanity is the source of truth for content. The one-off seed
and migration scripts (Homecave and
/nowcopy, the project refresh, curation) are git-ignored, because this repo is public: they live only on the owner's machine and run withnpx sanity exec scripts/<name>.ts --with-user-token(dry run first). - E2E and publication state. Tests expect
ABOUT_PAGES=published|unpublished(whether/nowis live), decided before the build byexport $(node scripts/about-state.mjs)(uncached Sanity API). CI does this automatically and pickslighthouserc.published.jsononce/nowis live. Homecave is always audited. - Draft previews. Open Presentation in the Studio to edit with a live preview of the
real site, drafts included. This needs
SANITY_API_READ_TOKEN(a Viewer token). - Availability badge. The hero badge comes from
siteConfig.availabilityinlib/site.ts: change the label, usestatus: "warn"for limited availability, or set it tonullto hide it.
Deployment checklist (Vercel)
- Set the environment variables from
.env.example(Production and Preview). For draft previews, create a Viewer token at sanity.io/manage → API → Tokens and set it asSANITY_API_READ_TOKEN. - In sanity.io/manage → API:
- add
https://www.itsashik.dev(and preview domains) as CORS origins, for live updates - add a webhook to
https://www.itsashik.dev/api/sanity-webhookwith headerAuthorization: Bearer $SANITY_WEBHOOK_SECRET
- add
- The cron in
vercel.jsoncalls the GitHub sync daily; Vercel adds theCRON_SECRETheader.
License
Code is released under the MIT License. Blog posts, images and other site content are
© Ashik Eqbal and not covered by it. The Geist fonts in assets/fonts (used by the generated
share images) are under the SIL Open Font License; see assets/fonts/OFL.txt.