Comment Object Documentation

The Comment object represents a user-generated comment within Replyke, including support for replies, mentions, upvotes, and optional media such as GIFs.

Properties

PropertyTypeDescription
idstringUnique identifier for the comment (auto-generated by Sequelize).
projectIdstringIdentifier linking the comment to a specific project.
userIdstringIdentifier of the user who created the comment.
entityIdstringIdentifier of the entity the comment belongs to.
parentIdstring | nullIdentifier of the parent comment if it’s a reply.
contentstring | nullThe main text content of the comment.
gifIGif | nullOptional GIF attached to the comment.
mentionsIMention[]List of mentioned users in the comment.
upvotesstring[]List of user IDs who upvoted the comment.
downvotesstring[]List of user IDs who downvoted the comment.
parentDeletedAtDate | nullTimestamp indicating if the parent comment was deleted.
createdAtDateTimestamp when the comment was created.
updatedAtDateTimestamp when the comment was last updated.
deletedAtDate | nullTimestamp if the comment was deleted (null if active).

Supporting Types

GIF Object (IGif)

PropertyTypeDescription
altTextstringAlternative text for accessibility.
gifPreviewUrlstringURL to a preview version of the GIF.
gifUrlstringURL to the full-size GIF.
idstringUnique identifier for the GIF.
urlstringMain URL for the GIF.
aspectRatiostringAspect ratio of the GIF (e.g., “16:9”).

Mention Object (IMention)

PropertyTypeDescription
idstringUser ID of the mentioned user.
usernamestringCurrent username for easy lookup.

Example Usage

Basic Comment

{
  "id": "123456",
  "projectId": "project-xyz",
  "userId": "user-789",
  "entityId": "entity-456",
  "content": "This is a great post!",
  "mentions": [{ "id": "user-555", "username": "johndoe" }],
  "upvotes": ["user-100", "user-101"],
  "downvotes": [],
  "createdAt": "2024-02-14T12:34:56Z"
}

Comment with GIF

{
  "id": "7891011",
  "projectId": "project-abc",
  "userId": "user-222",
  "entityId": "entity-333",
  "content": "This is hilarious!",
  "gif": {
    "altText": "Funny dancing cat",
    "gifPreviewUrl": "https://example.com/preview.gif",
    "gifUrl": "https://example.com/full.gif",
    "id": "gif-999",
    "url": "https://example.com/gif",
    "aspectRatio": "4:3"
  },
  "mentions": [],
  "upvotes": ["user-555"],
  "downvotes": [],
  "createdAt": "2024-02-14T13:45:00Z"
}

Integration Flexibility

The Comment object is designed to accommodate multiple use cases, including threaded discussions, reactions, and media-rich responses. Developers can extend the metadata and structure to fit specific project requirements.