Live Commerce Site — Vue 3 + Vite SSG
The marketing site for an AI Avatar live platform (an AI system that runs live-selling streams) — migrated from an HTML/jQuery template to Vue 3 + Vite SSG that prerenders every page as static, with SEO + structured data per route and real interactive components in place of still images. Fast, safe and easy to maintain

The marketing site for an AI Avatar live platform (an AI system that runs live-selling streams) — I moved a purchased HTML/jQuery template onto a Vue 3 SPA, prerendered every page as static, added SEO + structured data per route, and replaced still images with real interactive components
The problem
Why is it hard to get a marketing site that looks good, loads fast and is fully visible to Google, all at once?

The purchased template was static HTML + jQuery + GSAP — good-looking, but a single page with no routes, no per-page SEO, and every section a still .jpg. Turning it into a real multi-page site that Google indexes fully, with interactive elements, meant taking the whole thing apart
The template was a single static HTML page
Each service page (AI / Insight / Rerun) needed a copy of the HTML structure — changing the header/footer meant editing every file. Not maintainable
A plain SPA shows crawlers an empty page
Switch to Vue as-is and Google opens the page to find an empty <div id="app"> — content is rendered later by JS, and SEO breaks immediately
Every section was a still image
The product dashboard was a .jpg: slow to load, lifeless, and every number change meant exporting a new image
Duplicate domains: apex and www
yourdomain.com and www.yourdomain.com both returned 200 — Google saw two sites (duplicate content) and split the SEO signal between them
Cookie consent required (PDPA)
Third-party content (an embedded map) can't load before the user consents — that would violate Thailand's Personal Data Protection Act
The solution
Move the template onto Vue 3 and prerender it as static — keeping the original look while gaining multiple pages, full SEO and real interactive elements

Vue 3 + vue-router with multiple routes
One set of components reused on every page (header/footer/sections) — change it once and it updates everywhere; new service pages go up quickly without copying structure
vite-ssg prerenders every route
The build outputs full static HTML pages — crawlers get the complete content, while users get an SPA that hydrates smoothly
Replace still images with interactive components
InsightShowcase is a real dashboard (motion-v + SVG) — numbers are edited in code with no image export, it loads light and stays sharp on every screen
useHead per route + JSON-LD
Title / description / canonical / OG + structured data (Organization / WebSite / Breadcrumb) on every page, declared in code
Cookie consent built in-house, no library
Map loading is gated until the user clicks "Accept"; the choice is stored in localStorage and can be reset, following PDPA
How it works — 4 steps
From writing a component to a static page Google can read

Write the view + useHead
Each page is a Vue component bound to its own meta (title/desc/canonical/OG)
Assemble the interactive components
The dashboard / mockups / ticker are HTML + motion-v, not images
vite-ssg build
Render every route to static HTML + inject JSON-LD + gen-sitemap
deploy static
Served through a CDN / nginx — no server rendering at request time
Tech Stack & Architecture
A Vue 3 SPA prerendered as static — as smooth as an SPA, as SEO-friendly as static, with no backend for the pages

Vue 3 + vite-ssg gives the DX of an SPA with static HTML output that crawlers can read · useHead (@unhead/vue) handles per-route meta declaratively — no hand-editing index.html · motion-v brings Framer Motion-style animation to Vue · a monorepo (web / admin / api) keeps the static marketing site separate from the back office (Vue TS + Express + Prisma) · the marketing site has no backend runtime — pure static files that load fast and cache easily
What I built — 8 core capabilities
From engineering-level SEO to interactive components that are not images

Interactive Insight Dashboard
A live-stream report dashboard (KPIs + viewer chart + quality score) built with motion-v + SVG, revealed with IntersectionObserver
Per-Route SEO (useHead)
Every page has its own title / description / canonical / OG / Twitter tags, injected at SSG build time
JSON-LD @graph
Organization + WebSite + Breadcrumb structured data on each page — groundwork for rich results on Google
Sitemap Generator
gen-sitemap.mjs generates sitemap.xml from seoRoutes automatically after every build
Animated Components
StackTicker (looping logos), StepMockup and reveal animations driven by IntersectionObserver
PDPA Cookie Consent
Hand-rolled state (localStorage) gates third-party loading (the map) behind consent — no external library
Legacy .html → Clean Route
Every *.html from the original template redirects to a clean URL — refreshing /contact.html works and active-nav still works
Mobile-First Responsive
Charts / mockups adjust their bar count to the screen with matchMedia — the layout responds at every breakpoint
The look — Insight Dashboard
A real interactive component embedded in the hero — not a screenshot, drawn with HTML + SVG

Hacks and fixes
6 problems I had to work out myself — SSG / hydration quirks + the SEO internals of a marketing site

An SPA shows crawlers an empty page
A Vue SPA renders content later with JS — bots that don't fully run JS see only an empty <div id="app">, and SEO is dead
vite-ssg to prerender every route as static HTML at build time (memory history on the server, web history on the client), then hydrate — crawlers see the full content, users get an SPAVite's path rewriting broke the template's images/JS
The template ties assets to /public + <base href="/"> — by default Vite bundles/hashes assets in templates, breaking every original path
transformAssetUrls: { tags: {} } in the vue plugin — telling Vite to leave src/href/url() as literal runtime paths, so the template's original assets resolve correctlyInteractive components can't run during SSR
During prerender there is no real window / DOM — calling IntersectionObserver, matchMedia or motion during render crashes or causes a hydration mismatch
onMounted + clean up in onBeforeUnmount, so prerender outputs the initial markup and animation starts on client-side hydration — SSR passes with no mismatchApex and www both returned 200
yourdomain.com and www.yourdomain.com served the same thing = duplicate content — Google splits SEO score / links / ad results between them
canonical/og:url in useHead to always point to the apex (controlled from a single SITE_URL) + a www→apex redirect at the ingress layer (301/308) — merging the SEO signal into oneLinks in the content still pointed to *.html
Content/menus from the template still linked to contact.html — refreshing or opening /contact.html directly on the SPA returned 404
/x.html → /x — so direct loads / refreshes resolve, then normalize URLs to clean paths so active-nav (matched on $route.path) keeps workingThe old dashboard was a slow-loading .jpg
Results shown as an exported image — heavy, blurry on retina screens, and every number change meant re-exporting the whole thing
Deliberate design decisions
Scope chosen on purpose — static-first, real elements instead of images, respect for consent

This marketing site is deliberately built with "no backend runtime" — every page is prerendered static, so it loads fast, stays stable and caches easily. Anything interactive is an HTML component, not a screenshot, and no third-party content loads before the user consents — clear boundaries = fast, safe and easy to maintain
Static-first
Every page prerendered, nothing rendered at request time
Real, not images
The dashboard / ticker are components edited in code
Consent before loading
No third-party calls before the user accepts
Keep the original template UI
Change the stack without tearing up a design that already works
Knowledge domains that got stronger
5 areas where my level genuinely moved up through this project

Understood the prerender → hydrate flow of vite-ssg, how to handle client-only code (window / observers in onMounted), and transformAssetUrls to keep Vite away from the original template's paths. Lesson: static generation gives you both the DX of an SPA and the SEO of static HTML
Implemented structured data (JSON-LD @graph: Organization / WebSite / Breadcrumb), canonical tags to fix the duplicate domain, a sitemap generator from routes, and per-page OG/Twitter tags. Lesson: for Google to understand a site, metadata has to be designed as a system, not added afterwards
Used motion-v (spring transitions), IntersectionObserver for reveal-on-scroll, and hand-drawn charts (bars + a Catmull-Rom → bezier trend line) that respond to the screen via matchMedia. Lesson: data rendered as HTML/SVG is easier to maintain and sharper than exported images
Learned to gate third-party loading (the map) behind consent and to store consent state myself (localStorage), reactive and resettable, without a library. Lesson: respecting consent is designed into the code, not patched in later
Set up web (static marketing) / admin (Vue TS + Pinia) / api (Express + Prisma + Postgres) in one npm workspace, served via Docker + an nginx reverse proxy, with the static part deployable to a CDN. Lesson: separating layers keeps the marketing site light and deployable apart from the back office
