Content OS

Apps — Index

Six deployable applications, one pipeline running between them. The console and the portal are the product's two faces — both pages-only Next.js apps in front of one Express backend that owns every /api/* route and all MongoDB access.

AppCodeWhoWhat
Admin Consoleapps/admin-app/Content teams, reviewers, admins~60 screens; serves no API routes of its own — /api/* is a wildcard rewrite to the backend
Client Portalapps/client-app/The client, reviewing workOne screen; reads everything over /api/portal/*
Backendapps/backend/Both frontendsThe Express API (:3002) plus a separate worker process — every /api/* route, auth, Mongo, and ten background workers
Monitoring consoleapps/monitor-app/Platform operators:3005 — overview, requests, errors, AI & providers, integrations (every third party the backend calls), unit economics (per tenant, per provider, daily trend), jobs (backlog + worker heartbeats), uptime, alerts, and a Configs page (connection snapshot plus operator-editable price entries)
Studioapps/studio/InternalThe visual studio's original home — a waypoint. Campaign composition now runs in-process in the backend (modules/campaign/, modules/studio/, modules/video/)
Roadmap viewerapps/roadmap-app/EveryoneRenders these docs; no pipeline role

How they fit together

The client portal is not a separate product — it is the human approval gate in the middle of the admin app's pipeline.

ADMIN                                CLIENT                      ADMIN
─────                                ──────                      ─────
sources
   |
fetch + enrich          ──────▶  content_news_items
   |                                    |
   |                            Discovery tab
   |                            approve (Y) / skip (N)
   |                                    |
   |                            content_script_queue
   |                            content_generation_jobs
   |                              { origin: "client" }
   |                                    |
generation worker  ◀────────────────────┘
   |
   └──────────────────────▶  content_scripts
                                        |
                                Scripts tab
                                approve / send back
                                        |
                            content_scripts.status  ──────▶  calendar
                                                                 |
                            Calendar tab  ◀───────────────────────┘
                              (read-only)

A second lane runs beside this one and never reaches the portal: Campaign Creatives. An article from the feed (or a finished blog) becomes the brief, the campaign-image worker renders every asset at its ratios and languages, a video asset is drawn as a storyboard and gated twice by a console reviewer, and everything lands in the Assets library. Nothing in that lane is visible to the client today.

They meet in the backend, never in each other. The portal opens no database of its own — it reads and writes tenant content over HTTP (/api/portal/*, an Authorization: Bearer attached by its middleware), and there is still no API call between the two frontends; the backend is the only thing either talks to.


What differs

AdminClient
AuthPOST /api/auth/login — both check the same control-DB users collection, in the backendPOST /api/portal/auth/login — its own endpoint, so no request can ask for the other app's session
Session cookieConsole cookie, sameSite: laxcontent_engine_client_token, sameSite: strict, 15 days
TenantsEvery workspace in the user's workspaceIds, switchable from the sidebarOne, resolved from the session
BlogsFull studio, CMS deliveryNot visible at all
ScriptsWrite, refine, version, scheduleRead four sections, approve or reject
Production notesVisibleStripped at the data layer before they reach the browser

That last row is worth keeping: toClientVersions() drops on-screen text, b-roll, editing notes and scores at the data boundary rather than hiding them in the UI, so a future component change cannot leak them.


Shared and not shared

Shared: the control-DB users collection and token format, the content_* collection schema, and the tenancy model — a user carries workspaceIds[] (every workspace they may reach) and isPlatformAdmin (whether they may cross them).

Not shared: JWT_SECRET, which lives only in apps/backend/ — the one place sessions are minted and verified; neither frontend holds any crypto. Nor code: the two apps build from separate Dockerfiles with no workspace linkage. Index creation is owned by the backend, which auto-creates Mongo indexes at boot.


The gap between them, closing

The client used to be able to reject but not say why. Both sides now capture the why: a portal reject or request-changes refuses to save without a note (decision_notes on the approval item), and in the admin console an article rejection requires a reason from a fixed vocabulary (review-reason-dialog.tsx). The admin-side reasons land as durable events in content_compliance_feedback, which the Learning Agent's compliance-feedback sub-agent reads into per-tenant pattern reports on the Review Insights page — exactly the signal it was proposed to read. The portal's notes stay on the approval item and do not yet feed that agent.

Source: roadmap/apps/index.md