DEV Community

Andy
Andy

Posted on

Architecting Static Comparison Micro-Sites with TypeScript and JSON-LD Schema

When building vertical web applications, separating feature comparisons into standalone, fast-loading micro-sites is an effective way to keep your core application bundle lean while addressing specific user intents.

Recently, while building out supporting comparison pages for an educational test simulator, I designed a reusable data schema in TypeScript to render head-to-head feature matrices and inject structured JSON-LD data automatically.

Here is the architectural pattern and data model used to build these static comparison micro-sites.

1. Defining the Comparison Data Model in TypeScript

Instead of hardcoding HTML tables for each competitor analysis, defining a strict TypeScript interface ensures every micro-site renders consistent evaluation metrics (pricing model, learning format, regulatory updates, and pass guarantees):

export interface ComparisonMetric {
  featureName: string;
  primaryPlatformValue: string | boolean;
  competitorValue: string | boolean;
  highlightAdvantage?: boolean;
}

export interface ComparisonSiteConfig {
  slug: string;
  title: string;
  competitorCategory: 'legacy-portal' | 'career-directory' | 'trade-school';
  lastUpdatedYear: number;
  metrics: ComparisonMetric[];
}
Enter fullscreen mode Exit fullscreen mode

By typing the competitorCategory, the UI components can dynamically adjust the layout depending on whether we are comparing two software tools or comparing digital self-study against an offline curriculum.

2. Live Production Deployments (Built on Lovable)

Using this modular structure, I deployed three separate micro-sites targeting different segments of the HVAC certification space:

3. Automating FAQ & Comparison JSON-LD Schema

To help search engines and AI answer engines parse the comparison matrices accurately, each micro-site injects a structured FAQPage and WebPage JSON-LD payload into the document head:

TypeScript

export function ComparisonSchema({ title, url, description }: { title: string; url: string; description: string }) {
  const schemaData = {
    "@context": "https://schema.org",
    "@type": "WebPage",
    "name": title,
    "url": url,
    "description": description,
    "specialty": "EPA Section 608 Certification Prep"
  };

  return (
    <script
      type="application/ld+json"
      dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaData) }}
    />
  );
}
Enter fullscreen mode Exit fullscreen mode

Key Takeaways for Frontend Builders

  1. Decouple Content from Layout: A shared TypeScript schema lets you spin up multiple comparison landing pages in minutes.
  2. Keep Micro-Sites Focused: Rather than building one massive table comparing ten different business models, isolating each comparison into its own deployment keeps page speed high and user intent clear.

Top comments (1)

Collapse
 
ivannovazzi profile image
Ivan Annovazzi •

The highlightAdvantage flag made me laugh, every row is rigged so your side wins. Do these micro-sites rank though? Feels like exactly the thin programmatic content Google says it hates, curious if the structured data is enough to pull real traffic anyway