Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions apps/site/src/app/pricing/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
import { JsonLd } from "@/components/json-ld";
import { createFaqStructuredData } from "@/lib/structured-data";
import { createPricingStructuredData } from "@/lib/structured-data";
import type { Metadata } from "next";
import { Accordion, Accordions, Button } from "@prisma/eclipse";
import { faqs } from "./pricing-data";
import { PricingPageContent } from "./pricing-page-content";

const pricingFaqStructuredData = createFaqStructuredData("/pricing", faqs, "Prisma pricing FAQ");
const pricingStructuredData = createPricingStructuredData([
{
name: "Free",
description: "Perfect for that weekend idea. 100,000 operations and 500 MB storage included.",
price: 0,
billingPeriod: "month",
},
{
name: "Starter",
description: "The basics you need to launch. 1,000,000 operations and 10 GB storage included.",
price: 10,
billingPeriod: "month",
},
{
name: "Pro",
description: "Growing for business success. 10,000,000 operations and 50 GB storage included.",
price: 49,
billingPeriod: "month",
},
{
name: "Business",
description: "For mission-critical apps. 50,000,000 operations and 100 GB storage included.",
price: 129,
billingPeriod: "month",
},
]);

export const metadata: Metadata = {
title: "Pricing — Prisma Postgres Plans & Features",
Expand Down Expand Up @@ -37,7 +62,7 @@ export const metadata: Metadata = {
export default function PricingPage() {
return (
<main className="flex-1 w-full -mt-24 bg-background-default text-background-neutral-weak pt-24">
<JsonLd id="pricing-faq-structured-data" data={pricingFaqStructuredData} />
<JsonLd id="pricing-structured-data" data={pricingStructuredData} />
<PricingPageContent />

{/* FAQ */}
Expand Down
56 changes: 56 additions & 0 deletions apps/site/src/lib/structured-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ type FaqEntry = {
answer: string;
};

type PricingTier = {
name: string;
description: string;
price: number;
billingPeriod: string;
};

type ListEntry = {
name: string;
url: string;
Expand Down Expand Up @@ -83,6 +90,55 @@ export function createFaqStructuredData(pagePath: string, faqs: FaqEntry[], name
};
}

export function createPricingStructuredData(tiers: PricingTier[]) {
const url = absoluteUrl("/pricing");
const baseUrl = getBaseUrl();
return {
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebPage",
"@id": `${url}#webpage`,
name: "Prisma Pricing — Plans & Features",
url,
description:
"Get started for free with Prisma Postgres. Choose the right plan for your workspace based on your project requirements.",
publisher: {
"@id": `${baseUrl}#organization`,
},
isPartOf: {
"@id": `${baseUrl}#website`,
},
},
...tiers.map((tier) => ({
"@type": "Product",
name: `Prisma Postgres ${tier.name}`,
description: tier.description,
brand: {
"@id": `${baseUrl}#organization`,
},
offers: {
"@type": "Offer",
url,
priceCurrency: "USD",
price: tier.price,
priceValidUntil: new Date(
new Date().getFullYear() + 1,
new Date().getMonth(),
new Date().getDate(),
)
.toISOString()
.split("T")[0],
availability: "https://schema.org/InStock",
...(tier.price > 0
? { priceSpecification: { "@type": "UnitPriceSpecification", billingDuration: "P1M" } }
: {}),
},
})),
],
};
}

export function createSoftwareApplicationStructuredData({
path,
name,
Expand Down
Loading