The studio site for XCreative Studio — an index of small tools, with a page for each one.
Each product carries a platform label (Chrome, 微信小程序, iOS, …) so the home cards stay
accurate as the catalogue grows beyond browser extensions.
Products today:
- postMessage Catcher — a DevTools panel that captures
window.postMessagetraffic from every frame. - Changicon — replaces any page's favicon with an emoji, a badge, a line icon, or an uploaded image.
| Layer | Choice |
|---|---|
| Framework | Next.js 16 (App Router, static prerendering) |
| Language | TypeScript |
| Styling | Tailwind CSS v4 |
| Components | shadcn/ui primitives (Button, Badge, Card, Separator) on Radix |
| Theming | next-themes — system default, manual toggle, no flash |
| Fonts | next/font — Geist Sans, Geist Mono, Instrument Serif (display) |
| Monitoring | @vercel/speed-insights — Core Web Vitals from real visitors |
| Languages | English (/en) and Chinese (/zh) — static routes, no client translation runtime |
No TanStack Query. Every page is prerendered and the only remote data is public store
metadata: the latest GitHub release and the Chrome Web Store rating. Both are fetched on the
server at build time with next.revalidate (ISR) — the release note in
src/lib/github.ts, the store numbers in
src/lib/chrome-web-store.ts. Client-side caching would add
JavaScript without adding anything. Add TanStack Query the day a page needs interactive, paginated
or mutation-heavy data — nothing in this structure prevents it.
npm install
npm run dev # http://localhost:3000
npm run build # production build
npm run start # serve the build
npm run typecheck # tsc --noEmitsrc/app/[locale]/layout.tsx root layout: fonts, theme, header/footer, <html lang>
src/app/[locale]/page.tsx home: hero, product cards, principles
src/app/[locale]/[slug]/page.tsx product pages (locales × products)
src/app/[locale]/not-found.tsx localized 404
src/app/sitemap.ts, robots.ts SEO endpoints (both locales)
src/proxy.ts locale detection + redirects for unprefixed URLs
src/i18n/config.ts locales, helpers
src/i18n/dictionaries.ts UI strings for en and zh
src/data/products.ts product structure + copy for both languages
src/lib/github.ts latest GitHub release + release zip URL
src/lib/chrome-web-store.ts store rating, review count and users
src/components/ header, footer, card, stats, locale switcher, release note
src/components/ui/ shadcn/ui primitives
public/products/<slug>/ icon + marquee + screenshots (webp)
public/og, public/og.png social preview images
Every page is prerendered twice:
| URL | Language |
|---|---|
/en, /en/postmessage-catcher |
English |
/zh, /zh/postmessage-catcher |
Chinese (Simplified) |
src/proxy.ts(Next 16's replacement formiddleware.ts) sends/and any unprefixed path to the locale that matches the visitor'sAccept-Language, with a 308 so links without a prefix keep working.- The toggle in the header is a plain link, so it works without JavaScript.
- Each page declares
hreflangalternates (en,zh-Hans,x-default), andsitemap.xmllists both versions with the same alternates. - UI copy lives in
src/i18n/dictionaries.ts; product copy lives next to the product insrc/data/products.tsundertext.en/text.zh.
- Append an entry to
src/data/products.ts— slug, name,platform(shown on the home card as “Free · Chrome”), version, store/repo URLs, bothtext.enandtext.zhblocks (tagline, summary, intro, features, sections, screenshot captions, privacy), and thedownload+storeStatsfallbacks described below. - Drop its assets into
public/products/<slug>/(icon.png,marquee.webp, screenshots at 1280×800). - The route, metadata, JSON-LD, sitemap entry, home card, navigation links and the "also from the studio" link all follow automatically.
- On every version bump, update
downloadto the new release asset URL (and keepstoreStatsroughly current so a failed store fetch never shows stale numbers for long).
The product page has a Download .zip button and a small rating line; the home cards repeat the rating. Both come from public pages, fetched on the server and cached by ISR:
- Release zip.
src/lib/github.tsreads the latest release once an hour and picks its.zipasset (the packaged extension). The button falls back to the fixeddownload.urlinsrc/data/products.tsif the GitHub API is unreachable or rate-limited. GitHub sendsContent-Disposition: attachment, so the download starts without JavaScript. - Store numbers. Chrome Web Store has no public ratings API, so
src/lib/chrome-web-store.tsparses the rendered listing once a day (?hl=en-US&gl=US): the firstAverage ratingblock is the item's own rating, followed by its rating count and user count. If the page layout changes, a network request fails, or the response is a JS-only shell,storeStatsinsrc/data/products.tsis used instead and a[store-stats] … using bundled fallbackwarning is logged. The build never fails because of it.
The displayed user count is Chrome Web Store’s own rounded figure, not an exact install count.
The visible rating is also emitted as aggregateRating in the product page JSON-LD.
<SpeedInsights /> is mounted once in src/app/layout.tsx. It injects
/_vercel/speed-insights/script.js, which only exists on Vercel — locally the request 404s and
nothing is recorded, which is expected.
After the first deploy, open the project in Vercel → Speed Insights → Enable. Field data
appears within a few minutes of the first visit. It reports real-user LCP, INP and CLS per route
(/, /postmessage-catcher, /customize-tab-icon), so a regression on one page is visible on its own.
- Per-page
title, description, canonical, Open Graph and Twitter cards via the Metadata API - JSON-LD
SoftwareApplicationon product pages sitemap.xml+robots.txtgenerated from the same data- Static HTML for every route; the only JavaScript is the theme toggle and the mobile nav
After deploying, submit https://xcreative.dev/sitemap.xml in Google Search Console and
Bing Webmaster Tools. The sitemap lists /en and /zh with hreflang alternates so each
language is indexed separately.
Vercel picks this up with zero configuration:
- Import
XCreativeStudio/xcreative-website. - Framework preset Next.js — build
next build, no output directory override. - Add the domain
xcreative.dev, then point the registrar'sArecord (or nameservers) at Vercel.
.dev is HSTS-preloaded, so the site must be served over HTTPS — Vercel issues the certificate
automatically.