feat: add landing page + builtins Worker + BETA_TEST guide + README

- landing/: Next.js 15 app for arcrun.dev (dashboard, integrations,
  API docs, login). Deploys via Cloudflare Pages — CI scan skips
  this via pages_build_output_dir marker.
- builtins/: minimal Hono Worker at arcrun-builtins (/init for
  one-shot component registry seeding). initComponents logic is
  flagged stale in src/index.ts for future rewrite.
- BETA_TEST.md: pre-launch validation playbook.
- README.md: updated to match current arcrun.dev / acr CLI flow.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-20 17:52:41 +08:00
parent 13b01328c1
commit 4516cdee4b
34 changed files with 5203 additions and 23 deletions
+41
View File
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env*
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
+1
View File
@@ -0,0 +1 @@
legacy-peer-deps=true
+5
View File
@@ -0,0 +1,5 @@
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
<!-- END:nextjs-agent-rules -->
+1
View File
@@ -0,0 +1 @@
@AGENTS.md
+36
View File
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
+112
View File
@@ -0,0 +1,112 @@
'use client';
import { useEffect, useRef } from 'react';
import Link from 'next/link';
const API_BASE = process.env.NEXT_PUBLIC_API_BASE ?? 'https://cypher.arcrun.dev';
export default function ApiDocsPage() {
const containerRef = useRef<HTMLDivElement>(null);
const initialized = useRef(false);
useEffect(() => {
if (initialized.current || !containerRef.current) return;
initialized.current = true;
// Dynamically load Swagger UI from CDN
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui.css';
document.head.appendChild(link);
const script = document.createElement('script');
script.src = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js';
script.onload = () => {
const SwaggerUIBundle = (window as unknown as { SwaggerUIBundle: (opts: unknown) => void }).SwaggerUIBundle;
if (!SwaggerUIBundle || !containerRef.current) return;
SwaggerUIBundle({
url: `${API_BASE}/docs`,
dom_id: '#swagger-ui',
presets: [(window as unknown as { SwaggerUIBundle: { presets: { apis: unknown } } }).SwaggerUIBundle.presets.apis],
layout: 'BaseLayout',
defaultModelsExpandDepth: -1,
docExpansion: 'list',
filter: true,
tryItOutEnabled: true,
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
requestInterceptor: (request: { headers: Record<string, string> }) => {
// Inject API key from localStorage if present
const key = localStorage.getItem('arcrun_api_key');
if (key) request.headers['X-Arcrun-API-Key'] = key;
return request;
},
});
};
document.head.appendChild(script);
return () => {
// cleanup not strictly needed for page navigation
};
}, []);
return (
<div className="min-h-screen bg-[#0a0a0a] text-[#ededed]">
{/* Nav */}
<nav className="flex items-center justify-between px-6 py-4 border-b border-[#1a1a1a]">
<Link href="/" className="text-white font-bold text-lg tracking-tight hover:opacity-80 transition-opacity">
arcrun
</Link>
<div className="flex items-center gap-4 text-sm">
<Link href="/integrations" className="text-[#666] hover:text-white transition-colors">Integrations</Link>
<Link href="/dashboard" className="text-[#666] hover:text-white transition-colors">Dashboard</Link>
<Link href="/login"
className="bg-indigo-600 hover:bg-indigo-500 text-white px-4 py-1.5 rounded-md text-sm font-medium transition-colors">
Get API Key
</Link>
</div>
</nav>
{/* Header */}
<div className="max-w-5xl mx-auto px-6 py-8">
<h1 className="text-2xl font-bold text-white mb-2">API Reference</h1>
<p className="text-[#555] text-sm mb-2">
arcrun APIPython / JS lib HTTP request
</p>
<p className="text-[#444] text-xs mb-6">
Endpoint: <span className="font-mono text-[#666]">{API_BASE}</span>
</p>
{/* API Key hint */}
<div className="bg-[#111] border border-[#222] rounded-lg p-4 mb-8 text-sm">
<p className="text-[#666] mb-2">
API API Key
</p>
<ApiKeyInput />
</div>
{/* Swagger UI */}
<div className="bg-white rounded-xl overflow-hidden" ref={containerRef}>
<div id="swagger-ui" className="min-h-96"></div>
</div>
</div>
</div>
);
}
function ApiKeyInput() {
return (
<div className="flex gap-2">
<input
type="text"
placeholder="ak_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
className="flex-1 bg-[#0a0a0a] border border-[#2a2a2a] rounded px-3 py-1.5 text-xs font-mono text-[#cdd6f4] focus:outline-none focus:border-indigo-700"
onChange={(e) => {
if (e.target.value.startsWith('ak_')) {
localStorage.setItem('arcrun_api_key', e.target.value);
}
}}
/>
<span className="text-[#444] text-xs self-center"> requests</span>
</div>
);
}
+234
View File
@@ -0,0 +1,234 @@
'use client';
import { useEffect, useState, useCallback } from 'react';
import Link from 'next/link';
const API_BASE = process.env.NEXT_PUBLIC_API_BASE ?? 'https://cypher.arcrun.dev';
type User = {
email: string;
display_name: string;
avatar_url?: string;
api_key: string;
provider: string;
created_at: string;
};
export default function DashboardPage() {
const [user, setUser] = useState<User | null>(null);
const [loading, setLoading] = useState(true);
const [copied, setCopied] = useState(false);
const [rotating, setRotating] = useState(false);
const [revoking, setRevoking] = useState(false);
const [error, setError] = useState('');
const [showKey, setShowKey] = useState(false);
const fetchUser = useCallback(async () => {
try {
const res = await fetch(`${API_BASE}/me`, { credentials: 'include' });
if (res.status === 401) {
window.location.href = '/login?redirect=/dashboard';
return;
}
if (!res.ok) throw new Error('Failed to fetch user');
const data = await res.json() as User;
setUser(data);
} catch {
setError('無法載入用戶資訊,請重新整理。');
} finally {
setLoading(false);
}
}, []);
useEffect(() => {
fetchUser();
}, [fetchUser]);
const copyKey = async () => {
if (!user) return;
await navigator.clipboard.writeText(user.api_key);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
const rotateKey = async () => {
if (!confirm('確定要 Rotate API Key 嗎?舊 Key 的 workflow credentials 不會自動遷移。')) return;
setRotating(true);
setError('');
try {
const res = await fetch(`${API_BASE}/me/api-key/rotate`, {
method: 'PUT',
credentials: 'include',
});
if (!res.ok) throw new Error('rotate failed');
const data = await res.json() as { api_key: string; message: string };
setUser(prev => prev ? { ...prev, api_key: data.api_key } : null);
setShowKey(true);
} catch {
setError('Rotate 失敗,請稍後重試。');
} finally {
setRotating(false);
}
};
const revokeKey = async () => {
if (!confirm('確定要 Revoke API Key 嗎?所有使用此 Key 的服務將立即失效。')) return;
setRevoking(true);
setError('');
try {
const res = await fetch(`${API_BASE}/me/api-key`, {
method: 'DELETE',
credentials: 'include',
});
if (!res.ok) throw new Error('revoke failed');
window.location.href = '/login?revoked=1';
} catch {
setError('Revoke 失敗,請稍後重試。');
} finally {
setRevoking(false);
}
};
const logout = async () => {
await fetch(`${API_BASE}/auth/logout`, { method: 'POST', credentials: 'include' });
window.location.href = '/';
};
if (loading) {
return (
<div className="min-h-screen bg-[#0a0a0a] flex items-center justify-center">
<div className="text-[#444] text-sm animate-pulse">...</div>
</div>
);
}
if (!user) {
return (
<div className="min-h-screen bg-[#0a0a0a] flex flex-col items-center justify-center gap-4">
<p className="text-[#666]">{error || '請先登入。'}</p>
<Link href="/login" className="text-indigo-400 hover:text-indigo-300 text-sm"></Link>
</div>
);
}
const maskedKey = showKey ? user.api_key : user.api_key.slice(0, 8) + '••••••••••••••••••••••••';
return (
<div className="min-h-screen bg-[#0a0a0a] text-[#ededed]">
{/* Nav */}
<nav className="flex items-center justify-between px-6 py-4 border-b border-[#1a1a1a]">
<Link href="/" className="text-white font-bold text-lg tracking-tight hover:opacity-80 transition-opacity">
arcrun
</Link>
<div className="flex items-center gap-4">
{user.avatar_url && (
// eslint-disable-next-line @next/next/no-img-element
<img src={user.avatar_url} alt="" width={28} height={28} className="rounded-full" />
)}
<span className="text-[#666] text-sm">{user.email}</span>
<button onClick={logout} className="text-[#555] hover:text-[#888] text-sm transition-colors cursor-pointer">
</button>
</div>
</nav>
<main className="max-w-2xl mx-auto px-6 py-12">
<h1 className="text-2xl font-bold text-white mb-1">{user.display_name}</h1>
<p className="text-[#555] text-sm mb-10">
{user.provider} · {new Date(user.created_at).toLocaleDateString('zh-TW')}
</p>
{error && (
<div className="bg-red-950/50 border border-red-900/50 text-red-400 text-sm px-4 py-3 rounded-lg mb-6">
{error}
</div>
)}
{/* API Key Card */}
<div className="bg-[#111] border border-[#222] rounded-2xl p-6 mb-6">
<h2 className="text-white font-semibold mb-4"> API Key</h2>
<div className="flex items-center gap-2 mb-4">
<div className="flex-1 bg-[#0a0a0a] border border-[#2a2a2a] rounded-lg px-4 py-3 font-mono text-sm text-[#cdd6f4] overflow-hidden text-ellipsis whitespace-nowrap">
{maskedKey}
</div>
<button
onClick={() => setShowKey(v => !v)}
className="px-3 py-3 text-[#555] hover:text-[#aaa] text-xs border border-[#2a2a2a] rounded-lg transition-colors cursor-pointer whitespace-nowrap"
title={showKey ? '隱藏' : '顯示'}
>
{showKey ? '隱藏' : '顯示'}
</button>
<button
onClick={copyKey}
className="px-4 py-3 bg-[#1e1e2e] hover:bg-[#2a2a3e] text-indigo-400 text-xs border border-indigo-900/30 rounded-lg transition-colors cursor-pointer whitespace-nowrap"
>
{copied ? '已複製!' : '複製'}
</button>
</div>
<div className="bg-[#0a0a0a] border border-[#1a1a1a] rounded-lg p-4 mb-6 text-xs font-mono text-[#666] space-y-1">
<div className="text-[#444] mb-2"># 使</div>
<div>Authorization: Bearer {user.api_key.slice(0, 8)}...</div>
<div># </div>
<div>X-Arcrun-API-Key: {user.api_key.slice(0, 8)}...</div>
</div>
<div className="flex gap-3 flex-wrap">
<button
onClick={rotateKey}
disabled={rotating}
className="flex-1 border border-[#333] hover:border-[#555] text-[#aaa] hover:text-white px-4 py-2.5 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"
>
{rotating ? 'Rotating...' : 'Rotate Key'}
</button>
<button
onClick={revokeKey}
disabled={revoking}
className="flex-1 border border-red-900/50 hover:border-red-700/50 text-red-500 hover:text-red-400 px-4 py-2.5 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"
>
{revoking ? 'Revoking...' : 'Revoke Key'}
</button>
</div>
</div>
{/* Quick Start */}
<div className="bg-[#111] border border-[#222] rounded-2xl p-6">
<h2 className="text-white font-semibold mb-4"></h2>
<div className="space-y-3 text-sm">
<div className="flex items-start gap-3">
<span className="text-indigo-500 font-mono mt-0.5">1.</span>
<div>
<div className="text-[#aaa]"> CLI</div>
<pre className="bg-[#0a0a0a] border border-[#1a1a1a] rounded-lg px-3 py-2 mt-1 text-xs text-[#cdd6f4] font-mono">npm install -g arcrun</pre>
</div>
</div>
<div className="flex items-start gap-3">
<span className="text-indigo-500 font-mono mt-0.5">2.</span>
<div>
<div className="text-[#aaa]"> API Key </div>
<pre className="bg-[#0a0a0a] border border-[#1a1a1a] rounded-lg px-3 py-2 mt-1 text-xs text-[#cdd6f4] font-mono">acr init</pre>
</div>
</div>
<div className="flex items-start gap-3">
<span className="text-indigo-500 font-mono mt-0.5">3.</span>
<div>
<div className="text-[#aaa]"></div>
<pre className="bg-[#0a0a0a] border border-[#1a1a1a] rounded-lg px-3 py-2 mt-1 text-xs text-[#cdd6f4] font-mono">acr auth-recipe scaffold notion</pre>
</div>
</div>
</div>
</div>
<div className="flex gap-4 mt-6 text-sm">
<Link href="/integrations" className="text-indigo-400 hover:text-indigo-300 transition-colors">
20
</Link>
<Link href="/api-docs" className="text-indigo-400 hover:text-indigo-300 transition-colors">
API
</Link>
</div>
</main>
</div>
);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

+22
View File
@@ -0,0 +1,22 @@
@import "tailwindcss";
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
}
body {
background: var(--background);
color: var(--foreground);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
-webkit-font-smoothing: antialiased;
}
pre, code {
font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}
+175
View File
@@ -0,0 +1,175 @@
export const runtime = 'edge';
import Link from 'next/link';
type Recipe = {
id: string;
name: string;
primitive: 'static_key' | 'service_account';
category: string;
secrets: string[];
badge?: 'official';
};
const RECIPES: Recipe[] = [
// AI / LLM
{ id: 'openai', name: 'OpenAI', primitive: 'static_key', category: 'AI', secrets: ['OPENAI_API_KEY'], badge: 'official' },
{ id: 'anthropic', name: 'Anthropic', primitive: 'static_key', category: 'AI', secrets: ['ANTHROPIC_API_KEY'], badge: 'official' },
// Productivity
{ id: 'notion', name: 'Notion', primitive: 'static_key', category: 'Productivity', secrets: ['NOTION_TOKEN'], badge: 'official' },
{ id: 'airtable', name: 'Airtable', primitive: 'static_key', category: 'Productivity', secrets: ['AIRTABLE_TOKEN'], badge: 'official' },
{ id: 'typeform', name: 'Typeform', primitive: 'static_key', category: 'Productivity', secrets: ['TYPEFORM_TOKEN'], badge: 'official' },
{ id: 'jira', name: 'Jira', primitive: 'static_key', category: 'Productivity', secrets: ['JIRA_DOMAIN', 'JIRA_EMAIL', 'JIRA_API_TOKEN'], badge: 'official' },
// Communication
{ id: 'slack', name: 'Slack', primitive: 'static_key', category: 'Communication', secrets: ['SLACK_TOKEN'], badge: 'official' },
{ id: 'discord', name: 'Discord', primitive: 'static_key', category: 'Communication', secrets: ['DISCORD_BOT_TOKEN'], badge: 'official' },
{ id: 'twilio', name: 'Twilio', primitive: 'static_key', category: 'Communication', secrets: ['TWILIO_ACCOUNT_SID', 'TWILIO_AUTH_TOKEN'], badge: 'official' },
{ id: 'sendgrid', name: 'SendGrid', primitive: 'static_key', category: 'Communication', secrets: ['SENDGRID_API_KEY'], badge: 'official' },
{ id: 'resend', name: 'Resend', primitive: 'static_key', category: 'Communication', secrets: ['RESEND_API_KEY'], badge: 'official' },
// Dev / Code
{ id: 'github', name: 'GitHub', primitive: 'static_key', category: 'Dev', secrets: ['GITHUB_TOKEN'], badge: 'official' },
{ id: 'linear', name: 'Linear', primitive: 'static_key', category: 'Dev', secrets: ['LINEAR_API_KEY'], badge: 'official' },
{ id: 'supabase', name: 'Supabase', primitive: 'static_key', category: 'Dev', secrets: ['SUPABASE_URL', 'SUPABASE_SERVICE_ROLE_KEY'], badge: 'official' },
// Commerce
{ id: 'stripe', name: 'Stripe', primitive: 'static_key', category: 'Commerce', secrets: ['STRIPE_SECRET_KEY'], badge: 'official' },
{ id: 'shopify', name: 'Shopify', primitive: 'static_key', category: 'Commerce', secrets: ['SHOPIFY_STORE_DOMAIN', 'SHOPIFY_ACCESS_TOKEN'], badge: 'official' },
{ id: 'hubspot', name: 'HubSpot', primitive: 'static_key', category: 'Commerce', secrets: ['HUBSPOT_ACCESS_TOKEN'], badge: 'official' },
// Google Service Account
{ id: 'google_drive_sa', name: 'Google Drive', primitive: 'service_account', category: 'Google', secrets: ['GOOGLE_SERVICE_ACCOUNT_JSON'], badge: 'official' },
{ id: 'google_gmail_sa', name: 'Gmail', primitive: 'service_account', category: 'Google', secrets: ['GOOGLE_SERVICE_ACCOUNT_JSON'], badge: 'official' },
{ id: 'google_sheets_sa', name: 'Google Sheets', primitive: 'service_account', category: 'Google', secrets: ['GOOGLE_SERVICE_ACCOUNT_JSON'], badge: 'official' },
];
const CATEGORIES = ['All', 'AI', 'Productivity', 'Communication', 'Dev', 'Commerce', 'Google'];
export default function IntegrationsPage({
searchParams,
}: {
searchParams: Promise<{ cat?: string }>;
}) {
return <IntegrationsContent searchParamsPromise={searchParams} />;
}
async function IntegrationsContent({
searchParamsPromise,
}: {
searchParamsPromise: Promise<{ cat?: string }>;
}) {
const params = await searchParamsPromise;
const cat = params.cat ?? 'All';
const filtered = cat === 'All' ? RECIPES : RECIPES.filter(r => r.category === cat);
const staticCount = RECIPES.filter(r => r.primitive === 'static_key').length;
const saCount = RECIPES.filter(r => r.primitive === 'service_account').length;
return (
<div className="min-h-screen bg-[#0a0a0a] text-[#ededed]">
{/* Nav */}
<nav className="flex items-center justify-between px-6 py-4 border-b border-[#1a1a1a]">
<Link href="/" className="text-white font-bold text-lg tracking-tight hover:opacity-80 transition-opacity">
arcrun
</Link>
<div className="flex items-center gap-4 text-sm">
<Link href="/api-docs" className="text-[#666] hover:text-white transition-colors">API</Link>
<Link href="/login"
className="bg-indigo-600 hover:bg-indigo-500 text-white px-4 py-1.5 rounded-md text-sm font-medium transition-colors">
Get API Key
</Link>
</div>
</nav>
<div className="max-w-5xl mx-auto px-6 py-12">
{/* Header */}
<h1 className="text-3xl font-bold text-white mb-2">
{RECIPES.length}
</h1>
<p className="text-[#555] mb-2">
arcrun recipe
</p>
<div className="flex gap-4 text-sm text-[#444] mb-8">
<span>{staticCount} API Key </span>
<span>·</span>
<span>{saCount} Service Account </span>
</div>
{/* Category filter */}
<div className="flex gap-2 flex-wrap mb-8">
{CATEGORIES.map(c => (
<Link
key={c}
href={c === 'All' ? '/integrations' : `/integrations?cat=${c}`}
className={`px-3 py-1.5 rounded-full text-sm transition-colors ${
cat === c
? 'bg-indigo-600 text-white'
: 'bg-[#111] border border-[#222] text-[#666] hover:text-white hover:border-[#444]'
}`}
>
{c}
</Link>
))}
</div>
{/* Recipe grid */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-12">
{filtered.map(recipe => (
<RecipeCard key={recipe.id} recipe={recipe} />
))}
</div>
{/* Contribute CTA */}
<div className="bg-[#111] border border-[#222] rounded-2xl p-8 text-center">
<h2 className="text-white font-semibold text-xl mb-2"></h2>
<p className="text-[#555] text-sm mb-4 max-w-lg mx-auto">
API Key YAML
API AI PR
</p>
<div className="flex gap-3 justify-center flex-wrap">
<a href="https://github.com/richblack/arcrun" target="_blank" rel="noopener noreferrer"
className="bg-indigo-600 hover:bg-indigo-500 text-white px-5 py-2.5 rounded-lg text-sm font-medium transition-colors">
</a>
<a href="https://github.com/richblack/arcrun/blob/main/CONTRIBUTING.md" target="_blank" rel="noopener noreferrer"
className="border border-[#333] hover:border-[#555] text-[#aaa] hover:text-white px-5 py-2.5 rounded-lg text-sm font-medium transition-colors">
Recipe
</a>
</div>
</div>
</div>
</div>
);
}
function RecipeCard({ recipe }: { recipe: Recipe }) {
const primitiveLabel = recipe.primitive === 'static_key' ? 'API Key' : 'Service Account';
const primitiveColor = recipe.primitive === 'static_key' ? 'text-blue-400' : 'text-orange-400';
return (
<div className="bg-[#111] border border-[#1e1e1e] hover:border-[#333] rounded-xl p-5 transition-colors">
<div className="flex items-start justify-between mb-3">
<div>
<h3 className="text-white font-medium">{recipe.name}</h3>
<span className={`text-xs font-mono mt-0.5 ${primitiveColor}`}>{primitiveLabel}</span>
</div>
{recipe.badge === 'official' && (
<span className="text-xs bg-indigo-950/50 text-indigo-400 border border-indigo-900/30 px-2 py-0.5 rounded-full">
</span>
)}
</div>
<div className="text-xs text-[#444] space-y-1">
{recipe.secrets.map(s => (
<div key={s} className="font-mono flex items-center gap-1">
<span className="text-[#333]"></span> {s}
</div>
))}
</div>
<div className="mt-4 text-xs">
<code className="text-[#555] bg-[#0a0a0a] px-2 py-1 rounded font-mono">
acr auth-recipe scaffold {recipe.id}
</code>
</div>
</div>
);
}
+27
View File
@@ -0,0 +1,27 @@
import type { Metadata } from "next";
import "./globals.css";
export const metadata: Metadata = {
title: "arcrun — Stop fighting OAuth",
description: "One API key. Every service. Works anywhere. arcrun handles Google, Notion, GitHub, Slack authentication so your code doesn't have to.",
openGraph: {
title: "arcrun — Stop fighting OAuth",
description: "One API key. Every service. Works anywhere.",
url: "https://arcrun.dev",
siteName: "arcrun",
},
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" className="h-full">
<body className="min-h-full flex flex-col bg-[#0a0a0a] text-[#ededed]">
{children}
</body>
</html>
);
}
+102
View File
@@ -0,0 +1,102 @@
export const runtime = 'edge';
import Link from 'next/link';
const API_BASE = process.env.NEXT_PUBLIC_API_BASE ?? 'https://cypher.arcrun.dev';
export default function LoginPage({
searchParams,
}: {
searchParams: Promise<{ error?: string; redirect?: string }>;
}) {
return (
<LoginContent searchParamsPromise={searchParams} />
);
}
async function LoginContent({
searchParamsPromise,
}: {
searchParamsPromise: Promise<{ error?: string; redirect?: string }>;
}) {
const params = await searchParamsPromise;
const error = params.error;
const redirect = params.redirect ?? '/dashboard';
const googleUrl = `${API_BASE}/auth/google/start?redirect=${encodeURIComponent(redirect)}`;
const githubUrl = `${API_BASE}/auth/github/start?redirect=${encodeURIComponent(redirect)}`;
const errorMessages: Record<string, string> = {
cancelled: '登入已取消。',
invalid_state: '安全性驗證失敗,請重試。',
server_error: '伺服器錯誤,請稍後重試。',
github_email_required: 'GitHub 帳號需要設定公開 Email 才能登入。',
};
return (
<div className="min-h-screen bg-[#0a0a0a] flex flex-col items-center justify-center px-6">
{/* Logo */}
<div className="mb-8 text-center">
<Link href="/" className="text-white font-bold text-2xl tracking-tight hover:opacity-80 transition-opacity">
arcrun
</Link>
</div>
{/* Card */}
<div className="w-full max-w-sm bg-[#111] border border-[#222] rounded-2xl p-8">
<h1 className="text-xl font-semibold text-white mb-2 text-center"></h1>
<p className="text-[#555] text-sm text-center mb-8"> API Key使</p>
{error && (
<div className="bg-red-950/50 border border-red-900/50 text-red-400 text-sm px-4 py-3 rounded-lg mb-6">
{errorMessages[error] ?? '登入時發生錯誤,請重試。'}
</div>
)}
<div className="flex flex-col gap-3">
{/* Google */}
<a href={googleUrl}
className="flex items-center justify-center gap-3 bg-white hover:bg-gray-100 text-gray-900 px-4 py-3 rounded-lg font-medium text-sm transition-colors">
<GoogleIcon />
Continue with Google
</a>
{/* GitHub */}
<a href={githubUrl}
className="flex items-center justify-center gap-3 bg-[#24292e] hover:bg-[#2f363d] text-white border border-[#444] px-4 py-3 rounded-lg font-medium text-sm transition-colors">
<GitHubIcon />
Continue with GitHub
</a>
</div>
<p className="text-[#444] text-xs text-center mt-6 leading-relaxed">
</p>
</div>
<Link href="/" className="mt-6 text-[#444] hover:text-[#888] text-sm transition-colors">
</Link>
</div>
);
}
function GoogleIcon() {
return (
<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z" fill="#4285F4"/>
<path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/>
<path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05"/>
<path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/>
</svg>
);
}
function GitHubIcon() {
return (
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"/>
</svg>
);
}
+204
View File
@@ -0,0 +1,204 @@
'use client';
import { useState } from 'react';
import Link from 'next/link';
const API_BASE = process.env.NEXT_PUBLIC_API_BASE ?? 'https://cypher.arcrun.dev';
const CODE_DEMOS = {
python: `pip install arcrun
from arcrun import Arcrun
client = Arcrun() # reads ARCRUN_API_KEY from env
# One-time setup: upload credential
client.auth.setup("notion", token="secret_xxx")
# Every time after: just bind and use
notion = client.auth.bind("notion")
pages = notion.get("/pages").json()
# Works with any of 20+ services
drive = client.auth.bind("google_drive_sa")
files = drive.get("/files").json()`,
javascript: `npm install arcrun
import { Arcrun } from 'arcrun'
const client = new Arcrun() // reads ARCRUN_API_KEY from env
// One-time setup: upload credential
await client.auth.setup('notion', { token: 'secret_xxx' })
// Every time after: just bind and use
const notion = await client.auth.bind('notion')
const pages = await (await notion.get('/pages')).json()
// Run a deployed workflow
const result = await client.workflows.run('my-flow', {
email: 'user@example.com'
})`,
http: `# Works with any HTTP tool — curl, n8n, Make, Postman
POST ${API_BASE}/webhooks/named/my-workflow/trigger
X-Arcrun-API-Key: YOUR_API_KEY
Content-Type: application/json
{
"email": "user@example.com"
}
# n8n: HTTP Request 節點,貼上即用,不需要安裝任何東西`,
};
export default function HomePage() {
const [activeTab, setActiveTab] = useState<'python' | 'javascript' | 'http'>('python');
return (
<div className="flex flex-col min-h-screen bg-[#0a0a0a] text-[#ededed]">
{/* Nav */}
<nav className="flex items-center justify-between px-6 py-4 border-b border-[#1a1a1a]">
<span className="text-white font-bold text-lg tracking-tight">arcrun</span>
<div className="flex items-center gap-4 text-sm">
<Link href="/integrations" className="text-[#666] hover:text-white transition-colors">Integrations</Link>
<Link href="/api-docs" className="text-[#666] hover:text-white transition-colors">API</Link>
<a href="https://github.com/richblack/arcrun" target="_blank" rel="noopener noreferrer"
className="text-[#666] hover:text-white transition-colors">GitHub</a>
<Link href="/login"
className="bg-indigo-600 hover:bg-indigo-500 text-white px-4 py-1.5 rounded-md text-sm font-medium transition-colors">
Get API Key
</Link>
</div>
</nav>
{/* Hero */}
<section className="flex flex-col items-center text-center px-6 pt-24 pb-16">
<div className="inline-flex items-center gap-2 bg-[#1a1a2e] text-indigo-400 text-xs px-3 py-1 rounded-full mb-6 border border-indigo-900/50">
<span className="w-1.5 h-1.5 bg-indigo-400 rounded-full animate-pulse inline-block"></span>
Open Source · Free API Key · No Credit Card
</div>
<h1 className="text-5xl md:text-6xl font-bold text-white mb-4 leading-tight max-w-3xl">
Stop fighting OAuth.
</h1>
<p className="text-xl md:text-2xl text-[#888] mb-3 max-w-2xl">
One API key. Every service. Works anywhere.
</p>
<p className="text-[#555] max-w-xl mb-10">
arcrun handles Google, Notion, GitHub, Slack authentication
so your Python / JS code doesn&apos;t have to.
</p>
<div className="flex gap-3 flex-wrap justify-center">
<Link href="/login"
className="bg-indigo-600 hover:bg-indigo-500 text-white px-6 py-3 rounded-lg font-medium transition-colors">
Get API Key Free
</Link>
<a href="https://github.com/richblack/arcrun" target="_blank" rel="noopener noreferrer"
className="border border-[#333] hover:border-[#555] text-[#aaa] hover:text-white px-6 py-3 rounded-lg font-medium transition-colors">
View on GitHub
</a>
</div>
</section>
{/* Before / After */}
<section className="max-w-4xl mx-auto px-6 pb-16 w-full">
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 items-center">
<div className="bg-[#111] border border-[#222] rounded-xl p-6">
<div className="text-[#555] text-xs mb-3 font-mono uppercase tracking-wider">Before</div>
<div className="text-red-400 text-sm font-mono space-y-1 opacity-70">
<div>40 OAuth </div>
<div>GCP Console </div>
<div>debug </div>
<div>Service Account JSON</div>
<div>token </div>
</div>
</div>
<div className="flex items-center justify-center text-[#333] text-4xl font-thin select-none"></div>
<div className="bg-[#111] border border-indigo-900/50 rounded-xl p-6">
<div className="text-indigo-400 text-xs mb-3 font-mono uppercase tracking-wider">After</div>
<pre className="text-green-400 text-sm font-mono leading-relaxed">
{`from arcrun import auth
drive = auth.bind(
"google_drive"
)
# done.`}
</pre>
</div>
</div>
</section>
{/* Code Demo */}
<section className="max-w-3xl mx-auto px-6 pb-20 w-full">
<div className="bg-[#111] border border-[#222] rounded-xl overflow-hidden">
<div className="flex border-b border-[#1e1e1e]">
{(['python', 'javascript', 'http'] as const).map(tab => (
<button
key={tab}
onClick={() => setActiveTab(tab)}
className={`px-5 py-3 text-sm font-medium transition-colors cursor-pointer ${
activeTab === tab
? 'text-white border-b-2 border-indigo-500 bg-[#0d0d1a]'
: 'text-[#555] hover:text-[#aaa]'
}`}
>
{tab === 'python' ? 'Python' : tab === 'javascript' ? 'JavaScript' : 'HTTP / n8n'}
</button>
))}
</div>
<div className="p-6 overflow-x-auto">
<pre className="text-sm text-[#cdd6f4] leading-relaxed">
<code>{CODE_DEMOS[activeTab]}</code>
</pre>
</div>
</div>
{activeTab === 'http' && (
<p className="text-[#444] text-sm mt-3 text-center">
n8n HTTP Request 西
</p>
)}
</section>
{/* Features */}
<section className="max-w-4xl mx-auto px-6 pb-20 w-full">
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
{[
{ title: '20+ 服務開箱即用', desc: 'Google、Notion、GitHub、Slack、OpenAI、Stripe... 全部一個 bind() 搞定。', icon: '🔌' },
{ title: 'AI-first 設計', desc: 'Token 消耗極小,YAML workflow 幾十個 token,讓 AI 直接讀寫執行。', icon: '🤖' },
{ title: '完全開源', desc: 'MIT 授權。Self-host 在你自己的 Cloudflare,或使用我們的 hosted 服務。', icon: '🔓' },
].map(f => (
<div key={f.title} className="bg-[#111] border border-[#1e1e1e] rounded-xl p-6">
<div className="text-2xl mb-3">{f.icon}</div>
<h3 className="text-white font-semibold mb-2">{f.title}</h3>
<p className="text-[#555] text-sm leading-relaxed">{f.desc}</p>
</div>
))}
</div>
</section>
{/* CTA */}
<section className="border-t border-[#1a1a1a] py-16 text-center px-6">
<h2 className="text-3xl font-bold text-white mb-3"></h2>
<p className="text-[#555] mb-8"> API Key</p>
<Link href="/login"
className="bg-indigo-600 hover:bg-indigo-500 text-white px-8 py-3 rounded-lg font-medium transition-colors">
API Key
</Link>
</section>
{/* Footer */}
<footer className="border-t border-[#1a1a1a] py-8 px-6 text-center text-[#333] text-sm mt-auto">
<div className="flex items-center justify-center gap-6">
<Link href="/integrations" className="hover:text-[#777] transition-colors">Integrations</Link>
<Link href="/api-docs" className="hover:text-[#777] transition-colors">API Docs</Link>
<a href="https://github.com/richblack/arcrun" target="_blank" rel="noopener noreferrer"
className="hover:text-[#777] transition-colors">GitHub</a>
</div>
<p className="mt-4">arcrun MIT License</p>
</footer>
</div>
);
}
+22
View File
@@ -0,0 +1,22 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export function middleware(request: NextRequest) {
const { pathname } = request.nextUrl;
// Only protect /dashboard
if (pathname.startsWith('/dashboard')) {
const session = request.cookies.get('arcrun_session');
if (!session?.value) {
const loginUrl = new URL('/login', request.url);
loginUrl.searchParams.set('redirect', pathname);
return NextResponse.redirect(loginUrl);
}
}
return NextResponse.next();
}
export const config = {
matcher: ['/dashboard/:path*'],
};
+7
View File
@@ -0,0 +1,7 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Cloudflare Pages edge runtime compatibility
};
export default nextConfig;
+3467
View File
File diff suppressed because it is too large Load Diff
+27
View File
@@ -0,0 +1,27 @@
{
"name": "landing",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"build:pages": "npx @cloudflare/next-on-pages",
"start": "next start",
"deploy": "npm run build:pages && wrangler pages deploy"
},
"dependencies": {
"@cloudflare/next-on-pages": "^1.13.16",
"next": "^15.5.15",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"wrangler": "^4.83.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^4",
"typescript": "^5"
}
}
+7
View File
@@ -0,0 +1,7 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;
+1
View File
@@ -0,0 +1 @@
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 391 B

+1
View File
@@ -0,0 +1 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

+1
View File
@@ -0,0 +1 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 128 B

+1
View File
@@ -0,0 +1 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>

After

Width:  |  Height:  |  Size: 385 B

+42
View File
@@ -0,0 +1,42 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": [
"./*"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts",
"**/*.mts"
],
"exclude": [
"node_modules"
]
}
+7
View File
@@ -0,0 +1,7 @@
name = "arcrun-landing"
compatibility_date = "2025-02-19"
compatibility_flags = ["nodejs_compat"]
pages_build_output_dir = ".vercel/output/static"
[vars]
NEXT_PUBLIC_API_BASE = "https://cypher.arcrun.dev"