Listoca

Marketing site

The public website with landing page, pricing, blog, changelog, legal pages, contact form, newsletter and SEO.

apps/marketing is a separate TanStack Start app for everything people see before they sign up. It's prerendered to static HTML at build time, so it's fast and cheap to host. The SaaS app (apps/web) stays behind the login.

bun run dev:marketing   # http://localhost:3022 (also started by `bun run dev`)
VariableDefaultUsed for
VITE_SITE_URLhttp://localhost:3022canonical URLs, sitemap, share images
VITE_SITE_INDEXABLEtruefalse keeps a staging copy out of search engines
VITE_SAAS_URLhttp://localhost:3021sign-in, sign-up and the pricing handoff
VITE_SUPABASE_URL, VITE_SUPABASE_KEYthe local stackthe contact and newsletter forms (Edge Functions, publishable key)
VITE_DOCS_URLhttp://localhost:3024/docsthe docs link in the header and footer

App name, themes and these URLs are collected in apps/marketing/src/config.ts.

Pages and languages

Every page lives under src/routes/{-$locale}/. The language is the first URL segment: /pricing is the default language (English), /de/pricing is German, and /en/… or unknown languages are 404s. The language switcher keeps the current page.

RouteContent
/landing: hero with a picture of the app, features, plans, CTA
/pricingplans from packages/payments, FAQ
/blog, /blog/<slug>, /blog/tags/<tag>MDX posts; the index ends with the newsletter signup
/rss.xml, /de/rss.xmlRSS feed per language
/changelogMDX entries, newest first
/legal/<slug>privacy, terms, cookies, imprint
/contactcontact form
/sitemap.xml, /robots.txt, /og/<path>.pngSEO, see below

All copy is in the i18n marketing scope (packages/i18n/translations/<locale>/marketing.json). Plan names and features come from the shared scope (pricing.*), so the pricing page and the app's billing page always match.

To add a page, add a route under {-$locale}/, its text to the marketing scope, an entry in the page catalog (sitePages(), see SEO), and a link in the header or footer.

Content is MDX in apps/marketing/content/, compiled by fumadocs-mdx (the same pipeline as these docs). Files are named <slug>.<locale>.mdx:

content/
  posts/introducing-the-template.en.mdx
  posts/introducing-the-template.de.mdx
  changelog/2026-10-23-marketing-site.en.mdx
  legal/privacy.en.mdx

A page in a language without its own file shows the default language's file. Search engines are pointed at the original (canonical link), and the sitemap and the RSS feed list it only in its own language.

Post frontmatter:

---
title: Introducing Listoca
excerpt: Shown in the post list, the RSS feed and link previews.
date: 2026-10-20
authorName: Ada Lovelace
authorImage: /images/ada.jpg # optional
image: /images/launch.png # optional; replaces the generated share image
tags: [announcement, product]
published: true # false hides the post everywhere (list, tags, RSS, sitemap)
---

Changelog entries take title, date and an optional version. Legal pages take title, updatedAt and an optional order (their place in the footer). A new legal file is a new page with its footer link; there's nothing else to register. The legal texts are written for Listoca (a sole proprietor in Germany, the Sync plan through the stores). They still carry fields in capitals and square brackets ([NAME], [HOSTING PROVIDER], …) for facts only the operator knows: fill them in, and have the texts reviewed, before you launch.

Using a CMS: everything reads posts through src/lib/posts.ts (getAllPosts, getPost, getPostsByTag, getAllTags). Reimplement those functions against your CMS and keep the returned shape.

Pricing

The pricing page shows the plans from packages/payments/src/config.ts with the config's display prices, and a note that the app shows prices in the store's currency. The store buttons are the call to action. With Web Billing (the payments-web part), paid plans also get a "Buy on the web" link to the web app's account page; signed-out visitors sign in or up first and come back to it.

Contact form and newsletter

Both forms post to public Edge Functions (packages/functions) with the publishable key:

FunctionDoes
contactqueues the message as an email to CONTACT_EMAIL (template contactRequest)
newsletter-subscribestores the address with a token and emails the confirmation link
newsletter-confirmadds the address at the provider from NEWSLETTER_PROVIDER once the link is used

The forms and the functions check the same schema (packages/mail/src/forms.ts). Emails go through email_outbox, so locally they land in Mailpit (http://localhost:3044) within a minute.

Spam protection:

  • Rate limit: each address may submit each form 5 times an hour. There is no server memory between function calls, so the counter is a row in rate_limits, counted by public.hit_rate_limit().
  • Honeypot: a hidden website field. Requests that fill it get a success, but nothing is sent.

Double opt-in: anyone can type any address into the form, so a sign-up reaches the provider only after that inbox confirms it. The email links to /newsletter/confirm?token=… on the marketing site (/de/… for German), where a button posts the token. A link that confirmed on its own would be confirmed by mail scanners that open every link. The token is stored hashed, and unconfirmed sign-ups are deleted after 7 days. Subscribing an address that's already on the list answers the same and sends nothing.

Function settings (supabase/config.toml locally, the Edge Runtime's env in production):

VariableNotes
CONTACT_EMAILreceives contact messages; without it the form answers an error
NEWSLETTER_PROVIDERconsole (logs), resend or loops
RESEND_NEWSLETTER_SEGMENT_IDoptional segment for new Resend contacts (uses RESEND_API_KEY, which needs Full access, Emails)
LOOPS_API_KEYfor loops

Adding a newsletter provider: write a NewsletterProvider (subscribe({ email })) in packages/mail/src/newsletter/, add its name to newsletterProviders and a case in createNewsletter() (packages/mail/src/newsletter.ts), then add it to NEWSLETTER_PROVIDER in packages/functions/src/env.ts.

SEO

The page catalog (src/lib/catalog.ts, sitePages()) lists every page of the site: its path, the languages it's written in, and its title and description. Legal pages come from the content files; the home page and the contact page are one entry each. Everything else is built from it, and catalog.test.ts checks it against the files:

  • Head tags: each route has head: ({ params }) => pageHead(params, "/contact"). It sets the title (documentTitle() → "Get in touch – Listoca"; the home page's title already names the app and stays as it is), description, robots, canonical URL, hreflang alternates (plus x-default), OpenGraph and Twitter cards. seo() in src/lib/seo.ts builds the tags if you need them elsewhere.
  • Share images: /og/<path>.png (/og/index.png, /og/de/contact.png) renders the page's title and description as a 1200×630 image with takumi, in the site's colors and Instrument Sans (bundled into the module from @fontsource-variable/instrument-sans). Change the design in src/lib/og-image.tsx.
  • Structured data: pageHead() adds JSON-LD on the home page (src/lib/structured-data.ts): the organization, the site and the app with its plans as offers. organization.sameAs and app.category in config.ts fill it in. No ratings that don't exist, and no FAQ markup: Google shows none.
  • Sitemap: /sitemap.xml lists every page in each language it's written in, with the same hreflang alternates as its head and, for legal pages, the day they last changed (updatedAt). /join is not in it, and says noindex.
  • Footer: the legal links are every legal page, by its title (legalLinks()).
  • robots.txt allows everything and points at the sitemap. A page kept out of results says noindex itself; never Disallow it, or crawlers can't read that.
  • Headings and length: every page has one h1. catalog.test.ts fails on a title over 60 characters with the name, a description under 70 or over 160, or two pages sharing either; give legal pages a description in their front matter.
  • Staging: built with VITE_SITE_INDEXABLE=false, every page says noindex, nofollow, the sitemap is empty and robots.txt names none.
  • Checks: apps/marketing/tests/seo.spec.ts opens every page in the sitemap the way a search engine does. After a deployment, bun run seo:check https://<site> asks the same of the live site, plus the redirects (deploy/README.md).

Build and deploy

bun run --cwd apps/marketing build   # prerenders every page into .output/public
bun apps/marketing/.output/server/index.mjs
  • The build follows links from / and prerenders every page it finds, plus the sitemap and robots.txt. It runs on Bun (bun --bun vp build), because the Bun server answers the prerender requests.
  • Pages and assets are stored precompressed (brotli, gzip).
  • The server serves the static files and renders share images on request.
  • docker compose up marketing builds the same image (apps/marketing/Dockerfile). The VITE_* URLs are build arguments, because they're baked into the prerendered HTML.

The landing page scores 95+ for performance and 100 for accessibility, best practices and SEO in Lighthouse on the prerendered build.

On this page