A comprehensive, category-based rating system supporting binary, bipolar, and scale ratings with clean APIs and headless JavaScript integration.
RatePress supports three distinct rating categories, each optimized for different use cases
Simple yes/no feedback with heart or like icons
Up/down voting with neutral option for balanced feedback
Star ratings, dot scales, or numerical sliders for detailed feedback
Clean, category-based database design supporting all rating types
| Column | Type | Description |
|---|---|---|
id | BIGINT UNSIGNED | Primary key |
object_id | BIGINT UNSIGNED | Post or comment ID |
object_type | ENUM('post', 'comment') | Type of content being rated |
user_id | BIGINT UNSIGNED | User ID (0 for anonymous) |
ip | VARCHAR(45) | IP address for rate limiting |
cookie_hash | VARCHAR(64) | Anonymous user identifier |
category | ENUM('binary', 'bipolar', 'scale') | Rating category |
value | FLOAT | Rating value (normalized 0-1 for scale) |
created_at | TIMESTAMP | Rating timestamp |
Clean, category-based REST endpoints for all rating operations
Submit a rating for any object with category and value validation.
| Parameter | Type | Required | Description |
|---|---|---|---|
object_id | integer | Yes | Post or comment ID |
object_type | string | No | 'post' or 'comment' (default: 'post') |
category | string | Yes | 'binary', 'bipolar', or 'scale' |
value | number | Yes | Rating value (validated per category) |
Headless JavaScript system using data attributes for complete template flexibility
The JavaScript system automatically updates all elements using data attributes when ratings change.
Buttons show user's rating
Statistics update instantly
Works with any design
How the category-based system works under the hood
Values: 0 (no), 1 (yes)
Values: -1 (down), 0 (neutral), 1 (up)
Values: 0.0 to 1.0 (normalized)
Complete examples for implementing rating systems
The RatePress rating system provides everything you need for professional user feedback collection.