caelum0x d56639a594
Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

117 lines
5.0 KiB
TypeScript

import type { Metadata } from "next";
import { headers } from "next/headers";
import Link from "next/link";
import { SignUp } from "@/components/auth/clerk-safe";
import { EmailCodeSignIn } from "@/components/auth/EmailCodeSignIn";
import { safeRelativePath } from "@/lib/auth-redirect";
import { ReferralCapture } from "@/src/features/onboarding/ReferralCapture";
import { normalizeReferralCode } from "@/src/features/onboarding/referral-capture";
import { offerFor } from "@/lib/offer";
import { isStyleId } from "@/lib/styles/catalog";
import { getLaunchPosture } from "@/src/shared/launch-posture/server";
export const metadata: Metadata = {
title: "Sign up",
description:
"Create a Menivor account, paste a link or type a topic, and get three vertical reels with AI voiceover and word-by-word captions.",
alternates: { canonical: "/sign-up" },
// Auth pages stay out of the index (robots.txt also disallows them).
robots: { index: false, follow: true },
};
type SearchParams = Promise<Record<string, string | string[] | undefined>>;
function first(value: string | string[] | undefined): string {
return Array.isArray(value) ? (value[0] ?? "") : (value ?? "");
}
/**
* Sign-up. Every new account goes through `/onboarding` (the $1 card check
* that unlocks the free reels, plus silent referral redemption) before
* landing on its destination (default: the create box). `?redirect_url=` (e.g. from a pricing "Create an account to
* buy" CTA) is carried through as onboarding's `next`; `?ref=` is persisted
* client-side so the referral survives the Clerk round-trip.
*/
export default async function SignUpPage({
searchParams,
}: Readonly<{ searchParams: SearchParams }>) {
const params = await searchParams;
// The live offer for this read's `freeFirstReel` truth, not the web
// build's own copy flag guess (see `offerFor` in `@/lib/offer`): a visitor
// landing here is one click from the $1 card-check screen, so this is the
// last place the "first reel free, no card" promise can go stale before it
// is tested against reality in `/onboarding`.
const posture = await getLaunchPosture();
const offer = offerFor(posture.freeFirstReel);
// The landing box submits `?q=<link or topic>`: after sign-up and the card
// check, the create box starts the reels from it without another question.
const pasted = first(params.q).trim().slice(0, 600);
// A style picked on the landing page (`?preset=`) is preselected in the box.
const preset = first(params.preset).trim();
// The free, no-sign-in reel preview's id (`?preview=`, from `ReelPreviewRunner`'s
// own CTA): carried through so `/create` can attribute this sign-up to the
// preview that led to it (`POST /reel-preview/claim`) -- bookkeeping only,
// the render itself always runs from `q`/`preset` above, same as any other
// pasted link.
const previewId = first(params.preview).trim().slice(0, 36);
const createQuery = new URLSearchParams();
if (pasted) {
createQuery.set("q", pasted);
createQuery.set("auto", "1");
}
if (isStyleId(preset)) createQuery.set("preset", preset);
if (previewId) createQuery.set("preview", previewId);
const fromBox = createQuery.size > 0 ? `/create?${createQuery.toString()}` : "/create";
const next = safeRelativePath(
first(params.redirect_url),
fromBox,
(await headers()).get("host"),
);
const referralCode = normalizeReferralCode(first(params.ref));
const onboardingUrl = `/onboarding?next=${encodeURIComponent(next)}`;
const signInUrl = `/sign-in?redirect_url=${encodeURIComponent(next)}`;
return (
<main className="flex min-h-dvh flex-col items-center justify-center gap-4 p-6">
{referralCode && (
<>
<ReferralCapture code={referralCode} />
<p className="max-w-sm text-center text-sm text-muted-foreground">
You were invited to Menivor. Create your account and your referral
bonus is applied automatically.
</p>
</>
)}
<div className="max-w-sm text-center">
<h1 className="text-xl font-semibold">Create your free account</h1>
<p className="mt-1 text-sm text-muted-foreground">
One click with Google or Apple. {offer.signupNext}
</p>
</div>
<SignUp
signInUrl={signInUrl}
forceRedirectUrl={onboardingUrl}
appearance={{
layout: { socialButtonsPlacement: "top", socialButtonsVariant: "blockButton" },
}}
/>
<EmailCodeSignIn redirectUrl={onboardingUrl} />
<p className="max-w-sm text-center text-xs text-muted-foreground">
By creating an account you agree to the{" "}
<Link href="/terms" className="underline underline-offset-4">
Terms of Service
</Link>
,{" "}
<Link href="/legal/acceptable-use" className="underline underline-offset-4">
Acceptable Use Policy
</Link>{" "}
and{" "}
<Link href="/privacy" className="underline underline-offset-4">
Privacy Policy
</Link>
. No NSFW, deepfake or impersonation content.
</p>
</main>
);
}