Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
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.
12 KiB
12 KiB
Menivor (videogen / "reelforge-monorepo") — Architecture, 2026-10-23
Scope: real components only, read from the repo at /Users/arhansubasi/products/videogen on
2026-10-23. No PLAN-2026-10-23-DEEP.md existed at the time this was written, so this file does
not duplicate a pages/APIs/features plan — it covers competitive positioning context (see
STRATEGY-2026-10-23.md), real system architecture, data flow, risks, and next-build priorities.
1. System diagram
flowchart TB
subgraph Clients
WEB[apps/web: Next.js 15 + OpenNext]
MOBILE[apps/mobile: Expo/React Native 0.81]
WATCH[apps/watch: Expo + cast-receiver]
DESKTOP[apps/desktop: Rust/Electron-legacy]
end
subgraph Cloudflare
CFW[Cloudflare Workers\n menivor.com / www.menivor.com\n OpenNext adapter]
KV[Workers KV\n WAITLIST namespace]
RL[Workers Rate Limiting\n TOOLS_IP_LIMITER / TOOLS_GLOBAL_LIMITER]
R2[Cloudflare R2\n bucket: videogen\n public via pub-*.r2.dev]
end
subgraph ExternalSaaS
CLERK[Clerk\n auth, pk_live_ + sk_live_]
RELAY[Railyard Relay\n relay.ereboslab.com\n Claude Haiku via OpenRouter-style proxy]
LISTMONK[Listmonk\n letters.ereboslab.com\n newsletter]
GLITCHTIP[GlitchTip\n errors.ereboslab.com\n browser error reporting]
NEON[(Neon Postgres\n ep-restless-band-*.neon.tech)]
PROVIDERS[AI providers\n Anthropic / ElevenLabs / HeyGen /\n Kling / Whisper / etc, keyed per-stage]
SOCIAL[TikTok / Instagram / YouTube / X\n OAuth + publish APIs]
end
subgraph OracleBox["Oracle box 'box' (130.61.180.42)\ndocker compose -p menivor"]
API[FastAPI\n apps/api\n :8080 behind Caddy TLS]
WORKER[Celery worker(s)\n queues: celery/render/housekeeping]
BEAT[Celery beat\n periodic ticks: growth_poll, funnel, OTT sweep, etc]
REDIS[(Redis\n broker + result backend)]
end
WEB -- deployed as --> CFW
CFW -- NEXT_PUBLIC_API_BASE --> API
CFW -- waitlist signup --> KV
CFW -- /api/tools/generate --> RL
CFW -- /api/tools/generate --> RELAY
RELAY --> PROVIDERS
CFW -- sign-in/session --> CLERK
CFW -- client error events --> GLITCHTIP
CFW -- double opt-in --> LISTMONK
MOBILE -- REELFORGE_API_BASE --> API
WATCH --> API
DESKTOP --> API
API -- SQLAlchemy 2.0 / psycopg --> NEON
API -- enqueue chain/chord --> REDIS
REDIS --> WORKER
REDIS --> BEAT
WORKER -- script/tts/avatar/captions/compose --> PROVIDERS
WORKER -- presigned PUT/GET (boto3) --> R2
WORKER -- publish job --> SOCIAL
API -- presigned GET for preview --> R2
API -- auth/session verify --> CLERK
API -- Sentry SDK (DSN optional) --> GLITCHTIP
2. Data flow for key user actions
2.1 Free SEO/growth tool run (e.g. /tools/tiktok-hook-generator), unauthenticated
- Browser loads the
(marketing)/tools/*page from Cloudflare Workers (static/SSR via OpenNext). - Form POST hits the same Worker's own route
app/api/tools/generate/route.ts— this runs inside the Workers runtime, not on the FastAPI box. - That route checks
RELAY_URL/RELAY_API_KEY(Worker secrets) and applies the two Workers Rate Limiting bindings (TOOLS_IP_LIMITER5/min per IP,TOOLS_GLOBAL_LIMITER40/min global). - Request forwards to
relay.ereboslab.com(Railyard Relay, a separate owned service), which calls an LLM (Claude Haiku class) and returns generated text. - Response renders directly in the page; no database row, no R2 object, no FastAPI involvement.
This is why the
/tools/*pages are cheap to run at zero marginal cost and are the natural place to add the "vs Creatify/Arcads" comparison content from the strategy doc — it is the same code path already serving 14 live pages.
2.2 Authenticated reel generation ("hook script -> TTS -> avatar -> captions -> compose")
- Signed-in browser (Clerk session) on
menivor.comcallsNEXT_PUBLIC_API_BASE(https://api.menivor.com/api/v1) — this leaves Cloudflare entirely and hits the FastAPI process on Oracle boxbox(130.61.180.42), reverse-proxied by Caddy. - FastAPI checks launch-phase policy (
app/core/launch/policy.py):signup_enabled/checkout_enabled/publishing_enabledare computed fromREELFORGE_LAUNCH_MODE+REELFORGE_SIGNUP_ENABLED/REELFORGE_CHECKOUT_ENABLED/REELFORGE_PUBLISHING_ENABLEDenv flags (default in.env.example:internal_pilot, all threefalse) plus a pilot-staff allowlist override. This is the real mechanism behind the "waitlist mode" the strategy doc describes — it is a backend feature flag read live viaGET /launch/status, not only the frontend'sNEXT_PUBLIC_WAITLIST_MODEbuild-time override. - On success, FastAPI writes a
Jobrow to Neon Postgres (SQLAlchemy 2.0, psycopg v3 driver, pooled endpointep-restless-band-ay40rg56-pooler). app/workers/pipeline.pybuilds the canonical DAG as a Celerychain:script -> tts -> chord(avatar, captions) -> compose -> upload(optional), routes the GPU/render-heavyavatar/composestages to therenderqueue, and enqueues onto Redis (same box, "existing MPT Redis instance").- The Celery worker process (same box) pulls each stage, calling external AI providers (script:
Anthropic; TTS: ElevenLabs-class; avatar: HeyGen/Kling-class) as configured per
.env, writes intermediate and final media to Cloudflare R2 via boto3 presigned PUT (bucketvideogen). composestage remuxes an AI-generated-content provenance tag into the final MP4, marks the job complete in Postgres.- Browser polls job status via the API; on completion it reads the final MP4 from a 7-day
presigned R2 GET URL (or the public
pub-*.r2.devdomain) — R2 serves the byte stream directly, Cloudflare Workers/FastAPI are out of the hot path for playback. - If the job requested direct publish,
uploadhands off toapp/domains/multipost/packages/publishing-connectors(TikTok/Instagram/YouTube/X OAuth clients) which post the asset to the creator's connected social account.
2.3 Waitlist signup (pre-launch CTA on marketing pages)
- Visitor submits email on a marketing page served by the Cloudflare Worker.
- A Worker route writes directly to the
WAITLISTKV namespace (id5ad25698b2554f51881ff4e76001eee8, verified real viawrangler kv namespace list). - No FastAPI, no Postgres, no queue involved — if the KV binding is ever missing the route
degrades to a
503+mailto:fallback (per the inline comment inwrangler.jsonc). - Separately, the public newsletter opt-in goes to Listmonk (
letters.ereboslab.com, listmenivor-updates), not the waitlist KV — these are two different capture mechanisms living on two different services.
3. Real architectural risks / bottlenecks (current scale, zero budget)
- Single Oracle VM is the whole backend tier. API, Celery worker, Celery beat, and Redis all
run as one
docker compose -p menivorstack on one box (130.61.180.42). There is no secondary API node, no Redis replica, no managed queue. A box-level outage (already happened:sshddropped on 2026-10-21, blocking a deploy until an OCI console/restart path) takes down generation, auth-adjacent API calls, and publishing simultaneously, with the public marketing site (Cloudflare) staying up and silently making promises the backend can't fulfill. - CPU-only render host vs. a GPU-shaped pipeline.
boxis an OracleVM.Standard.A1.Flex(ARM CPU, no GPU). The Celery DAG'savatarandcomposestages are routed to a dedicatedrenderqueue specifically because they are the slow/heavy stages — but the repo also hasapps/api/Dockerfile.generation, aworker-gpuimage target in CI (build-images.yml), andinfra/render-workers/(e.g.infinitetalk/handler.py) implying a GPU-backed render path was designed but is not confirmed wired to a live GPU host. If avatar/ compose currently execute on the CPU box, per-job latency and concurrent-job throughput are both a hard ceiling under any real traffic spike — directly undercutting the "ships in minutes" promise implied by competing with Creatify/HeyGen. - GitHub Actions is fully blocked (billing failure on
caelum0x/videogen), sobuild-images(web/api/worker-gpu images) anddeploy.ymlhave not produced a successful run since at least 2026-10-16. The web frontend still deploys fine (separate Cloudflare path), but any backend/API fix can only reach production via the manualbuild/ship-image.sh --host boxSSH path — one human credential is now a hard dependency for every backend release. - Launch-phase flags, not infra, gate revenue.
REELFORGE_LAUNCH_MODE=internal_pilotwith signup/checkout/publishing allfalseby default means the single biggest conversion blocker the strategy doc identifies is a config flip onbox, not a code change — but it is also a config flip that is easy to leave off indefinitely since nothing in the repo forces it back on. - Shared, over-scoped credentials.
apps/api/DEPLOY.mddocuments that the live R2 API token in.envis the same account-scoped token shared with thecalori-aiproduct's.env— a leak or bug in one product's R2 usage has blast radius into the other's bucket. - Domain sprawl inside one FastAPI monolith.
apps/api/app/domains/has over 90 subdirectories (ads, ott, ott_live, ott_commerce, clipmarket, affiliate, wallet, social_inbox, …) sharing one process, one Postgres database, and one deploy unit. Given the owner's own standing note that most products "almost none...get users," a large fraction of this surface is plausibly unused code adding build time, migration risk, and onboarding cost to the handful of flows (reel generation, tools, billing) that actually need to be reliable. - No automated health/alerting loop found for the box itself.
SENTRY_DSNdefaults to empty ("NO-OP") in.env.example; GlitchTip is wired for the browser (Next.js) side only. If the Celery worker silently stops consuming therenderqueue, nothing in the repo pages anyone — the only readiness signal is the manual/readyzcurl documented inapps/api/DEPLOY.md.
4. Prioritized next-build list
- Flip the launch-phase flags for the free tier, behind the existing policy gate (very low
effort, highest impact).
REELFORGE_SIGNUP_ENABLED/REELFORGE_CHECKOUT_ENABLEDalready exist as real, tested flags (app/core/launch/policy.py,GET /launch/status); this is a.envedit + container recreate onbox, not new code. This directly unblocks the strategy doc's #1 precondition ("resolve waitlist mode before differentiation claims can convert"). - Ship
/from-app-storereusing the already-builtappaudit+ingestdomains (low-medium effort, high impact). The backend already hasapp/domains/appaudit(packaging/visibility/ rewrite checks) andapp/domains/ingest(metadata extraction) plus a live/tools/app-store- auditpage — none of it currently renders a pre-signup reel preview. Wiring a thin public route that calls the existing audit/ingest services and pipes the result into a one-shot preview render is mostly glue, not new product surface. - Convert the 14 live
/tools/*pages into sourced competitor-comparison pages (low effort, content-only, no backend change). These already run through the zero-cost Workers+Relay path (2.1 above); adding "Menivor vs Creatify/Arcads/AdCreative.ai/HeyGen" variants is a content/routing change insideapps/web/app/(marketing)/tools, with no new infra. - Add a liveness alert for the Celery
renderqueue onbox(medium effort, reliability). Today the only check is a manualcurl /readyz. A cheap cron (onboxitself, or a Cloudflare Worker Cron Trigger hitting/readyzand posting to an existing channel) would catch the "worker stopped consuming" failure mode before a user notices a stuck render — cheap relative to the single-box blast radius identified in Section 3. - Decide the GPU-render question explicitly (higher effort, do only once paid volume
justifies it). Either confirm
worker-gpuis live somewhere and routerender-queue jobs there, or formally accept CPU-only avatar/compose for now and set user-facing render-time expectations accordingly. Left ambiguous, this is the risk most likely to produce a bad first paid-user experience once Section 4.1 reopens checkout.