diff --git a/docs/marketing-app.md b/docs/marketing-app.md new file mode 100644 index 00000000..f58aea7b --- /dev/null +++ b/docs/marketing-app.md @@ -0,0 +1,10 @@ +# Marketing site and app + +Factorize is deployed as two Cloudflare Workers: + +- `packages/marketing` owns the public landing page at `https://factorize.sh`. It contains no authenticated APIs or tenant data. Set `APP_ORIGIN` to the app origin so login and Create a Job links always cross to the app. +- `packages/app` owns the authenticated dashboard, OAuth callbacks, API/MCP endpoints, provider webhooks, and job deep links at `https://app.factorize.sh`. Its `/` route is the signed-out login entry point and redirects signed-in users to `/jobs`. + +Run the two Workers independently with `npm run dev` and `npm run dev:marketing`. Deploy the complete setup with `npm run deploy`; deploy only the public site with `npm run deploy:marketing`. + +Configure the Linear OAuth callback and provider webhooks against the app origin, never the marketing origin. Existing `/jobs/*`, `/api/*`, `/mcp`, `/authorize`, and webhook URLs remain app routes. diff --git a/package-lock.json b/package-lock.json index 8e937671..151fc6a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4097,6 +4097,10 @@ "resolved": "packages/app", "link": true }, + "node_modules/factorize-marketing": { + "resolved": "packages/marketing", + "link": true + }, "node_modules/factorize-tail-relay": { "resolved": "packages/tail-relay", "link": true @@ -5889,6 +5893,18 @@ "wrangler": "^4.44.0" } }, + "packages/marketing": { + "name": "factorize-marketing", + "version": "0.1.0", + "dependencies": { + "hono": "^4.11.4" + }, + "devDependencies": { + "@cloudflare/workers-types": "^5.20260910.1", + "typescript": "^5.9.3", + "wrangler": "^4.44.0" + } + }, "packages/tail-relay": { "name": "factorize-tail-relay", "version": "0.1.0", diff --git a/package.json b/package.json index dc5a1105..68e4d9ff 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,12 @@ "workspaces": ["packages/*"], "scripts": { "dev": "npm run dev --workspace=factorize", + "dev:marketing": "npm run dev --workspace=factorize-marketing", "build:css": "npm run build:css --workspace=factorize", "test": "npm run test --workspaces --if-present", - "check": "npm run check --workspace=factorize && npm run check --workspace=factorize-tail-relay", - "deploy": "npm run deploy:app && npm run deploy:tail-relay", + "check": "npm run check --workspace=factorize && npm run check --workspace=factorize-marketing && npm run check --workspace=factorize-tail-relay", + "deploy": "npm run deploy:marketing && npm run deploy:app && npm run deploy:tail-relay", + "deploy:marketing": "npm run deploy --workspace=factorize-marketing", "deploy:app": "npm run deploy --workspace=factorize", "deploy:tail-relay": "npm run deploy --workspace=factorize-tail-relay" } diff --git a/packages/app/src/index.ts b/packages/app/src/index.ts index 43a798e4..a2369b4b 100644 --- a/packages/app/src/index.ts +++ b/packages/app/src/index.ts @@ -5,7 +5,7 @@ import { equalHmac, hmac } from "./crypto"; import { Tenant, TenantV2 } from "./tenant"; import { GitHubInstallationRegistry, GitHubInstallationRegistryV2 } from "./github-registry"; import { createAppJwt, githubHeaders, readSetupState, signSetupState } from "./github"; -import { apiKeysSettingsPage, jobDetailPage, jobPage, jobsPage, jobRunPage, landingPage, settingsPage } from "./ui"; +import { apiKeysSettingsPage, jobDetailPage, jobPage, jobsPage, jobRunPage, loginPage, settingsPage } from "./ui"; import type { Env } from "./types"; import { ACCESS_SCOPES, accessTokenDigest, issueAccessToken } from "./access-tokens"; @@ -330,7 +330,7 @@ const render = (page: string, nonce: string) => page.replaceAll(" +
+Factorize
+

Sign in to Factorize

Manage your software factory and its Jobs.

+Continue with Linear +

New here? Sign in to create your workspace. Email, Google, and Linear sign-in can be added as authentication providers without changing your Jobs.

+
`; + const themeScript = ` const themeToggle=document.querySelector('#theme-toggle'),themeIcon=document.querySelector('#theme-icon'); const syncThemeButton=()=>{const dark=document.documentElement.classList.contains('dark');themeIcon.textContent=dark?'☀':'☾';themeToggle.setAttribute('aria-label',dark?'Use light mode':'Use dark mode')}; diff --git a/packages/app/wrangler.jsonc b/packages/app/wrangler.jsonc index 392727cd..e170198b 100644 --- a/packages/app/wrangler.jsonc +++ b/packages/app/wrangler.jsonc @@ -17,6 +17,7 @@ ], "vars": { "APP_ORIGIN": "https://app.factorize.sh", + "MARKETING_ORIGIN": "https://factorize.sh", "LINEAR_OAUTH_SCOPES": "read,write" } } diff --git a/packages/marketing/package.json b/packages/marketing/package.json new file mode 100644 index 00000000..23879671 --- /dev/null +++ b/packages/marketing/package.json @@ -0,0 +1,13 @@ +{ + "name": "factorize-marketing", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "dev": "wrangler dev", + "check": "tsc --noEmit && wrangler deploy --dry-run", + "deploy": "wrangler deploy" + }, + "dependencies": { "hono": "^4.11.4" }, + "devDependencies": { "@cloudflare/workers-types": "^5.20260910.1", "typescript": "^5.9.3", "wrangler": "^4.44.0" } +} diff --git a/packages/marketing/public/bee-mark.svg b/packages/marketing/public/bee-mark.svg new file mode 100644 index 00000000..22c959d1 --- /dev/null +++ b/packages/marketing/public/bee-mark.svg @@ -0,0 +1 @@ + diff --git a/packages/marketing/public/styles.css b/packages/marketing/public/styles.css new file mode 100644 index 00000000..9aeabdbb --- /dev/null +++ b/packages/marketing/public/styles.css @@ -0,0 +1 @@ +:root{font-family:ui-sans-serif,system-ui,sans-serif;color:#0f172a;background:#fafaf9}*{box-sizing:border-box}body{margin:0;min-height:100vh;display:flex;flex-direction:column}header{border-bottom:1px solid #e7e5e4;background:white}nav,main,footer{width:min(100% - 2.5rem,72rem);margin:auto}nav{height:4rem;display:flex;align-items:center;justify-content:space-between}.brand{font-size:1.125rem;font-weight:700;color:inherit;text-decoration:none}.login{color:#475569;text-decoration:none}.login:hover,a:hover{text-decoration:underline}main{text-align:center;padding:7rem 0;flex:1}.eyebrow{color:#b45309;font-size:.75rem;font-weight:700;letter-spacing:.18em;text-transform:uppercase}h1{font-size:clamp(3rem,8vw,5.5rem);line-height:1.05;margin:1.25rem auto;max-width:52rem;letter-spacing:-.04em}h2{font-size:2.25rem;margin:.75rem 0}.lede{font-size:1.125rem;line-height:1.75;color:#475569;max-width:38rem;margin:0 auto}.lede a,section a{color:inherit}.actions{display:flex;gap:.75rem;justify-content:center;flex-wrap:wrap;margin:2.25rem 0 7rem}.actions a{padding:.9rem 1.4rem;border-radius:.75rem;font-weight:700;text-decoration:none}.primary{background:#0f172a;color:white}.secondary{border:1px solid #d6d3d1;color:#0f172a;background:white}section{max-width:48rem;margin:auto;text-align:left}section>p:not(.eyebrow){color:#475569;line-height:1.75}ol{padding:0;list-style:none;display:grid;gap:1rem;margin-top:2.5rem}li{display:grid;gap:.4rem;border:1px solid #e7e5e4;background:white;border-radius:1rem;padding:1.5rem}li span{color:#475569;line-height:1.6}footer{border-top:1px solid #e7e5e4;padding:1.5rem 0;color:#64748b;font-size:.875rem}footer a{color:inherit}@media(max-width:640px){main{padding:5rem 0}nav,main,footer{width:min(100% - 2rem,72rem)}} diff --git a/packages/marketing/src/index.ts b/packages/marketing/src/index.ts new file mode 100644 index 00000000..f2b28c31 --- /dev/null +++ b/packages/marketing/src/index.ts @@ -0,0 +1,21 @@ +import { Hono } from "hono"; + +type Bindings = { ASSETS: Fetcher; APP_ORIGIN: string }; +const app = new Hono<{ Bindings: Bindings }>(); + +app.use("*", async (c, next) => { + await next(); + c.header("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; base-uri 'none'; frame-ancestors 'none'; form-action 'self'"); + c.header("Referrer-Policy", "strict-origin-when-cross-origin"); + c.header("X-Content-Type-Options", "nosniff"); + c.header("X-Frame-Options", "DENY"); +}); + +const page = (appOrigin: string) => `Factorize: Software Factories for Everybody
+

Linear → Exe.dev → Herdr

No-code Software Factories

Create a multiplayer software factory with Linear, Exe.dev and Herdr.

Create a JobHost it Yourself
+

How it works

Choose when to fully automate

Factorize routes Linear issues to your coding agent of choice running on your exe.dev VM.

  1. Plan work in LinearDefine bugs, features, and product work as Linear issues.
  2. Issues are routed to agentsFactorize listens to Linear and sends issues to agents on your VM.
  3. Watch, guide, or take overConnect to the VM and steer agents together with your colleagues.
`; + +app.get("/", (c) => c.html(page(c.env.APP_ORIGIN))); +app.get("/health", (c) => c.json({ ok: true })); +app.all("*", (c) => c.env.ASSETS.fetch(c.req.raw)); +export default app; diff --git a/packages/marketing/tsconfig.json b/packages/marketing/tsconfig.json new file mode 100644 index 00000000..4687eaed --- /dev/null +++ b/packages/marketing/tsconfig.json @@ -0,0 +1,4 @@ +{ + "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "Bundler", "lib": ["ES2022"], "strict": true, "skipLibCheck": true, "types": ["@cloudflare/workers-types"], "noEmit": true }, + "include": ["src/**/*.ts"] +} diff --git a/packages/marketing/wrangler.jsonc b/packages/marketing/wrangler.jsonc new file mode 100644 index 00000000..255ff761 --- /dev/null +++ b/packages/marketing/wrangler.jsonc @@ -0,0 +1,8 @@ +{ + "$schema": "../../node_modules/wrangler/config-schema.json", + "name": "factorize-marketing", + "main": "src/index.ts", + "compatibility_date": "2026-09-10", + "assets": { "directory": "./public", "binding": "ASSETS" }, + "vars": { "APP_ORIGIN": "https://app.factorize.sh" } +}