Coder Social home page Coder Social logo

jdrew1303 / schnack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from schn4ck/schnack

0.0 1.0 0.0 224 KB

๐Ÿ—ฃ๏ธ Simple node app for Disqus-like drop-in commenting on static websites

Home Page: https://www.vis4.net/blog/2017/10/hello-schnack/

License: Other

JavaScript 87.59% HTML 7.82% Shell 0.09% CSS 4.50%

schnack's Introduction

schnack.js

schnack.js is a simple node app for Disqus-like drop-in commenting on static websites.

Related projects

This is not a new idea, so there are a few projects that are doing almost the same thing:

Server requirements

Node 6+ and SQLite.

Minimal setup drop-in

The app runs as a node server that provides a JS file to be dropped into any website.

<div class="comments-go-here"></div>
<script src="//comments.yoursite.com/embed.js"
    data-schnack-slug="post-slug"
    data-schnack-target=".comments-go-here">
</script>

Authentication

So far, users who want to post a comment need to Twitter or Github. More auth providers can be added easily, thanks to Passport.js.

Data storage

Comments are stored in a SQLite database. For a normal sized blog this should last a couple of decades.

Comment approval

New comments need to be approved by the site admin, who can see and approve or reject them right in the comments section. To save some work, admins can "trust" certain authors so their comments are approved automatically.

Push notifications for new comments

Schnack.js provides two mechanisms to remind you of new comments. The old-school way is an RSS feed that you can use in services like IFTTT. Alternatively you can hook into a push notification service like Pushover to get notifications right to your phone.

New: web-push notifications

If you want you can be notified about new comments using web-push notifications. To configure this you need to do 3 things:

  1. Generate the vapid-keys using node_modules/.bin/web-push generate-vapid-keys and copy them into your config.json.
  2. Copy the sw.js into your website's root path.
  3. Next time you log into your site you will be asked to allow notifications.

Semi-automatically trust your friends

You can provide a list of user IDs of people you trust for each authentication provider. For instance, you could use the Twitter API to get a list of all the people you follow and drop that into the config.

"trust": {
	"twitter": [
		"916586732845400064",
		"902094599329591296"
	],
	"github": [
		1639, 2931, 2946, 3602, 4933
	]
}

Run in Docker

You can build a Docker image for the schnack server running:

docker build -t gka/schnack .

The image will contain everything in the project folder and can be started with:

docker run -p 3000:3000 -d gka/schnack

In order to be able to edit your config file and your SQL database files, you may want to share the project folder with the docker container:

docker run -p 3000:3000 -v $(pwd):/usr/src/app -d gka/schnack

Import comments from disqus

You can import comments from your disqus XML export as following:

npm run import -- disqus.xml

Who is behind Schnack?

Schnack is yet another happy collaboration between Webkid and Gregor Aisch.

Who is using Schnack?

Schnack would never track who is using the software, so we don't know! If you are a Schnack user, let us know and we'll add your website here. So far Schnack is being used on:

schnack's People

Contributors

gka avatar g-div avatar moklick avatar kannes avatar michamilz avatar

Watchers

James Drew 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.