From 1054200970586612a42fa0e6beb9504e6cd492bd Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 5 Aug 2026 17:32:36 +0530 Subject: [PATCH 1/5] feat(site): add public Compute template directory Linear: DR-8815 --- apps/site/src/app/layout.tsx | 6 +- apps/site/src/app/templates/page.tsx | 172 +++++++++++++++++++++++++++ 2 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 apps/site/src/app/templates/page.tsx diff --git a/apps/site/src/app/layout.tsx b/apps/site/src/app/layout.tsx index 6461277dacd..a23f49e8391 100644 --- a/apps/site/src/app/layout.tsx +++ b/apps/site/src/app/layout.tsx @@ -9,7 +9,6 @@ import Script from "next/script"; import type React from "react"; import { SITE_HOME_DESCRIPTION, SITE_HOME_TITLE } from "@/lib/site-metadata"; import { NavigationWrapper, FooterWrapper } from "@/components/navigation-wrapper"; -import { Footer } from "@prisma-docs/ui/components/footer"; import { JsonLd } from "@prisma-docs/ui/components/json-ld"; import { GoogleTagManager } from "@prisma-docs/ui/components/google-tag-manager"; import { ThemeProvider } from "@prisma-docs/ui/components/theme-provider"; @@ -145,6 +144,11 @@ function baseOptions() { icon: "fa-regular fa-grid-2", external: true, }, + { + text: "Templates", + url: "/templates", + icon: "fa-regular fa-layer-group", + }, { text: "Stack", url: "/stack", diff --git a/apps/site/src/app/templates/page.tsx b/apps/site/src/app/templates/page.tsx new file mode 100644 index 00000000000..1975044f63e --- /dev/null +++ b/apps/site/src/app/templates/page.tsx @@ -0,0 +1,172 @@ +import { createPageMetadata } from "@/lib/page-metadata"; +import { Badge, Button, Card } from "@prisma/eclipse"; +import { z } from "zod"; + +const TEMPLATE_MANIFEST_URL = + "https://raw.githubusercontent.com/prisma/prisma-examples/latest/compute/templates.json"; + +const templateManifestSchema = z.object({ + version: z.literal(1), + templates: z.array( + z.object({ + id: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/), + name: z.string().trim().min(1), + description: z.string().trim().min(1), + path: z.string().regex(/^compute\/[a-z0-9]+(?:[/-][a-z0-9]+)*$/), + }), + ), +}); + +export const metadata = createPageMetadata({ + title: "Prisma Compute templates", + description: + "Browse open-source TypeScript starters and deploy one with Prisma Postgres and Prisma Compute.", + path: "/templates", +}); + +async function getTemplates() { + try { + const response = await fetch(TEMPLATE_MANIFEST_URL, { + next: { revalidate: 300 }, + }); + if (!response.ok) return []; + + const result = templateManifestSchema.safeParse(await response.json()); + return result.success ? result.data.templates : []; + } catch { + return []; + } +} + +export default async function TemplatesPage() { + const templates = await getTemplates(); + + return ( +
+
+ +
+
+ + + PRISMA COMPUTE TEMPLATES + + } + /> +

+ Start with working code. Deploy in minutes. +

+

+ Review the source, choose a framework, then let Prisma set up the GitHub repository, + Postgres database, and first Compute deployment. +

+
    + {[ + ["fa-brands fa-github", "GitHub repository"], + ["fa-regular fa-cube", "Prisma project"], + ["fa-regular fa-database", "Postgres database"], + ["fa-regular fa-rocket", "Compute deployment"], + ].map(([icon, label]) => ( +
  • + + {label} +
  • + ))} +
+
+
+ +
+
+
+

+ Choose your starting point +

+

+ Every starter is open source. Inspect the code, then open the guided setup when it + fits your project. +

+
+ + {templates.length > 0 ? ( +
+ {templates.map((template) => { + const deployUrl = new URL(`/templates/${template.id}`, "https://console.prisma.io"); + deployUrl.searchParams.set("utm_source", "website"); + deployUrl.searchParams.set("utm_medium", "templates"); + + return ( + +
+
+ + + + +
+ +
+

+ {template.name} +

+

+ {template.description} +

+
+
+ + +
+ ); + })} +
+ ) : ( + + + + +

Templates are unavailable

+

+ We could not load the template directory. Please try again in a few minutes. +

+
+ )} +
+
+
+ ); +} From 863f9967cd0bd777d659a02c18d71dde327ccc9c Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 5 Aug 2026 19:35:32 +0530 Subject: [PATCH 2/5] fix(site): harden template directory Linear: DR-8815 --- apps/site/src/app/templates/page.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/site/src/app/templates/page.tsx b/apps/site/src/app/templates/page.tsx index 1975044f63e..564baa0fae3 100644 --- a/apps/site/src/app/templates/page.tsx +++ b/apps/site/src/app/templates/page.tsx @@ -28,6 +28,7 @@ async function getTemplates() { try { const response = await fetch(TEMPLATE_MANIFEST_URL, { next: { revalidate: 300 }, + signal: AbortSignal.timeout(10_000), }); if (!response.ok) return []; @@ -70,7 +71,7 @@ export default async function TemplatesPage() {