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

Ratings
- 1–5 stars, one rating per user per project
- Average shown on the project card in the catalog
- Stored in the
ratingstable - Component:
StarRatingincomponents/directory/
To sort projects by rating in the listing, pick the top_rated option — already configured in directory.config.ts.
Turning on / off
ratings: true, // or false to hideDisabled → 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
commentstable - Component:
CommentSection
Turning on / off
comments: true, // or false to hideModeration
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
commentsrate-limit tier (lib/rate-limit.ts) - Input is sanitized by
sanitizeString()inlib/validations/schemas.ts(strips<>,javascript:,on*=,data:URIs) - Logged-in users only — no anonymous comments