Giter VIP home page Giter VIP logo

commento's Introduction

Commento

An open source, lightweight, and tracking-free comment engine.

Example

Installation

I've hosted a live demo here. Check it out!

It's really simple to embed a Commento section to your webpage. A trivial page would look like:

<html>
    <body>
        <script src="http://0.0.0.0:8080/assets/commento.min.js"></script>
    </body>

    <script>
        Commento.init({
            serverUrl: "http://0.0.0.0:8080"
        })
    </script>

    <div id="commento">
    </div>
</html>

And that's it! Source the client-side script, add a div called commento (which will contain the comments) and initialize Commento with your server. The client-side script does all the hard work of building the markup and loading the CSS. The assets themselves (JavaScript and CSS) as served by the go application.

The client-side script accepts an optional second argument options, in the form of a plain object. Currently, the only option is (boolean) honeypot, which adds a hidden input field to fool spammers. If anything is input into this field, the submission is silently ignored. This option defaults to false if the options param is not set explicitly.

To get the server running, run:

$ go get -v github.com/adtac/commento

and build the project using a go build . to get a binary. Internally, I've used sqlite3 as the database. Take a look at the code for more details.

Why?

Disqus is one of the most popular commenting services. However, over the years it has become quite bloated - one blog post has a detailed analysis. In short, a Disqus-free page makes about 16 HTTP requests while the same page makes 105 requests when Disqus is enabled! This is mostly due to various tracking services that record every action you take on any website that has Disqus embedded.

I ran a quick test: go to this codepen and open your developer tools. You'll see that the sum total of all network requests related to Disqus comes to about ~250 kB! And there aren't even any comments!

So I thought I'd quickly write a simple comment engine in Go. I've been learning Go for the past month or so and it has been fantastic.

With Commento, you wouldn't need to worry about shady ad companies getting your data through hundreds of tracking services. You wouldn't need to worry about your page being slowed down - Commento uses just 22 kB total. And it's all open source.

Contributing

Commento is extremely simplistic in comparison to Disqus. It does not have voting, moderation, and some of the more advanced stuff. Patches are more than welcome! But do keep in mind the whole purpose of this project - a lightweight comment engine with zero user tracking.

Development

To run the server

$ docker build . -t adtac/commento:VERSION
$ docker run -d -p 8080:8080 adtac/commento:VERSION

For the front end any static server will do, you can grab any from this list.

License

MIT License. See the LICENSE file for more information.

commento's People

Contributors

adtac avatar caarlos0 avatar smbkr avatar peteretelej avatar gaiusmartius avatar xe avatar daehyeok avatar seemethere avatar darkthrone avatar

Watchers

mntz avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.