Web AppProjects

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

10 min read

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

Vue 3Vite SSGvue-routermotion-vuseHeadJSON-LDPDPA ConsentDocker Monorepo
Empathize · Define

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 four-product section on the home page, each product with its own service page
Several service pages, each needing its own route + SEO (brand names blurred)

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 starting brief, before migrating the marketing site

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


Ideate

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

The marketing site home page, with a large headline and a floating dashboard card below
The home page after migration — the dashboard card in the hero is a real component, not an image (brand names blurred)

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


Prototype

How it works — 4 steps

From writing a component to a static page Google can read

Comparison of index.html before the build, with only an empty div, and the file after vite-ssg with full meta and content
Before/after the vite-ssg build — cropped from the real files (brand/domain replaced)
1

Write the view + useHead

Each page is a Vue component bound to its own meta (title/desc/canonical/OG)

2

Assemble the interactive components

The dashboard / mockups / ticker are HTML + motion-v, not images

3

vite-ssg build

Render every route to static HTML + inject JSON-LD + gen-sitemap

4

deploy static

Served through a CDN / nginx — no server rendering at request time


Prototype

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

The contact page, using the same header and logo strip as the home page
The /contact route — header / ticker / footer are the same components on every page
Visitors + search crawlers (Google / bots)
static HTML Open Graph JSON-LD sitemap.xml
↕
Vue 3 + Vite SSG (vite-ssg) — prerender + hydrate
vue-router useHead motion-v IntersectionObserver
↕
SEO & Content layer
JSON-LD @graph canonical / OG gen-sitemap cookie consent
↕
Static output → CDN / nginx (Docker monorepo: web · admin · api)
static assets /public reverse proxy self-host / CDN
Why this stack?

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


Prototype

What I built — 8 core capabilities

From engineering-level SEO to interactive components that are not images

The home page on mobile, with the bar chart adjusting to the screen
Mobile-first: the hero dashboard adjusts its number of bars to the screen width

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


Prototype

The look — Insight Dashboard

A real interactive component embedded in the hero — not a screenshot, drawn with HTML + SVG

The live-report dashboard component, showing peak viewers, comments per minute and a viewer chart
Insight dashboard component: KPIs + viewer chart + quality score, drawn with HTML + SVG
re-broadcast app Insight
Live report · @your_shop
Peak viewers
1,558
Comments/min
64
Positive sentiment
68%
Concurrent viewers · whole stream Peak · minute 60
74
Live quality score · Goodbaseline = this channel
Comment rate82
Concurrent viewers79

Test & Iterate

Hacks and fixes

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

The cookie consent bar, with Reject and Accept all buttons
The hand-built cookie consent — it appears before any third-party content loads

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

Fix: use 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 SPA

Vite'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

Fix: set transformAssetUrls: { tags: {} } in the vue plugin — telling Vite to leave src/href/url() as literal runtime paths, so the template's original assets resolve correctly

Interactive 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

Fix: start observers / matchMedia only in onMounted + clean up in onBeforeUnmount, so prerender outputs the initial markup and animation starts on client-side hydration — SSR passes with no mismatch

Apex 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

Fix: set 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 one

Links 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

Fix: generate a redirect map from every route — /x.html → /x — so direct loads / refreshes resolve, then normalize URLs to clean paths so active-nav (matched on $route.path) keeps working

The 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

Fix: draw the chart with SVG + a data array in code (the trend line goes Catmull-Rom → cubic bezier for a smooth curve), with the bar count adjusted per screen via matchMedia — lesson: data rendered as HTML/SVG is lighter, sharper and edited entirely in code, no image export

Define

Deliberate design decisions

Scope chosen on purpose — static-first, real elements instead of images, respect for consent

The map box still hidden, with a Show map button
The Google map stays gated until the user consents

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


Level Up · Reflect

Knowledge domains that got stronger

5 areas where my level genuinely moved up through this project

The FAQ section as an accordion
The FAQ section — the content lives in prerendered HTML that crawlers can read
1. Vue 3 SSG & Hydration — you don't have to choose between SPA and SEO:

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

2. Technical SEO — SEO is engineering, not just keywords:

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

3. Web Animation & Dataviz — interactive communicates better and weighs less than images:

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

4. PDPA & Consent Engineering — privacy is a requirement from the design stage:

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

5. Monorepo & Deploy Architecture — separate responsibilities so each part deploys independently:

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

8
Pages prerendered as static HTML (SSG)
3
Interactive components — not screenshots
7
legacy .html redirect → clean URL
0
Backend runtime the pages depend on

Follow-up: Automated article engine — a back office + AI production line that publishes 5 articles a day to this site

Tan · Natpakan Sirirat

Product Designer & AI Builder — designing user experiences and building AI tools that actually work.

0%