Developer docs
Logs

Porting map

What came from brightbean-studio and adwords-adsense, and what was dropped.

docs/PORTING.md

Where each capability in Verjson Marketing Studio comes from, and what is actually being carried across. The two source apps stay in the repo as read-only references while porting is in progress; they are not built, deployed, or imported from.

SourceWhat it isStackRole here
requirements.txtThe brief—The authority. Where a source app disagrees with it, the brief wins.
archive/brightbean-studio/A social-media management platformDjango 5 · HTMX · Alpine · PostgresThe organic/social half: composer, calendar, approvals, publisher, inbox, analytics, media, notifications, client portal, agent API + MCP
archive/adwords-adsense/A Google Ads autopilotNext.js 16 · Prisma · NextAuth · NeonThe paid half: Ads integration, campaign wizard, asset pipeline, conversion tracking, GA4, optimisation engine
archive/brightbean-studio-app/An earlier Next.js scaffold of the same ideaNext.js 16Superseded — this repo is its successor. Nothing to port.

What "porting" means here

Neither source is copied file-for-file. brightbean is Python and Django-shaped: its ORM models, class-based views, template partials and django-background-tasks jobs have no TypeScript equivalent to lift. What carries across is the design — the data model, the state machines, the provider interface, the job cadences, the security posture — re-expressed in this stack.

adwords-adsense is already Next.js + Prisma, so its src/lib/** is genuinely reusable: the Google Ads client, the sharp asset pipeline, and the crypto helpers move with light edits, but into apps/api rather than into route handlers, since this repo's backend is a separate service.

Kind of thingbrightbean (Django)adwords-adsense (Next.js)
Data modelRe-expressed as Prisma models — direct translationMerge into the same schema
Business logicRewritten in TS from services.py / engine.pyPort src/lib/** with edits
HTTP layerRewritten as Hono routesRewritten — route handlers → Hono
Templates / UIRebuilt in React against this design systemComponents reusable; both are Tailwind + shadcn-shaped
Background jobsCadences kept, runtime replacedVercel cron → worker process
Provider adaptersInterface kept verbatim, implementations rewrittenGoogle Ads client ports largely intact

Feature provenance

FeatureFromNotes on the port
F-002 AuthBB apps/accountsDjango-allauth → jose + bcrypt. 2FA and social login deferred.
F-003 OrganizationsBB apps/organizationsModel translates directly.
F-004 WorkspacesBB apps/workspacesKept — a workspace is the brand/client scope below an org.
F-005 RBACBB apps/membersRoles extended with agency and client for the hired-agency case.
F-006 Agency loginsREQ onlyNot present in either source. New: project-scoped external users.
F-007 Client portalBB apps/client_portalMagic-link pattern kept (32-byte token, stored as a SHA-256 hash).
F-008 Credential vaultBB apps/credentialsAES-256-GCM field encryption, key via HKDF from a env secret. Same design, node:crypto.
F-011 Audit logBB + templateAlready live.
F-021 CalendarBB apps/calendarModel + scheduling semantics kept; drag-to-reschedule rebuilt in React.
F-022 AI plan generationREQ + AA phase 7cAA's blueprint generator was Gemini-targeted and never shipped (blocked on an API key). Rebuilt on Groq.
F-030 ComposerBB apps/composerPer-channel overrides + live preview. HTMX round-trip preview → client-side render.
F-031 AI composerBB apps/intelligenceBB called a paid external "Intelligence" service with Stripe billing. Dropped — internal tool, so it calls Groq directly.
F-032 AI videoREQ onlyNew. ElevenLabs voice + a render step.
F-033 Media libraryBB apps/media_libraryPillow/FFmpeg → sharp (+ FFmpeg for video). AA's 5-size ad pipeline folds in here.
F-035 ApprovalsBB apps/approvalsThe state machine ports as-is; it is the single most reusable piece of design in either source.
F-037 PublisherBB apps/publisher/engine.pyRetry + partial-failure semantics kept.
F-040–F-047 ChannelsBB providers/The abstract SocialProvider interface is kept almost verbatim — see ARCHITECTURE.md.
F-046 InboxBB apps/inboxIncluding sentiment.py and the webhook receivers.
F-047 WebhooksBB apps/inbox/webhooks.pyHMAC-SHA256 verification for Meta; PubSubHubbub for YouTube. Polling stays the baseline.
F-050 Google AdsAA src/lib/google-ads, src/lib/adsThe most directly reusable code in either source.
F-051 Meta AdsREQ onlyNew, built to the same AdsProvider interface.
F-052 BenchmarksREQNeither source had benchmarks. New.
F-053 Campaign wizardAA src/app/app/campaigns/newSEARCH + PMAX flows.
F-054 Conversion trackingAA src/app/app/accounts/[id]/conversion-trackingIncludes the "tracking broken since…" detector.
F-055 Ad assetsAA src/lib/assetssharp pipeline, 5 required sizes.
F-056 OptimisationAA phase 10 (designed, unbuilt)Built here behind the approval gate — AA's plan was auto-apply by default.
F-060–F-063 AnalyticsBB apps/analyticsderive.py / metrics.py / freshness.py are the reference.
F-064 GA4AA src/lib/ga4Ports directly.
F-070–F-072 Agent APIBB apps/api, apps/api_keysdjango-ninja → the same /api/v1. Key hashing + scoping kept.
F-071 MCPBB apps/mcp, apps/oauth_serverStreamable-HTTP transport. BB's full OAuth 2.1 DCR server is deferred — scoped keys first.
F-085 GDPRBB F-8.4Export + delete per workspace.

Deliberately dropped

DroppedWhy
BB's Stripe billing / subscription plumbing (apps/intelligence billing models, StudioCheckoutAttempt)This is an internal tool. Nothing is sold, so nothing is billed.
BB's white-label configuration (F-5.2)One brand. Revisit only if we resell.
AA's pre-pay wallet + money-transmitter designSame reason — and it carried real regulatory exposure (RBI PPI / US money transmitter) that an internal tool has no reason to take on.
AA's hosted client landing pages (<slug>.adsense.app)Out of scope per the brief.
BB's Heroku / Railway / Render deploy manifestsOur target is Compose locally, Kubernetes in production.
BB's HTMX + Alpine frontendReplaced wholesale by this repo's React design system.
AA's NextAuth + Neon serverless driverReplaced by this repo's JWT auth and a standard Postgres connection.

Reference sources

The sources live in archive/. Their nested .git directories were removed so they commit as plain files rather than as gitlinks that clone as empty directories, and their node_modules are not tracked. They are excluded from the npm workspaces, both tsconfigs and lint — nothing in archive/ is built or shipped.

Delete them once the port is complete. This map is the record that survives; the code is only the reference.