Skip to content

whatkindofdeveloperareyou is a simple chat bot build on a edited version of Bottr

License

Notifications You must be signed in to change notification settings

sebastiangrebe/whatkindofdeveloperareyou

Repository files navigation

whatkindofdeveloperareyou

travis build codecov coverage Code Climate Greenkeeper badge

whatkindofdeveloperareyou is a simple chat bot build on an edited version of Bottr

I (Sebastian Grebe) created whatkindofdevelopareyou because I wanted to take part in the chat bot Code Competition from IT-Talents.

I made the second place with my chat bot! https://www.it-talents.de/blog/it-talents/sebastian-sichert-sich-platz-2-bei-code-competition

Introduction

whatkindofdeveloperareyou is a survey chat bot based on Bottr. It furthermore uses nedb to store survey results into a simple text file. Every survey participant finishing the survey will receive an image from the bot showing how likely he fits the job as frontend developer or backend developer. This picture is generated by PhantomJS using a static HTML file and the results are parsed through a simple function generating the user specific part of the HTML.

whatkindofdeveloperareyou is directly published as Docker filed using Travis CI. You can have a look at Docker Hub here.

Currently the only supported option to use this bot is using a websocket client so you will need to use the ui which is already inside this repo. Other platforms are not supported currently but could be easily be added through Bottr.

The bot is tested by simple Mocha/Chai test and verifies every bot function by simulating a user who participates in the survey.

The tests are run by Travis CI on every push before publishing the new Docker image. This ensures that only tested and working versions of whatkindofdeveloperareyou are published.

The personal result should look somewhat like this: Personal Result

The global results should look like this: Global Results

Using whatkindofdeveloperareyou

whatkindofdevelopareyou can be used as a general survey bot. Not every function, question type and answer type are programmed but it offers the main functionalities to make surveys which determine a profile of the user between to positions like in the example of the frontend and backend developer.

Feel free to fork this repo, make pull requests and start your own surveys!

The survey is saved in an extra file called fragenbogenprogrammierung.js. This file needs to export the properties skalen, fragebogenprogrammierung, profileActions, welcomeMessage, continueMessage, finishMessage.

Skalen include all scales on which the survey questions can raise results. Fragebogenprogrammierung is a simple array of questions which will be send one after another representing the questionnaire. profileActions is an array of holds the list of supported function to edit the profile. If the parameter prop matches one of the cases in the surveybot class the user is able to use this function inside the survey. The three other props are simple strings which need to be exported an passed into the surveybot.

Writing your own questionnaire

In order to write your questionnaire just edit the fragebogenprogrammierung.js file. Add or edit the questions inside the array like you want.

Every question object can have the following properties currently:

Name Description Required Unique
id The id specifiies under which index the results are saved to the db. This will ensure that already finished surveys are not broken when changing the questionnaire during a running survey. * *
type The type identifies to which type of question this question belongs. Currently only rating and multi are implemented. *
skala The skala specifies which min or max values for rating questions or which text to show for multi questions. For rating questions the shown Text is build together from the exported skalen variable and the skala specified on each question. *
action The action is only needed for questions with the type multi. You can specify the type of action and type of lists to show when showing this question.
frage The fragen field is the actual question you are asking. *

Rating Questions

Rating Questions are questions which have a specific numeric scale.

Multi Questions

Multi Questions are questions which show a list of values and lets you choose from this list. Multi Questions can have two lists linked to choose from. When doing this the lists are actually not shown in order to let the profile which is determined by this question to be accurate.

Getting Started

In order to get started there are just a few things to do since this is a simple nodejs application.

First of all you need node and npm to be installed on your system.

Then you need just to enter these commands:

git clone https://github.com/Sebi55/whatkindofdeveloperareyou.git
cd whatkindofdeveloperareyou
npm install
npm run build
npm start

When you have got problems running npm run build you may need to install gulp globally.

This is all. You should now see the bot running under http://localhost:3000

Using Docker

The Docker image is based on the original nginx image and proxies all requests to port 80 to port 3000 on which the bot is running.

You just need to run these commands:

docker pull sebi55/whatkindofdeveloperareyou
docker run --name whatkindofdeveloperareyou -d -p 80:3000 sebi55/whatkindofdeveloperareyou

Or if you like the short version using docker-compose then just go into the folder and run:

docker-compose up

Everything should be working now. You should be able to just navigate to your container through your browser and see the bot.

License

This project is licensed under the terms of the MIT license. See the LICENSE file.

About

whatkindofdeveloperareyou is a simple chat bot build on a edited version of Bottr

Resources

License

Stars

Watchers

Forks

Packages

No packages published