Skip to content

Canvix — Free & open-source graphic design tool. A community-built Canva alternative with a drag-and-drop editor, templates, shapes, text, images & one-click export. Works on desktop, tablet & mobile.

feat(seo): make canvix.app discoverable — OG/share image, canonical, sitemap, structured data

Ashiq Hussain Mir9e35c0d4fb47
diff --git a/public/og.png b/public/og.png
new file mode 100644
index 0000000..e7ea3f7
Binary files /dev/null and b/public/og.png differ
diff --git a/public/robots.txt b/public/robots.txt
index d73f049..6da7ad5 100644
--- a/public/robots.txt
+++ b/public/robots.txt
@@ -1,14 +1,22 @@
# Canvix — the app is a single client-rendered page; /api/ is private
# machinery (designs, auth, AI, collab streams) that crawlers should
# never enumerate. v0.9.2: politely keeps crawlers off metered routes.
+# v0.23.3 (SEO): Sitemap line so crawlers discover /sitemap.xml; also
+# keeps crawlers out of the per-user share routes and the admin console.
+
+Sitemap: https://canvix.app/sitemap.xml
User-agent: Googlebot
Allow: /
Disallow: /api/
+Disallow: /design/
+Disallow: /admin
User-agent: Bingbot
Allow: /
Disallow: /api/
+Disallow: /design/
+Disallow: /admin
User-agent: Twitterbot
Allow: /
@@ -21,3 +29,5 @@ Disallow: /api/
User-agent: *
Allow: /
Disallow: /api/
+Disallow: /design/
+Disallow: /admin
diff --git a/src/app/admin/layout.tsx b/src/app/admin/layout.tsx
index be547f3..8ca6665 100644
--- a/src/app/admin/layout.tsx
+++ b/src/app/admin/layout.tsx
@@ -3,6 +3,14 @@ import { getSessionUserFromToken, SESSION_COOKIE } from '@/lib/auth/session'
import { isAdminUser } from '@/lib/admin/guard'
import { AdminShell } from '@/components/admin/AdminShell'
import { AdminDenied } from '@/components/admin/AdminDenied'
+import type { Metadata } from 'next'
+
+// v0.23.3 (SEO): the admin console is operator machinery — keep it out of
+// every index. (Defence in depth: the route also sits behind this auth gate.)
+export const metadata: Metadata = {
+ title: 'Admin',
+ robots: { index: false, follow: false, nocache: true },
+}
// The server-side gate (v0.16 A1). Every /admin page renders inside
// this layout, so the check runs before any child fetch; the API
diff --git a/src/app/design/[id]/layout.tsx b/src/app/design/[id]/layout.tsx
new file mode 100644
index 0000000..5c3cf3e
--- /dev/null
+++ b/src/app/design/[id]/layout.tsx
@@ -0,0 +1,16 @@
+import type { Metadata } from "next";
+
+/**
+ * v0.23.3 (SEO): /design/<id> are per-user share links, not public
+ * content — private designs must never appear in search results. The page
+ * itself is 'use client' (v0.11.4 deep links), so the route-level layout
+ * is where the robots directive lives.
+ */
+export const metadata: Metadata = {
+ title: "Design",
+ robots: { index: false, follow: false },
+};
+
+export default function DesignLayout({ children }: { children: React.ReactNode }) {
+ return children;
+}
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index e5dc262..2b151b5 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -2,20 +2,39 @@ import type { Metadata, Viewport } from "next";
import "./globals.css";
import { Toaster } from "@/components/ui/toaster";
+/**
+ * v0.23.3 (SEO/social): the site was invisible to link previews and barely
+ * indexed — no og:image, twitter:card "summary" (text-only card), no
+ * canonical, no sitemap. This block fixes all four. metadataBase makes
+ * every generated URL (canonical, og:image, sitemap) absolute and correct
+ * in production; SITE_URL is the deployed origin (canvix.app).
+ */
+const SITE_URL =
+ process.env.SITE_URL ?? process.env.NEXT_PUBLIC_SITE_URL ?? "https://canvix.app";
+
export const metadata: Metadata = {
- title: "Canvix — Design anything, free forever",
+ metadataBase: new URL(SITE_URL),
+ title: {
+ default: "Canvix — Design anything, free forever",
+ template: "%s — Canvix",
+ },
description:
"Canvix is a free & open-source graphic design tool. Create social posts, presentations, posters, logos and more with a drag-and-drop editor that works on desktop, tablet and mobile.",
+ applicationName: "Canvix",
keywords: [
"canvix",
"design tool",
"open source",
"canva alternative",
+ "free canva alternative",
"graphic design",
"templates",
"drag and drop editor",
+ "free design tool",
+ "self hosted design tool",
],
authors: [{ name: "Ashiq Hussain Mir" }],
+ alternates: { canonical: "/" },
icons: { icon: "/canvix.svg" },
openGraph: {
title: "Canvix — Design anything, free forever",
@@ -23,6 +42,33 @@ export const metadata: Metadata = {
"Free & open-source graphic design tool. A community-built Canva alternative.",
siteName: "Canvix",
type: "website",
+ url: "/",
+ images: [
+ {
+ url: "/og.png",
+ width: 1200,
+ height: 630,
+ alt: "Canvix — design anything, free for everyone",
+ },
+ ],
+ },
+ twitter: {
+ card: "summary_large_image",
+ title: "Canvix — Design anything, free forever",
+ description:
+ "Free & open-source graphic design tool. A community-built Canva alternative.",
+ images: ["/og.png"],
+ },
+ robots: {
+ index: true,
+ follow: true,
+ googleBot: {
+ index: true,
+ follow: true,
+ "max-image-preview": "large",
+ "max-snippet": -1,
+ "max-video-preview": -1,
+ },
},
};
@@ -50,6 +96,34 @@ export default function RootLayout({
/>
</head>
<body className="antialiased bg-background text-foreground">
+ {/* v0.23.3 (SEO): WebApplication structured data — gives Google a
+ machine-readable identity for the app (name, URL, logo, license,
+ features) so it can build rich results and entity association.
+ Rendered server-side in the layout so every page carries it. */}
+ <script
+ type="application/ld+json"
+ dangerouslySetInnerHTML={{
+ __html: JSON.stringify({
+ "@context": "https://schema.org",
+ "@type": "WebApplication",
+ name: "Canvix",
+ url: SITE_URL,
+ applicationCategory: "DesignApplication",
+ operatingSystem: "Web",
+ description:
+ "Free & open-source graphic design tool. Create social posts, presentations, posters, logos and more with a drag-and-drop editor that works on desktop, tablet and mobile.",
+ image: `${SITE_URL}/og.png`,
+ logo: `${SITE_URL}/canvix.svg`,
+ offers: { "@type": "Offer", price: "0", priceCurrency: "USD" },
+ isAccessibleForFree: true,
+ featureList:
+ "Drag-and-drop editor; 366 free templates; PNG, JPG, WebP, SVG, PDF, PPTX, video and GIF export; AI magic edit, magic write, background removal and translate with your own API keys; real-time collaboration; MCP server for AI agents; self-hosting with Docker",
+ author: { "@type": "Person", name: "Ashiq Hussain Mir" },
+ license: "https://opensource.org/licenses/MIT",
+ sameAs: ["https://github.com/mir-ashiq/canvix"],
+ }),
+ }}
+ />
{children}
<Toaster />
</body>
diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts
new file mode 100644
index 0000000..dce32d6
--- /dev/null
+++ b/src/app/sitemap.ts
@@ -0,0 +1,20 @@
+import type { MetadataRoute } from "next";
+
+/**
+ * v0.23.3 (SEO): the sitemap Google needs to index the site — previously
+ * /sitemap.xml answered with the app shell (HTML), so Search Console had
+ * nothing to read. Only `/` is a real public page: /design/<id> are
+ * per-user share links (not crawlable content) and /admin is private,
+ * both of which are marked noindex in their route layouts.
+ */
+export default function sitemap(): MetadataRoute.Sitemap {
+ const base = process.env.SITE_URL ?? process.env.NEXT_PUBLIC_SITE_URL ?? "https://canvix.app";
+ return [
+ {
+ url: `${base}/`,
+ lastModified: new Date(),
+ changeFrequency: "weekly",
+ priority: 1,
+ },
+ ];
+}