© Đặng Mai Anh Tú. All rights reserved.
Based on 3d-portfolio by Naresh Khatri.

    All posts
    nextjs
    seo
    react
    portfolio

    Moving my portfolio from a Vite SPA to Next.js for SEO

    Đặng Mai Anh Tú
    Monday, November 16, 2026
    2 min read

    My first portfolio was a Vite + React single-page app. It looked fine in the browser, but the HTML that search engines received was just this:

    <div id="root"></div>
    

    Everything else (my name, experience, projects) was rendered by JavaScript after the page loaded. Google can execute JavaScript, but it does it later and less reliably, and most link previews (LinkedIn, Facebook, Zalo) don't run it at all.

    What changed

    • Server-rendered HTML. Every page is rendered on the server with Next.js App Router, so crawlers and link previews get real content on the first request.
    • Metadata per page. Title, description, canonical URL and Open Graph image are defined with the metadata API instead of one hard-coded block in index.html.
    • Structured data. A Person and WebSite JSON-LD block tells search engines who I am, where I work and which profiles belong to me. Blog posts ship BlogPosting data.
    • One URL per project. Projects used to live only inside a modal. Now each one also has its own page under /projects, so it can be indexed and shared.
    • Sitemap and robots. Generated from the same data that renders the site, so they never go stale.

    Keeping the fun parts

    SEO doesn't have to mean a boring site. The 3D keyboard, GSAP animations and smooth scrolling are still here; they are loaded on the client after the important text is already in the HTML.

    The design is based on the open-source 3d-portfolio by Naresh Khatri (MIT).

    Back to all posts