Akwaba
A lightweight commenting platform using Notion as a backend
Demo page embedding Akwaba - Demo Notion database
Summary
Akwaba is a self hosted solution that you can embed in your website, and have your visitors add comments.
It uses Notion databases to store and retrieve all the data, via Notion API. No need to configure and manage a Relational Database.
Akwaba acts like a bridge between your website, and your Notion database by essentially doing 2 things:
- Taking comments submitted by visitors on your website, and storing them in your Notion database
- Taking comments from your Notion database, and displaying them on your website for your visitors
From Notion, you can approve/disable a comment. You can take advantage of Notion's powerful databases, and filter comments by page URL, author's name and email.
Make sure to play with the demo page and see the results in the demo notion database.
Getting started
For using Akwaba, you first need to complete a few steps in Notion:
- Create an internal integration, and save your API token somewhere
- Duplicate this database in your Workspace, and save the ID of your new database somewhere
- Share your new database with your integration
Installation
The installation can be done in 3 steps:
- Hosting an instance of Akwaba
- Configuring the instance
- Embedding on your website
Hosting an instance of Akwaba
Akwaba is a web application, built with Ruby and Sinatra. You can host an instance of Akwaba, on Heroku or any platform supporting rack based web applications.
Akwaba does not use a Database, or any third party addons to run. It's just the small web app.
Configuring the instance
For Akwaba, to work properly, you need to set some environment variables:
- NOTION_TOKEN (required): Your notion integration API token
- HOST (required): The url of your Akwaba instance. If you've deployed it to Heroku, it will look like
https://yourappname.herokuapp.com
- CLIENT_HOST (required): The url of the website, where you want to integrate Akwaba. Eg: https://myawesomeblog.com
- MODERATION_ON (optional): Set this variable to any value, if you want comments moderation. Remove it, to disable comments moderation.
Embedding on your website
After hosting and configuring your Akwaba instance, you can now embed it in your website, so your visitors can add and see comments.
If your Akwaba instance is available at akwaba.example.com
and your notion database ID is 123456789
, embed the following snipet, in your web pages where you want to show comments.
<div id="akwaba"></div>
<script defer src="https://akwaba.example.com/akawaba.js" data-database-id="123456789"></script>
Akwaba
expects to find an element with the ID akwaba
, to load comments. You can specify another element, to contain the comments, by using the data-container
attribute.
<div id="my-comments"></div>
<script defer src="https://akwaba.example.com/akawaba.js" data-database-id="123456789" data-container="#my-comments"></script>
Usage
Comments moderation
If you enable comments moderation on your website, you can enable/disable a comment from your Notion database.
- Use notion filters to find the comments, in your database
- Tick/Untick the checkbox in the column
is_approved
, to enable or disable a comment - When reloading your web page, approved comments will show up