# Project Architecture

## Overview
Marketing site powered by Astro + React islands + Tailwind CSS v4. The homepage lives at `src/pages/index.astro`, focused SEO/GEO landing pages live under `src/pages/*.astro`, and `src/pages/try.astro` serves browser-provisioned instance results. SEO crawler entrypoints are `src/pages/robots.txt.ts` and `src/pages/sitemap.xml.ts`.

## Layout
- astro.config.mjs: Astro config with canonical site URL plus React and Tailwind Vite plugins.
- docs/plans/2026-03-11-seo-geo-landing-pages-design.md: Design note for the SEO/GEO landing-page expansion.
- src/layouts/MarketingLayout.astro: Shared page shell for HTML head tags, canonical URLs, social meta, GTM, and JSON-LD serialization.
- src/content/landingContent.js: Shared metadata and copy model for landing pages, homepage search-intent cards, and the use-case hub.
- src/content/schema.js: Small helpers that build FAQ, breadcrumb, and article-style schema objects.
- src/pages/index.astro: Main landing page with richer structured data for homepage SEO/GEO.
- src/pages/agent-memory.astro: Focused landing page for AI agent memory and SQL memory-store search intent.
- src/pages/mcp-server-database.astro: Focused landing page for MCP server database and tool-backend search intent.
- src/pages/serverless-mysql-vector.astro: Focused landing page for serverless MySQL, vector search, and RAG-related search intent.
- src/pages/use-cases.astro: Use-case hub that clusters long-tail temporary database and AI workflow queries.
- src/pages/try.astro: `/try` route that mounts the browser result view and marks the session page as `noindex`.
- src/pages/SKILL.md.ts: `/SKILL.md` endpoint that returns Agent SKILL markdown for API usage.
- src/pages/robots.txt.ts: `/robots.txt` endpoint that advertises crawl rules and the sitemap URL.
- src/pages/sitemap.xml.ts: `/sitemap.xml` endpoint that lists canonical public landing pages.
- src/components/App.jsx: Main interactive homepage UI component with hero CTAs, CLI quickstart accordion, and browser provisioning flow.
- src/components/MarketingChrome.astro: Shared nav/footer chrome for static landing pages.
- src/components/TryResult.jsx: Client-side result page that loads a provisioned instance from `sessionStorage`, shows connection details, and links to claim.
- src/components/UseCaseLanding.astro: Shared renderer for focused use-case landing pages.
- src/components/appContent.js: Static homepage content for the CLI quickstart, demo cards, and FAQ entries, extracted from `App.jsx` to keep presentation logic smaller and content easier to curate.
- src/lib/analytics.js: Lightweight GTM/GA4 helpers for session attribution, page-view enrichment, and custom event pushes.
- src/styles/global.css: Tailwind CSS v4 entry.
- public/favicon.ico: Site favicon served as `/favicon.ico`.
- package.json: scripts and dependencies.

## Browser Provisioning Flow
- Homepage `Try in Browser` CTA creates a TiDB Cloud Zero instance with `tag: "try-in-browser"`.
- The full API response is stored in `sessionStorage` under `tidb-zero-instance:<instance.id>` so secrets stay out of the URL.
- The browser then opens `/try?id=<instance.id>`.
- `src/components/TryResult.jsx` reads the `id` query param, looks up the stored payload, and renders the connection string, claim action, expiration, and fallback UI if the session data is missing.
