cognicity-grasp is an extension to the CogniCity platform that adds support to collect disaster reports from residents using web-technologies. Users request a report card which is delivered in the form of a unique one time link pointing to a [cognicity-server]() instance. The report card link is delivered by a simple conversational 'bot'. The bot can be included in [cognicity-reports]() so that report cards can be delivered to users via social messaging or third-party application.
Bot.js
- GRASP module for user communicationReportCard.js
- GRASP module to create unique card linkApp.js
- Reference implementation
sample-grasp-config.js
- Sample config for reference implementationpublic/
- Folder containing web elements for card designBot.js
scans User input for keyword "report"Bot.js
requests a report card from ReportCard.js
ReportCard.js
creates unique card link, writes this to CogniCity database, and passess to Bot.js
Bot.js
replies to User with unique card linkReportCard.js
to validate unique card link against database
Bot.js
responds to User thanking them, including unique report link for mapApp.js
is the reference implementation of CogniCity Grasp. It emulates user input from a reports module to generate a report card using Bot.js
and ReportCard.js
, and emulates server response for submission of the card by the user.
Stored in package.json
, use:
npm install
$ node app.js
info: Application starting...
info: Bot requesting issue of card
info: Express listening
info: Issued card B1eYYW-R
Hi User, here is the link to your report card: http://localhost:3000/report/B1eYYW-R
$ curl http://localhost:3000/report/B1eYYW-R
Success - proceed with report
$ curl http://localhost:3000/report/ZZZ
Error - report card id invalid
ReportCard.js
provides simple module for the creation, storage and validation of unique report card links.
Bot.js
provides human-API endpoint to CogniCity Reports via keywords. Current keywords:
Bot.js
requires an instance of ReportCard.js
to issue report cards.
var ReportCard = require('ReportCard');
var Bot = require('Bot');
var report_card = new ReportCard(massive_database_object, winston_logger_object);
var bot = new Bot(config, report_card, winston_logger_object);
bot.parse(user_input, callback(err, response));
See sample-grasp-config.js
TO DO -> Move schema to /db?
npm install --dev
npm test
Report card web elements are in the public/
folder.
In the future, we'll use handlebars templates for multi-language support (see cards/
).