The Publish workspace
Publish is the story the NestRS monorepo tells. Not a crate name — a
multi-tenant publishing platform: publications (orgs), authors (users),
posts, live comments, background jobs, and an MCP assistant for drafting.
Several binaries, one workspace, shared crates/features/, no chatty RPC
between deployables.
Simple learning paths (hello, blog) live in the
docs and the CLI — scaffold them in your own
workspace with nestrs new. This repository hosts only the complex
reference: Publish.
The apps
Section titled “The apps”| App | Port | Role in the story | Transports |
|---|---|---|---|
auth | 3001 | Authors sign in (OAuth2, JWT issuance) | HTTP |
api | 3002 | Main API — users, orgs, audio hooks | HTTP, GraphQL, OpenAPI |
assistant | 3003 | AI tools (summarize, tag, weather demo) | MCP |
live | 3004 | Live comments and notifications | WebSockets |
worker | — | Async jobs — newsletters, audio queue | Queue, Schedule |
nestrs run db up # Postgres — api + authnestrs run dev auth # issuer on :3001nestrs run dev api # resource server on :3002nestrs run dev live # WebSockets on :3004nestrs run dev assistant # MCP on :3003nestrs run dev worker # headless — needs Redisapi and auth share the same database and the features
crate; the worker shares Redis with the API’s queue producer. Tokens are
self-contained JWTs — the API verifies with a public key, never calls the
issuer over HTTP.
How the docs use Publish
Section titled “How the docs use Publish”Three entry points — two learning paths (CLI) and one hosted reference (this repo):
- Getting started and the tutorial scaffold
helloandblogwith the CLI — reproducible in any workspace, not checked into this repo. - Fundamentals walks
blogstep ① — inline handlers inapps/blog/(vocabulary only). The tutorial builds the composed layout from page 1 onward. - Reference pages (HTTP, GraphQL, queue, MCP, …) point at the matching Publish app above — the complex example you clone and explore.
Feature map
Section titled “Feature map”Feature (crates/features/) | Publish role |
|---|---|
posts | Blog articles — api (HTTP, org + author scoped) |
users | Authors and editors — api |
orgs | Publications / tenants — api |
oauth | OAuth2 login on auth |
audio | Media attachments + queue/schedule hooks |
authn / authz | JWT verification and row-level policy — api, not the tutorial blog |
Where to go next
Section titled “Where to go next”- Issuer and resource server — why auth is a separate binary.
- Build a feature end to end — scaffold your own
apps/blog/. - E2E testing — every Publish app ships
tests/e2e.rs.