Skip to main content

Ratings & Comments

User engagement on project pages.

Two independent features, controlled by feature flags. Both show on /project/[slug] pages when enabled.

Project detail page

A project detail page showing ratings and comments

Ratings

  • 1–5 stars, one rating per user per project
  • Average shown on the project card in the catalog
  • Stored in the ratings table
  • Component: StarRating in components/directory/

To sort projects by rating in the listing, pick the top_rated option — already configured in directory.config.ts.

Turning on / off

config/features.config.ts
ratings: true,   // or false to hide

Disabled → widget doesn't render, API returns 404, catalog sort option is hidden.

Comments

  • Flat list (not threaded by default)
  • Anyone logged in can post
  • Admins see a delete button on any comment
  • Stored in the comments table
  • Component: CommentSection

Turning on / off

config/features.config.ts
comments: true,   // or false to hide

Moderation

Comments aren't auto-moderated. For small directories you can watch them manually from /admin → click a project → see comments inline. For larger directories, integrate a third-party moderation API in the POST /api/comments route.

Anti-spam basics

  • Rate-limited per IP via the comments rate-limit tier (lib/rate-limit.ts)
  • Input is sanitized by sanitizeString() in lib/validations/schemas.ts (strips <>, javascript:, on*=, data: URIs)
  • Logged-in users only — no anonymous comments