Skip to content
SHC Docs

The comment backend: extend Frappe, do not adopt: 2026-08-18

Status: ACCEPTED, AND ALREADY BUILT AGAINST. This was written as a lane recommendation awaiting the owner’s call; it was ruled on and acted on the same day. docs/decisions/2026-08-18-community-moderation-model.md opens by naming this document’s C1 as the ruling it is downstream of, so the storefront’s comments staying in Frappe is settled and the moderation model has already been delivered on top of it.

★ C4 IS DELIVERED, NOT PROPOSED. The two missing requirements this document said should be built (a per-app ban and a per-user image-upload grant) shipped in f21b7af23, as App Comment Ban, App Comment Image Grant, App Comment Image and Community Moderation Settings plus community/{bans,images,queue,roles,settings,visibility}.py. Where §5.3 and §7 below sketch an implementation, read them as the ESTIMATE that was made before the build, not as a plan that is still open; §5.3’s specific sketch was overtaken and the correction is recorded inline there.

This document is kept because the analysis behind the ruling (§4’s candidate grid, and C2/C3/C5) exists nowhere else, and because the shipped moderation doc references a ruling whose reasoning would otherwise be unrecorded.

Measured against shc main @ 5d0fbe0. Candidate facts were fetched from upstream sources on 2026-08-18 and are cited; anything not cited is marked in §10.

The owner’s question, verbatim:

“If there’s an existing backend system, not like a Discus, drop in the Discus iframe, but an existing BACKEND APPLICATION that will do Reddit-style commenting HEADLESS, where I can use this API and comes with all the moderation things I need, then DO THAT. Else, we’ll just have to kinda build this from scratch with Frappe.”


Extend the Frappe community layer that already exists. Do not adopt a second comment backend for the storefront. Separately, SHIP Lemmy as a catalogue app, because the catalogue has no discussion app at all.

#recommendationconsequence
C1The storefront’s comments stay in Frappe. The layer under frappe/apps/marketplace/marketplace/community/ is extended, not replaced.One identity, one datastore, one backup, one upgrade. §3 is what would otherwise be thrown away.
C2★ The premise of the question is not met. No candidate ships “all the moderation things I need”. The two requirements that were supposed to discriminate against Frappe (per-app banning and per-user image upload) are the two that no single candidate has both of, and that are the cheapest things on the list to add to Frappe. §4, §5.
C3★ Every candidate’s shipped UI is either an iframe embed or a separate site. The owner ruled the iframe out by name. So in every adopt scenario the storefront UI is built by hand against a REST API; the same work as the Frappe path. Adoption buys no frontend. §5.1.
C4The two missing requirements get built: App Comment Ban (per-app, permanent, account untouched) and a per-user image-upload grant, default off. ~2 DocTypes, ~2 fields, ~300 lines with tests. §7. ★ DELIVERED in f21b7af23, and larger than this estimate: four DocTypes and six modules. See the Status note above.
C5verified_install is the reason to stay. “This person’s cluster actually runs this app” is the signal that makes the section worth visiting, it already exists (App Review.verified_basis, App Comment.verified_install), and no adopted system can produce it without a sync program back to this bench. §5.4.
C6Ship apps/*/lemmy as a catalogue app anyway. Measured: the catalogue has zero forum/discussion packages across 90 first-party apps. That is a product gap, and it is independent of C1, exactly the split the Medusa ruling already made (F5: “governs what we run, not what we ship”). §6.
C7The destination ambition does not flip the answer; it enlarges the build. What “the place to know where to get the best app from” needs is cross-app feeds, profiles, subscriptions, RSS and search. Those are storefront routes you build on top of any backend. §8.
C8A revisit trigger is stated, so this is falsifiable. §9.

2. Why the question is gating, and what it is really asking

Section titled “2. Why the question is gating, and what it is really asking”

Not “which comment system is better software”. The question is whether to run a second application (with its own datastore, own user table, own upgrade cadence and own attack surface) on the public face of the product, in order to obtain moderation features. That framing is what §4 scores.


3. What already exists, measured, not assumed

Section titled “3. What already exists, measured, not assumed”

A community layer is landed on main and it is not a sketch. (The figures in this section were measured at 5d0fbe0, BEFORE the moderation build landed. They are left as measured because they are the baseline the recommendation was argued from; for the current shape read docs/decisions/2026-08-18-community-moderation-model.md, which records 11 modules and 172 tests green against the 5 modules and 60 tests counted here.)

thingcitation
Four DocTypesfrappe/apps/marketplace/marketplace/marketplace/doctype/{app_review,app_comment,app_comment_vote,app_content_report}/
Threadingapp_comment.json:39,46: parent_comment (Link) + depth (Int)
Depth cap, replies attach rather than failcommunity/ranking.py:153: max_thread_depth = 6
Wilson lower bound, 95%, no time decaycommunity/ranking.py:87: z_95 = 1.959963984540054
Per-account throttlingcommunity/policy.py:92,100: max_comments_per_window = 20, new_account_cooldown_seconds = 900
Report → auto-hide → moderatorcommunity/policy.py:116,133: auto_hide_reports = 3, moderator_role = "System Manager"
Moderator actions, both directions, auditedcommunity/api.py:589 moderate(), :628 resolve_report()
Headless APIcommunity/api.py: whitelisted /api/method reads and POST writes
Keycloak identity, already the sessioncommunity/api.py:101 _session_user(); writes have no allow_guest and ride the frappe_keycloak session minted from the portal’s PKCE bearer
No email disclosurecommunity/api.py:111 _display_name(): projection returns a handle, never the address
Install verificationapp_review.json:89 verified_basis (dispatch/inventory); community/installs.py:130 min_display_count = 5
Denormalised onto the listing, zero extra round tripsapp_listing.json: review_count, rating_average, rating_histogram, comment_count, install_cluster_count, install_count_basis, community_updated_on
Storefront renders it SSR-sidefeatures/marketplace/src/catalog/serverCatalog.ts:389
Size1,594 lines of Python across 5 modules; 60 tests green (python3 -m unittest tests.test_community_{policy,ranking,installs} → Ran 60 tests … OK)

★ And what does NOT exist: any write UI. Nothing in the repo calls submit_review, submit_comment or vote_comment; grep returns only the read at serverCatalog.ts:389. The storefront is deliberately session-less (apps/marketplace/src/app.ts:130: keycloak: { enabled: false … }) and its listing page asserts zero fetches and zero navigations during render (features/marketplace/src/listing/installFlow.spec.tsx:186).

So the honest state is: the backend half is built and the frontend half is not. That asymmetry is the whole decision, and §5.1 is why.


Scored against the owner’s own list. ✅ = native. ⚠️ = expressible only by contorting the model. ❌ = not expressible.

requirementFrappe todayRemark42LemmyNodeBBCoral / Commento / Isso / Cusdis
threaded, Reddit-style✅✅✅⚠️ forum topics⚠️
up and down voting✅✅✅✅❌ Coral has reactions, not down-votes
ranking that survives scrutiny✅ Wilson, no decay❌ raw score❌ hot-rank with decay❌ vote count❌
image upload, per-user, default OFF❌ to build❌ IMAGE_* is instance-global❌ no per-user field on LocalUser✅ upload:post:image is per-user settable❌
ban from ONE app, permanent, account intact❌ to build⚠️ block is ?site= scoped → one site per app✅ BanFromCommunity⚠️ revoke topics:reply per category, per user❌
throttling✅ per account⚠️ per IP + UPDATE_LIMIT⚠️ site-wide LocalSiteRateLimit✅ postDelay⚠️
report/flag + moderator queue✅ + free Desk queue⚠️ block/delete, no queue✅✅ flags⚠️
headless API✅✅✅✅⚠️ embed-first
SSO riding Keycloak✅ is already the session⚠️ custom OAuth2 → own user⚠️ CreateOAuthProvider → own user⚠️ plugin → own user⚠️
verified_install✅❌❌❌❌
licence vs LicenseRef-SHC-EE (LICENSE:1)✅ ours✅ MIT⚠️ AGPL-3.0⚠️ GPL-3.0mixed
maintained✅✅✅✅❌ Cusdis archived; Commento last push 2022-11-25

Seven of the nine functional rows are already ✅ on the Frappe column. The two ❌ are §7.

  • Remark42 block is site-scoped: PUT /api/v1/admin/user/{userid}?site=site-id&block=1&ttl=7d (remark42 API docs, Admin section).
  • Remark42 image config is instance-global (IMAGE_TYPE, IMAGE_MAX_SIZE, IMAGE_FS_PATH, …), no per-user key in the whole parameter table (remark42 parameters).
  • Lemmy per-community ban exists and is exactly the shape asked for (BanFromCommunity.ts): { community_id, person_id, ban, remove_or_restore_data?, reason, expires_at? }; omitting expires_at is permanent, and the account itself is untouched (BanPerson is the separate site-wide ban).
  • Lemmy OIDC is first-class and admin-configurable: CreateOAuthProvider, AuthenticateWithOauth, OAuthAccount in lemmy-js-client/src/types/.
  • Lemmy has no per-user image permission; LocalUser.ts carries animated_images_enabled and display preferences only; rate limits are site-wide (LocalSiteRateLimit.ts: comment_max_requests, image_max_requests, …), not per account.
  • NodeBB category privileges are per-user (src/privileges/categories.js:57 getUserPrivilegeList) and include topics:reply, posts:upvote, posts:downvote (:25,32,33); upload:post:image is a global privilege (src/privileges/global.js:22) and is likewise per-user settable, which is why NodeBB is the only ✅ in the image row.
  • Licences and liveness read from the GitHub API on 2026-08-18: Lemmy AGPL-3.0, NodeBB GPL-3.0, Remark42 MIT, Talkyard AGPL-3.0, Isso MIT, Cusdis GPL-3.0 archived, Coral NOASSERTION; adtac/commento last pushed 2022-11-25, souramoo/commentoplusplus 2023-06-27.

Coral, Commento, Isso and Cusdis are excluded outright: embed-first by design, which the owner ruled out by name, and two of the four are dead. Talkyard is excluded on the down-vote row and on being a single-maintainer JVM stack. Discourse was considered and is not tabled: no native down-votes, and Rails + Postgres + Redis + Sidekiq is the heaviest option on the board.


5. Why the discriminators go the way they do

Section titled “5. Why the discriminators go the way they do”

5.1 ★ Adoption buys no frontend, and that is the crux

Section titled “5.1 ★ Adoption buys no frontend, and that is the crux”

Remark42’s blessed integration is embed.js injecting an iframe. Lemmy and NodeBB ship whole websites: different chrome, different routes, different origin. The owner ruled the iframe out; a second site is not a listing page.

So in every adopt scenario, the storefront’s comment UI is written by hand, in One/Tamagui, against a REST API. That work is identical whichever backend answers. What differs is only what sits behind the API, and behind the API, the Frappe option is already built (§3), already knows who the user is, and already knows whether they run the app.

The thing adoption is supposed to save you is the thing it does not save.

5.2 Per-app banning: the requirement that was meant to sink Frappe

Section titled “5.2 Per-app banning: the requirement that was meant to sink Frappe”

“I might wanna be able to block someone from commenting on an individual app, just block them forever, but not actually take away their user account.”

Only Lemmy expresses this natively, and it does so beautifully (BanFromCommunity). Remark42 can only approximate it by minting one site-id per app: 167 sites today, growing with the catalogue, each with its own bolt bucket and its own admin config. NodeBB approximates it by minting one category per app and revoking topics:reply for that user there.

In Frappe it is a DocType:

App Comment Ban: app (Link → App Listing), user (Link → User),
reason, banned_by, banned_on, expires_on (NULL = forever)

…plus four lines in _guard_write (community/api.py:300). That is the cheapest item in this entire document, and it is the item that was supposed to prove Frappe insufficient.

5.3 Per-user image upload, default off: the requirement that sinks Lemmy

Section titled “5.3 Per-user image upload, default off: the requirement that sinks Lemmy”

“I do want that feature to be enabled or disabled on a per user basis. And I want the ability to upload images into the comments to be DISABLED BY DEFAULT.”

Remark42: instance-global. Lemmy: no such field. Only NodeBB has it.

So there is no candidate that satisfies both §5.2 and §5.3. Lemmy wins the ban row and loses the image row; NodeBB wins the image row and only approximates the ban row. The premise “an existing system that comes with all the moderation things I need” is false for every candidate on the board, which is C2, and it is the single most important finding here.

In Frappe, the estimate at the time was: one checkbox custom field on User (allow_comment_images, default 0), an Attach Image child table on App Comment (a fieldtype this very app already uses for gallery art (app_gallery_asset.json:59)), and a count/size/type gate in policy.py.

★ AND THE BUILD DELIBERATELY DID NOT DO IT THAT WAY. The shipped design is App Comment Image Grant, where THE ROW IS THE GRANT; no checkbox, and the absence of a row is the default-off state. docs/decisions/2026-08-18-community-moderation-model.md records the reason for overruling the sketch above: a Check field with default: 0 is a default somebody can change, so “disabled by default” would have been a setting rather than a property of the system. The requirement is unchanged; the mechanism is stronger than what this section guessed.

5.4 ★ verified_install cannot be adopted

Section titled “5.4 ★ verified_install cannot be adopted”

The badge that makes this section worth visiting is “this comment is from someone whose registered cluster actually runs this app”. It exists (app_review.json:89 verified_basis ∈ dispatch/inventory; App Comment.verified_install) and it is computed by joining the comment author to the cluster ledger in this bench.

No external comment backend can know this. Adopting one means either dropping the badge or writing a continuous sync that pushes verification state from the bench into the foreign system’s user metadata, a reconciliation program, on our clock, forever. That is the shape the Medusa ruling already named:

“The sync contract: the program nobody has written” quoted in 2026-08-16-frappe-over-medusa.md §3.4

The Frappe path has zero identity work: community/api.py:101 already refuses Guest, and the session is the one frappe_keycloak mints from the portal’s PKCE bearer. Every adopted system (including the ones with good OIDC) mints its own user record keyed by the provider subject. That is a second user table that drifts: a Keycloak rename, disable or delete does not propagate, and the per-app ban in §5.2 attaches to the foreign id, not to the portal account.

  • Remark42: +1 Go binary, +bolt files. Cheapest to run of the three. Loses on ranking, images, per-app scope, and verified_install.
  • Lemmy: +Rust backend, +second Postgres, +pict-rs, +lemmy-ui: four containers and a second database to back up, restore-drill and upgrade. ActivityPub federation is on by default and is a liability on a public storefront (inbound federated content and its moderation load); it can be disabled. AGPL-3.0: running it stock is fine, but the modifications this would need (Wilson ranking, per-user image gate, verified badge) make it a public fork you must publish, against LICENSE:1, LicenseRef-SHC-EE.
  • NodeBB: +Node app, +Redis/Mongo/Postgres. GPL-3.0, same fork consideration.
  • Every one of them is a second backup surface, and the house rule is that a stack backs up what it owns, so that is a second backup.yaml, a second restore rehearsal, and a second thing that can be restored to the wrong point relative to the listings its rows point at.

6. The dogfooding argument: it holds, but not for this

Section titled “6. The dogfooding argument: it holds, but not for this”

SHC is a self-hosting platform; if the answer is Remark42 or Lemmy, that app plausibly becomes an SHC app package, and the marketplace runs on the thing it sells.

The first half holds and the second half does not.

Measured: across the 90 first-party packages (3 classic, 13 integrated, 46 standalone, 22 flagship, 6 enterprise) there is no forum, discussion or comment app. A catalogue that sells self-hosting and cannot sell a community platform has a gap. Ship Lemmy. That is C6, and it is worth doing on its own merits.

But shipping it and running the storefront on it are separable, and the project has already ruled on exactly this split:

F5: apps/standalone/medusa remains a catalogue app we SELL. This ruling governs what we run, not what we ship. 2026-08-16-frappe-over-medusa.md §1

Conflating them buys a worse storefront in order to obtain a catalogue entry you can have anyway.

And the dogfood is not cheap. The measured cost of making an adopted app ride this estate’s Keycloak is apps/flagship/matrix/: 25 files, seven job YAMLs, and an oidc.plug.yaml carrying ~100 lines of comments that are a catalogue of the ways the integration went wrong before it went right: a realm that resolved to the wrong tenant, an issuer read from a nonexistent socket field, a public_base pinned to an internal-only URL, a post-logout URI Keycloak refused. That is the real price of “it becomes an SHC app”, and it is paid whether or not the storefront uses it.


7. What extending costs, stated so it can be compared

Section titled “7. What extending costs, stated so it can be compared”
#workshaperough size
E1App Comment Ban DocType + enforcement in _guard_writeper-app, per-user, expires_on NULL = permanent, account untouched~120 lines incl. tests
E2Per-user image grantUser.allow_comment_images (default 0) + App Comment Image child table (Attach Image) + count/size/MIME gate in policy.py~180 lines incl. tests
E3The write UI, the actual bulkcomment box, reply, vote, report, sign-in door. Needed identically under every option in §4 (C3)the large item
E4Moderator queueFrappe Desk list views on App Content Report filtered state=open: free, already reachable, System Manager already the role~0
E5Community surfaces for §8cross-app “recent discussion”, per-user profile, RSSroutes on top of existing methods

E1 + E2 are the two ❌ rows in §4 and together are smaller than the OIDC plug of a single adopted app.

If the owner overrules and adopts anyway, the honest migration is: Lemmy, federation disabled, one community per listing seeded from App Listing, Keycloak wired via CreateOAuthProvider, and deleted from this repo: the four community DocTypes, the 1,594 lines under community/, the 60 tests, the seven denormalised aggregate fields on App Listing, the Wilson ranking, and the verified_install badge (§5.4), which has no home on the other side. The read at serverCatalog.ts:389 is repointed at Lemmy’s API. E3 is still owed in full.


8. Does the destination ambition change the answer?

Section titled “8. Does the destination ambition change the answer?”

“it’s very very very important to me that each app is more than simply just having a comment section … should be the place to know where to get the best app from.”

It raises the bar. It does not move the decision.

A destination needs: cross-app browsing (“what is being discussed today”), user profiles with history, subscriptions and notifications, search over discussion, RSS, and sort surfaces across the whole store. That list is real, and it is the strongest case anyone can make for Lemmy or NodeBB; those are forums, and this is forum machinery.

But it is machinery you cannot use. Per C3, their UIs are ruled out, so every one of those surfaces is a storefront route you build regardless. What you would get from adoption is the storage for them, and the Frappe layer already stores comments, votes, reports and aggregates; a “recent discussion” feed is one whitelisted method over App Comment ordered by creation, and an RSS feed is that method rendered as XML.

And the thing that actually makes a store the place to find the best app is not generic forum machinery; it is signal an anonymous forum cannot produce: verified_install, install_cluster_count floored at 5 (installs.py:130), and a Wilson ranking that a brigade cannot bootstrap. All three live in the bench, and only in the bench.

So the destination ambition changes what to build (E5), not where to build it.


State it concretely so this is falsifiable rather than doctrine. Revisit when any of these become true:

  • Discussion volume outgrows moderation-by-Desk: a standing queue that a human cannot clear, i.e. a real trust-and-safety workload rather than a spam trickle.
  • Federation becomes a requirement: comments readable and replyable from the fediverse. Lemmy is the only path to that and it is not approximable.
  • Discussion decouples from listings: general-purpose forums, off-topic categories, user-created communities. At that point what would be built in Frappe approaches rebuilding Lemmy, and the trade flips.
  • A second product needs the same discussion layer, making a shared service cheaper than a per-product one.

None of these is true today.


Verified in-repo at 5d0fbe0: every citation in §3; the tier counts and the absence of any forum/discussion package under apps/*/; LICENSE:1; apps/flagship/matrix/ file set and its oidc.plug.yaml; the 60 passing community tests; the absence of any caller of the write endpoints.

Verified upstream on 2026-08-18 (fetched, not recalled): every source in §4.1: remark42’s admin API and parameter table, Lemmy’s BanFromCommunity, LocalUser, LocalSiteRateLimit and OAuth types, NodeBB’s category and global privilege maps, and the GitHub licence/liveness data.

unverified: do not assert these without a source: that Remark42 running 167 sites is operationally sound at that count (the multi-site capability is documented; the scaling is not measured); that Lemmy’s federation can be fully disabled with no residual inbound surface (the federation_enabled flag exists; the residue is not measured); that NodeBB’s threading is or is not adequate for a Reddit-style listing page (its data model was not read); the size estimates in §7, which are engineering judgement; Coral’s exact licence, which the GitHub API reports as NOASSERTION; and the claim that AGPL §13 would bite a modified Lemmy in this deployment, which is a reading of the licence and not legal advice.