Skip to content

Open source alternative to Semrush and Ahrefs

Port the help pages and Support to shadcn (EVE-299) (#743)

Carter Smith8a623faecc4c
diff --git a/src/client/features/help/SecretHelpPage.tsx b/src/client/features/help/SecretHelpPage.tsx
new file mode 100644
index 00000000..2f199be1
--- /dev/null
+++ b/src/client/features/help/SecretHelpPage.tsx
@@ -0,0 +1,100 @@
+import type { ReactNode } from "react";
+import { CopyButton } from "@/client/components/CopyButton";
+import { PageHeader } from "@/client/components/PageHeader";
+import {
+ Card,
+ CardContent,
+ CardHeader,
+ CardTitle,
+} from "@/client/components/ui/card";
+import { Separator } from "@/client/components/ui/separator";
+
+export const helpLinkClassName =
+ "font-medium text-primary underline underline-offset-4";
+
+/** A terminal command with a copy button. */
+export function CommandBlock({ command }: { command: string }) {
+ return (
+ <div className="mt-2 flex items-center gap-2 rounded-lg border border-border bg-muted p-3">
+ <pre className="min-w-0 flex-1 overflow-x-auto text-xs">
+ <code>{command}</code>
+ </pre>
+ <CopyButton
+ value={command}
+ successMessage="Command copied"
+ label="Copy command"
+ variant="ghost"
+ size="icon-xs"
+ />
+ </div>
+ );
+}
+
+/** Self-hosting instructions for setting one secret. */
+export function SecretHelpPage({
+ title,
+ intro,
+ secretName,
+ steps,
+ dashboardPasteStep,
+ terminalPromptHint,
+}: {
+ title: string;
+ intro: ReactNode;
+ secretName: string;
+ /** The `<li>` items of the "Steps" card. */
+ steps: ReactNode;
+ dashboardPasteStep: ReactNode;
+ terminalPromptHint: ReactNode;
+}) {
+ return (
+ <div className="h-full overflow-auto">
+ <div className="mx-auto w-full max-w-3xl space-y-4 px-4 pt-8 pb-24 sm:px-6 md:pt-12 md:pb-12">
+ <PageHeader title={title} description={intro} />
+
+ <Card>
+ <CardHeader>
+ <CardTitle>
+ <h2>Steps</h2>
+ </CardTitle>
+ </CardHeader>
+ <CardContent>
+ <ol className="list-decimal space-y-3 pl-5">{steps}</ol>
+ </CardContent>
+ </Card>
+
+ <Card>
+ <CardHeader>
+ <CardTitle>
+ <h2>Cloudflare Workers (Dashboard UI)</h2>
+ </CardTitle>
+ </CardHeader>
+ <CardContent className="space-y-3">
+ <ol className="list-decimal space-y-2 pl-5">
+ <li>
+ In Cloudflare, go to <code>Compute</code> -&gt;{" "}
+ <code>Workers &amp; Pages</code> and open your OpenSEO Worker.
+ </li>
+ <li>
+ Open <code>Settings</code>.
+ </li>
+ <li>
+ Go to <code>Variables &amp; Secrets</code> and add a new secret
+ named <code>{secretName}</code>.
+ </li>
+ <li>{dashboardPasteStep}</li>
+ </ol>
+
+ <Separator />
+
+ <div>
+ <p>Or set the same secret from your terminal with:</p>
+ <CommandBlock command={`npx wrangler secret put ${secretName}`} />
+ </div>
+ <p className="text-muted-foreground">{terminalPromptHint}</p>
+ </CardContent>
+ </Card>
+ </div>
+ </div>
+ );
+}
diff --git a/src/routes/_app/help/dataforseo-api-key.tsx b/src/routes/_app/help/dataforseo-api-key.tsx
index 436129da..8befe1d4 100644
--- a/src/routes/_app/help/dataforseo-api-key.tsx
+++ b/src/routes/_app/help/dataforseo-api-key.tsx
@@ -1,4 +1,9 @@
import { createFileRoute } from "@tanstack/react-router";
+import {
+ CommandBlock,
+ helpLinkClassName,
+ SecretHelpPage,
+} from "@/client/features/help/SecretHelpPage";
const DATAFORSEO_API_ACCESS_URL = "https://app.dataforseo.com/api-access";
@@ -8,87 +13,45 @@ export const Route = createFileRoute("/_app/help/dataforseo-api-key")({
function DataforseoApiKeyHelpPage() {
return (
- <div className="px-4 py-4 md:px-6 md:py-6 pb-24 md:pb-8 overflow-auto">
- <div className="mx-auto max-w-3xl space-y-4">
- <div className="card bg-base-100 border border-base-300">
- <div className="card-body gap-3">
- <h1 className="text-2xl font-semibold">
- Set up your DataForSEO API key
- </h1>
- <p className="text-sm text-base-content/70">
- OpenSEO needs the <code>DATAFORSEO_API_KEY</code> secret before
- keyword, domain, and SEO data workflows can run.
- </p>
- </div>
- </div>
-
- <div className="card bg-base-100 border border-base-300">
- <div className="card-body gap-4">
- <h2 className="card-title text-base">Steps</h2>
- <ol className="list-decimal pl-5 text-sm space-y-3 text-base-content/80">
- <li>
- Go to{" "}
- <a
- className="link link-primary"
- href={DATAFORSEO_API_ACCESS_URL}
- target="_blank"
- rel="noreferrer"
- >
- DataForSEO API Access
- </a>{" "}
- and request API credentials by email.
- </li>
- <li>
- Base64 encode your DataForSEO login and API password in this
- format:
- <pre className="mt-2 p-3 rounded bg-base-200 border border-base-300 overflow-x-auto text-xs">
- <code>printf '%s' 'YOUR_LOGIN:YOUR_PASSWORD' | base64</code>
- </pre>
- </li>
- <li>
- Save the output as the <code>DATAFORSEO_API_KEY</code> secret in
- your environment.
- </li>
- </ol>
- </div>
- </div>
-
- <div className="card bg-base-100 border border-base-300">
- <div className="card-body gap-2 text-sm text-base-content/75">
- <h2 className="card-title text-base">
- Cloudflare Workers (Dashboard UI)
- </h2>
- <ol className="list-decimal pl-5 space-y-2 text-sm text-base-content/80">
- <li>
- In Cloudflare, go to <code>Compute</code> -&gt;{" "}
- <code>Workers &amp; Pages</code>
- and open your OpenSEO Worker.
- </li>
- <li>
- Open <code>Settings</code>.
- </li>
- <li>
- Go to <code>Variables &amp; Secrets</code> and add a new secret
- named
- <code className="mx-1">DATAFORSEO_API_KEY</code>.
- </li>
- <li>
- Paste the base64 value from the terminal command above and save.
- </li>
- </ol>
-
- <div className="divider my-1" />
-
- <p>Or set the same secret from your terminal with:</p>
- <pre className="p-3 rounded bg-base-200 border border-base-300 overflow-x-auto text-xs">
- <code>npx wrangler secret put DATAFORSEO_API_KEY</code>
- </pre>
- <p>
- Use the base64 value of <code>login:password</code> when prompted.
- </p>
- </div>
- </div>
- </div>
- </div>
+ <SecretHelpPage
+ title="Set up your DataForSEO API key"
+ intro={
+ <>
+ OpenSEO needs the <code>DATAFORSEO_API_KEY</code> secret before
+ keyword, domain, and SEO data workflows can run.
+ </>
+ }
+ secretName="DATAFORSEO_API_KEY"
+ steps={
+ <>
+ <li>
+ Go to{" "}
+ <a
+ className={helpLinkClassName}
+ href={DATAFORSEO_API_ACCESS_URL}
+ target="_blank"
+ rel="noreferrer"
+ >
+ DataForSEO API Access
+ </a>{" "}
+ and request API credentials by email.
+ </li>
+ <li>
+ Base64 encode your DataForSEO login and API password in this format:
+ <CommandBlock command="printf '%s' 'YOUR_LOGIN:YOUR_PASSWORD' | base64" />
+ </li>
+ <li>
+ Save the output as the <code>DATAFORSEO_API_KEY</code> secret in
+ your environment.
+ </li>
+ </>
+ }
+ dashboardPasteStep="Paste the base64 value from the terminal command above and save."
+ terminalPromptHint={
+ <>
+ Use the base64 value of <code>login:password</code> when prompted.
+ </>
+ }
+ />
);
}
diff --git a/src/routes/_app/help/openrouter-api-key.tsx b/src/routes/_app/help/openrouter-api-key.tsx
index 3f56edbc..378706c0 100644
--- a/src/routes/_app/help/openrouter-api-key.tsx
+++ b/src/routes/_app/help/openrouter-api-key.tsx
@@ -1,4 +1,8 @@
import { createFileRoute } from "@tanstack/react-router";
+import {
+ helpLinkClassName,
+ SecretHelpPage,
+} from "@/client/features/help/SecretHelpPage";
const OPENROUTER_KEYS_URL = "https://openrouter.ai/settings/keys";
@@ -8,99 +12,60 @@ export const Route = createFileRoute("/_app/help/openrouter-api-key")({
function OpenrouterApiKeyHelpPage() {
return (
- <div className="px-4 py-4 md:px-6 md:py-6 pb-24 md:pb-8 overflow-auto">
- <div className="mx-auto max-w-3xl space-y-4">
- <div className="card bg-base-100 border border-base-300">
- <div className="card-body gap-3">
- <h1 className="text-2xl font-semibold">
- Set up your OpenRouter API key
- </h1>
- <p className="text-sm text-base-content/70">
- OpenSEO needs the <code>OPENROUTER_API_KEY</code> secret before AI
- features like SAM, the in-app SEO agent, can run. It is optional —
- everything else in OpenSEO works without it.
- </p>
- </div>
- </div>
-
- <div className="card bg-base-100 border border-base-300">
- <div className="card-body gap-4">
- <h2 className="card-title text-base">Steps</h2>
- <ol className="list-decimal pl-5 text-sm space-y-3 text-base-content/80">
- <li>
- Create an account at{" "}
- <a
- className="link link-primary"
- href="https://openrouter.ai"
- target="_blank"
- rel="noreferrer"
- >
- openrouter.ai
- </a>{" "}
- and add credits (pay-as-you-go, like DataForSEO).
- </li>
- <li>
- Go to{" "}
- <a
- className="link link-primary"
- href={OPENROUTER_KEYS_URL}
- target="_blank"
- rel="noreferrer"
- >
- OpenRouter API Keys
- </a>{" "}
- and click "Create API Key".
- </li>
- <li>
- Save the key as the <code>OPENROUTER_API_KEY</code> secret in
- your environment:
- <ul className="list-disc pl-5 mt-2 space-y-1">
- <li>
- Docker self-hosting: <code>.env</code>
- </li>
- <li>Cloudflare: set it in the Workers UI (see below)</li>
- <li>
- Local development: <code>.env.local</code>
- </li>
- </ul>
- </li>
- <li>Restart OpenSEO.</li>
- </ol>
- </div>
- </div>
-
- <div className="card bg-base-100 border border-base-300">
- <div className="card-body gap-2 text-sm text-base-content/75">
- <h2 className="card-title text-base">
- Cloudflare Workers (Dashboard UI)
- </h2>
- <ol className="list-decimal pl-5 space-y-2 text-sm text-base-content/80">
- <li>
- In Cloudflare, go to <code>Compute</code> -&gt;{" "}
- <code>Workers &amp; Pages</code>
- and open your OpenSEO Worker.
- </li>
+ <SecretHelpPage
+ title="Set up your OpenRouter API key"
+ intro={
+ <>
+ OpenSEO needs the <code>OPENROUTER_API_KEY</code> secret before AI
+ features like SAM, the in-app SEO agent, can run. It is optional —
+ everything else in OpenSEO works without it.
+ </>
+ }
+ secretName="OPENROUTER_API_KEY"
+ steps={
+ <>
+ <li>
+ Create an account at{" "}
+ <a
+ className={helpLinkClassName}
+ href="https://openrouter.ai"
+ target="_blank"
+ rel="noreferrer"
+ >
+ openrouter.ai
+ </a>{" "}
+ and add credits (pay-as-you-go, like DataForSEO).
+ </li>
+ <li>
+ Go to{" "}
+ <a
+ className={helpLinkClassName}
+ href={OPENROUTER_KEYS_URL}
+ target="_blank"
+ rel="noreferrer"
+ >
+ OpenRouter API Keys
+ </a>{" "}
+ and click "Create API Key".
+ </li>
+ <li>
+ Save the key as the <code>OPENROUTER_API_KEY</code> secret in your
+ environment:
+ <ul className="mt-2 list-disc space-y-1 pl-5">
<li>
- Open <code>Settings</code>.
+ Docker self-hosting: <code>.env</code>
</li>
+ <li>Cloudflare: set it in the Workers UI (see below)</li>
<li>
- Go to <code>Variables &amp; Secrets</code> and add a new secret
- named
- <code className="mx-1">OPENROUTER_API_KEY</code>.
+ Local development: <code>.env.local</code>
</li>
- <li>Paste your OpenRouter API key and save.</li>
- </ol>
-
- <div className="divider my-1" />
-
- <p>Or set the same secret from your terminal with:</p>
- <pre className="p-3 rounded bg-base-200 border border-base-300 overflow-x-auto text-xs">
- <code>npx wrangler secret put OPENROUTER_API_KEY</code>
- </pre>
- <p>Paste your OpenRouter API key when prompted.</p>
- </div>
- </div>
- </div>
- </div>
+ </ul>
+ </li>
+ <li>Restart OpenSEO.</li>
+ </>
+ }
+ dashboardPasteStep="Paste your OpenRouter API key and save."
+ terminalPromptHint="Paste your OpenRouter API key when prompted."
+ />
);
}
diff --git a/src/routes/_app/support.tsx b/src/routes/_app/support.tsx
index e759af0d..3f861f05 100644
--- a/src/routes/_app/support.tsx
+++ b/src/routes/_app/support.tsx
@@ -1,7 +1,13 @@
import { createFileRoute } from "@tanstack/react-router";
-import { Check, Copy } from "lucide-react";
-import { useState } from "react";
-import { toast } from "sonner";
+import { CopyButton } from "@/client/components/CopyButton";
+import { PageHeader } from "@/client/components/PageHeader";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "@/client/components/ui/card";
import { SUPPORT_EMAIL } from "@/client/lib/support";
const DISCORD_URL = "https://discord.gg/c9uGs3cFXr";
@@ -12,87 +18,82 @@ export const Route = createFileRoute("/_app/support")({
});
function SupportPage() {
- const [copied, setCopied] = useState(false);
-
- const handleCopy = async () => {
- try {
- await navigator.clipboard.writeText(SUPPORT_EMAIL);
- } catch {
- toast.error("Could not copy to clipboard");
- return;
- }
- toast.success("Email copied to clipboard");
- setCopied(true);
- setTimeout(() => setCopied(false), 2000);
- };
-
return (
- <div className="h-full overflow-auto px-4 py-8 pb-24 md:px-6 md:py-12 md:pb-8">
- <div className="mx-auto max-w-xl">
- <p className="text-sm font-medium text-base-content/40">
- Help & Community
- </p>
- <h1 className="mt-1 text-2xl font-bold tracking-tight">
- We want to hear from you
- </h1>
- <p className="mt-2 text-sm text-base-content/60">
- We want to talk to you! We're super open to feedback and want to learn
- how you work so we can make OpenSEO better.
- </p>
+ <div className="h-full overflow-auto">
+ <div className="mx-auto w-full max-w-xl space-y-8 px-4 pt-8 pb-24 sm:px-6 md:pt-12 md:pb-12">
+ <div className="space-y-1">
+ <p className="text-sm font-medium text-muted-foreground">
+ Help & Community
+ </p>
+ <PageHeader
+ title="We want to hear from you"
+ description="We want to talk to you! We're super open to feedback and want to learn how you work so we can make OpenSEO better."
+ />
+ </div>
- <div className="mt-8 space-y-3">
- <div className="rounded-lg border border-base-300 bg-base-100 px-5 py-4">
- <p className="text-sm font-semibold">Email</p>
- <p className="mt-1 text-sm text-base-content/60">
- Send ideas, problems, questions, or feedback directly.
- </p>
- <button
- type="button"
- onClick={handleCopy}
- className="mt-3 inline-flex items-center gap-2 rounded-md border border-base-300 bg-base-200/50 px-3 py-1.5 text-sm font-medium text-base-content transition-colors hover:bg-base-200"
- >
- <span className="font-mono text-xs">{SUPPORT_EMAIL}</span>
- {copied ? (
- <Check className="size-3.5 text-success" />
- ) : (
- <Copy className="size-3.5 text-base-content/40" />
- )}
- </button>
- </div>
+ <div className="space-y-3">
+ <Card>
+ <CardHeader>
+ <CardTitle>
+ <h2>Email</h2>
+ </CardTitle>
+ <CardDescription>
+ Send ideas, problems, questions, or feedback directly.
+ </CardDescription>
+ </CardHeader>
+ <CardContent>
+ <CopyButton
+ value={SUPPORT_EMAIL}
+ label={SUPPORT_EMAIL}
+ successMessage="Email copied to clipboard"
+ size="sm"
+ />
+ </CardContent>
+ </Card>
- <a
+ <SupportLinkCard
href={DISCORD_URL}
- target="_blank"
- rel="noreferrer"
- className="block rounded-lg border border-base-300 bg-base-100 px-5 py-4 transition-colors hover:border-base-content/20"
- >
- <p className="text-sm font-semibold">Discord</p>
- <p className="mt-1 text-sm text-base-content/60">
- Ask for help, share ideas and learn from the community.
- </p>
- <span className="mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-base-content">
- Join the Discord
- <span aria-hidden="true">&rarr;</span>
- </span>
- </a>
+ title="Discord"
+ description="Ask for help, share ideas and learn from the community."
+ cta="Join the Discord"
+ />
- <a
+ <SupportLinkCard
href={`${GITHUB_URL}/issues`}
- target="_blank"
- rel="noreferrer"
- className="block rounded-lg border border-base-300 bg-base-100 px-5 py-4 transition-colors hover:border-base-content/20"
- >
- <p className="text-sm font-semibold">GitHub Issues</p>
- <p className="mt-1 text-sm text-base-content/60">
- Report bugs or request features on GitHub.
- </p>
- <span className="mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-base-content">
- Open an issue
- <span aria-hidden="true">&rarr;</span>
- </span>
- </a>
+ title="GitHub Issues"
+ description="Report bugs or request features on GitHub."
+ cta="Open an issue"
+ />
</div>
</div>
</div>
);
}
+
+function SupportLinkCard({
+ href,
+ title,
+ description,
+ cta,
+}: {
+ href: string;
+ title: string;
+ description: string;
+ cta: string;
+}) {
+ return (
+ <a href={href} target="_blank" rel="noreferrer" className="group block">
+ <Card className="transition-colors group-hover:border-foreground/20">
+ <CardHeader>
+ <CardTitle>
+ <h2>{title}</h2>
+ </CardTitle>
+ <CardDescription>{description}</CardDescription>
+ </CardHeader>
+ <CardContent className="font-medium">
+ {cta} <span aria-hidden="true">&rarr;</span>
+ </CardContent>
+ </Card>
+ </a>
+ );
+}