Simple Comment is a commenting platform for any website. Free, flexible, open-source, private, and scalable.
See the demo: https://simple-comment.netlify.app
NB: Moderation tools are not yet adequate. There is no notification when a user has posted a comment, nor any way to hold it in moderation before approval. If you like this project and would like to see it developed further on a specific timeline, contact me. Otherwise, this project is still on the road, but on the slow road.
The minimum functionality is up and running!
Simple Comment can be run on the same server as your website or on a separate, cross-domain server
It is necessary that Simple Comment is served via https:
Follow these instructions. If anything is unclear, please create a new issue
example.env
into the same, project root directory and rename it to be .env
.env
, enter your own (made up or randomly generated), secret values for these entries (i.e. replace everything to the right of =
in each line).
.env
add the proper DB_CONNECION_STRING
Environmental Variables
click the button Edit Variables
.env
add the key and corresponding value for all
variablesIS_CROSS_SITE
add the value true
if the comment system is hosted in its own domain and false
if it is the same domain.<script src="https://github.com/rendall/simple-comment/raw/master/[path-to]/simple-comment.js" defer></script>
(src
must point to the simple-comment.js
file)<div id="simple-comment-display"></div>
simple-comment.js
file to your website's script folderRefused to connect to 'api/auth' because it violates the following Content Security Policy directive: connect-src 'self'
https://<your-comment-app>.netlify.app
to your Content Security Policy header next to connect-src
(q.v.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/connect-src)Access to fetch at 'https://<your-comment-app>.netlify.app/.netlify/functions/' from origin '<your-website>' has been blocked by CORS policy...
<your-website>
to the ALLOW_ORIGIN
key in .env
and as a Netlify environmental variablelogin.html
page you uploaded in Setup andSIMPLE_COMMENT_MODERATOR_ID
and SIMPLE_COMMENT_MODERATOR_PASSWORD
values in your .env
fileThe default stack uses Netlify + MongoDB for the backend, and a minimal fetch
based client for the frontend, but it can be readily adapted to use any technology stack, as long as the tests pass and the API conforms to the Open API 3 schema file
You can get your own free-tier MongoDB-in-the-cloud by following these instructions
Assumes a unix-like environment, like Ubuntu.
nvm install
npm install -g yarn
yarn install
yarn run build
yarn run test
yarn run test:e2e
sudo systemctl start mongod
(q.v. Linux)yarn run start
The API specification is described by the file simple-comment-openapi3.json in Open API 3 format and is designed to be interchangeable with any backend, frontend and identification system
This is an overview of the Simple Comment API endpoints
/comment
A comment
is text that a user posts in reply to either another comment
or a topic
, and presenting these replies is the sole reason this project exists!
The comment endpoint is for the creation, reading, updating and deleting (CRUD) of individual comments. All comments must have a parent, that is, something it replies to, whether a topic
or comment
/topic
A topic is a special kind of comment that by default can only be created by admin users, and forms an organizational bucket for comments that reply. It is a kind of root comment, and therefore has no parent
The /topic endpoint handles CRUD for these root comments. A GET operation of /topic
will get a list of topics and GET on /topic/{topicId}
will get all comments in reply to that topic and their descendents
/user
By default, comments can be posted by anonymous users, but Simple Comment does have a minimal identification scheme so that commenters who choose to do so can have control over their comments after the are posted, according to policy
/auth
Auth is the endpoint for the authentication and identification scheme. A user submits their username and password to the auth endpoint, and receives a JSON Web Token (JWT) that authenticates them as that user for other CRUD operations
/verify
Returns the logged-in user id or 401
policy
is an object holding key-value pairs that governs how Simple Comment behaves, determining for instance maximum comment length or whether ordinary users can delete themselves.
{
isGuestAccountAllowed : boolean, // if true, a visitor can post anonymously using a guest account. if false, only authenticated users can comment.
canFirstVisitCreateTopic : boolean, // if a discussion does not exist for a page, shall it be created when visited for the first time, or does admin create all topics?
canGuestCreateUser : boolean, // can a user with guest credentials create (their own) user profile? if 'canPublicCreateUser' is set to 'true' this setting is ignored
canGuestReadDiscussion : boolean, // can a user with guest credentials browse and read discussions? if 'canPublicReadDiscussion' is set to 'true' this setting is ignored
canGuestReadUser : boolean, // can a user with guest credentials view user profiles? if 'canPublicReadUser' is true, this setting is ignored
canPublicCreateUser : boolean, // can a user with no credentials create (their own) user profile?
canPublicReadDiscussion : boolean, // can a user with no credentials browse and read discussions?
canPublicReadUser : boolean, // can an anonymous visitor view any user's profile?
canUserDeleteSelf : boolean, // can a user delete their own profile?
maxCommentLengthChars : number, // Attempting to post a comment longer than this number of characters will be rejected by the API
}
There are 34 solutions that are not Simple Comment listed here. Nearly all of these are more mature than Simple Comment, and I would recommend considering one if you are not looking specifically for a serverless, open-source, self-hosted solution. Listed below each are pros and cons that distinguish it from Simple Comment. If Trust is required is listed, it means that using the service requires trust in the company, because they will be serving closed-source code to your users that you do not control and cannot easily inspect; as well, user data will be held on servers they control. This list is based on public documentation, not experience. If anything is incorrect or missing, please let me know.
Comment Box https://commentbox.io/
Commentics https://www.commentics.org/
Commento https://commento.io/
Discourse https://www.discourse.org/
Disqus https://disqus.com/ - The 400 pound gorilla of e
Facebook Comments Plugin https://developers.facebook.com/docs/plugins/comments/
FastComments https://fastcomments.com/
GraphComment https://graphcomment.com/
HTML Comment Box https://www.htmlcommentbox.com/
HashOver https://www.barkdull.org/software/hashover
Hyvor Talk https://talk.hyvor.com/
IntenseDebate https://intensedebate.com/
Isso https://posativ.org/isso/
Just Comments https://just-comments.com/
Muut https://muut.com
Remark42 https://remark42.com/
Talkyard https://www.talkyard.io/
Valine https://valine.js.org/en/index.html
schnack! https://schnack.cool/
More: a list of commenting systems that I have not evaluated