Skip to content

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.

AppPortRole in the storyTransports
auth3001Authors sign in (OAuth2, JWT issuance)HTTP
api3002Main API — users, orgs, audio hooksHTTP, GraphQL, OpenAPI
assistant3003AI tools (summarize, tag, weather demo)MCP
live3004Live comments and notificationsWebSockets
workerAsync jobs — newsletters, audio queueQueue, Schedule
Terminal window
nestrs run db up # Postgres — api + auth
nestrs run dev auth # issuer on :3001
nestrs run dev api # resource server on :3002
nestrs run dev live # WebSockets on :3004
nestrs run dev assistant # MCP on :3003
nestrs run dev worker # headless — needs Redis

api 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.

Three entry points — two learning paths (CLI) and one hosted reference (this repo):

  • Getting started and the tutorial scaffold hello and blog with the CLI — reproducible in any workspace, not checked into this repo.
  • Fundamentals walks blog step ① — inline handlers in apps/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 (crates/features/)Publish role
postsBlog articles — api (HTTP, org + author scoped)
usersAuthors and editors — api
orgsPublications / tenants — api
oauthOAuth2 login on auth
audioMedia attachments + queue/schedule hooks
authn / authzJWT verification and row-level policy — api, not the tutorial blog