A laravel-based chatbot with botman as it's foundation.
The enduser may ask for Bibleverse(s) (eg. John 3:16) or will somehow execute a searchterm that the bot will try to interpret. Next, it will miraculously provide a suitable (biblical) answer.
The proof of concept uses API endpoints of a dutch NBV translation.
- Webserver;
- PHP 7.1 (as module in the webserver);
- PHP 7.1 (cli)
- Clone this github repo;
- Run
composer install
- Run
cp .env.example .env
- Run
php artisan key:generate
- Facebook messenger user input [question] -->
- Botman InputHandler-->
- Dialogflow -->
- Botman IntentHandler [answer]-->
- Facebook messenger
passes user input to Dialogflow,
- botman: public/biblebot/routes/botman.php
Analyses user input and gives an intent back.
instantiates the appropriate IntentHandler.
- Inputhandler: public/biblebot/app/InputHandler.php
Get an answer form an external API.
- Intenthandlers: public/biblebot/app/IntentHandlers/*
- https://bijbel.eo.nl/api
- https://onesignal.com/api (public/biblebot/app/ApiHandler.php)
On Amazon, some CentOS host: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Tutorials.WebServerDB.CreateWebServer.html Configure port forwarding on port 22/80/443.
Search latest version of PHP
yum search php7
Install latest version
yum install php71
Search modssl
yum search all mod_ssl
Install modssl
yum install mod24_ssl
Obtain a free Let's Encrypt SSL certificate from https://www.sslforfree.com/ and place certificates in /etc/ssl/certs/
Configure /etc/httpd/conf.d/ssl.conf (Highlighted certificates are obtained from Let's Encrypt)
<VirtualHost _default_:443> ... ServerName hacknl.arrishuijgen.nl:443 ... SSLCertificateFile /etc/ssl/certs/certificate.crt ... SSLCertificateKeyFile /etc/ssl/certs/private.key ... SSLCACertificateFile /etc/ssl/certs/ca_bundle_letsencrypt.crt
Install composer
curl -sS https://getcomposer.org/installer | php chmod +x composer.phar mv composer.phar /usr/bin/composer composer -V
PHP mb_string
yum install php71-mbstring
Fix permissions
chown -R apache:apache /var/www/html/storage/botman