BeuthBot
BeuthBot is a master project of the Beuth University of Applied Sciences Berlin. This implementation is the work of media informatic students from semesters SS2017 and WS2017/18.
- Requirements
- Technologies
- Firtst steps
- Project documention
- Application properties
- Docker configuration
- Local tunnel
- Debugging
- Known issues
- Used online sources
Requirements
- Java 8 to build the application
- Docker daemon to start application server
Technologies
- Oracle Java 8
- Gradle Build - build system
- Postgres SQL - relational database
- Adminer - database administration
- WildFly 10
- Docker
Firtst steps
The following five steps clarify what is necessary to set up the BeuthBot for the first time. Most of the steps are also useful during development to ultimately test the changes in the application.
All commands are listed in the following five steps and can be executed from the project path. If this is different than this is indicated accordingly. The commands may differ depending on which operating system is used.
1. Set up integrated development environment
The project should be cloned from the repository. For development it is possible to use IDE Intelij. The cloned project can then be imported into the IDE as Gradle project.
2. Execute project build
With the following command it is possible to build the whole project. The construction of the project is possible during operation and before starting the server. In the first case the running server is automatically updated during operation.
./gradlew war
3. Run application
The application can be started with the following command:
# Unix
./gradlew chatbotRun
# Windows
gradlew.bat chatbotRun
# MacOS
cd docker
docker-compose up --build
4. Test application
After the application has started the following two endpoints of the server are easily accessible via the browser:
- WildFly Server Manager: http://localhost:9990/
- Rasa: http://localhost:5000/parse?q=Hello
It is possible to use a Postman Collection to test the configured endpoints for Telegram and Facebook. The docu/postman/
directory includes a Postman collection containing corresponding endpoints. The JSON file beuth-bot.json
can be imported into Postman. If changes are made to the Postman collection, the service of the JSON file should be increased accordingly.
In addition it is also possible to set up your own bot for example, in Telegram and test it with the local server. For this however a local tunnel must be set up to make the application visible to the outside. For details see the section Local tunnel.
5. Stop application
The following command can be used to stop the running application:
# Unix
./gradlew chatbotStop
# Windows
gradlew.bat chatbotStop
# MacOS
cd docker
docker-compose down
Project documention
In addition to this general documentation, the directory docu/
also contains the project_documentation. This section also discuss the individual modules of the application.
Application properties
Settings for this application can be found in the beuthbot.proterties
file. This is located in the directory docker/wildfly/volumes/conf/
. The file is automatically entered in the Tomcat server during deployment and is used for configuration.
Docker configuration
The Docker configurations can be found in the docker-compose.yml
file. This is stored in the directory docker/
. Furthermore you can find the Dockerfile
file in the folder docker/wildfly/
. The following port mappings are set in the Docker files:
Backend
- Internal port of the container:
8080
- External port from the container:
8080
WildFly server manager
- Internal port of the container:
9990
- External port from the container:
9990
Database
- Internal port of the container:
5432
- External port from the container:
5432
Database administration
- Internal port of the container:
8080
- External port from the container:
8081
Local tunnel
Debugging
At the moment, the Spring Boot server is always started in debug mode. To attach the process using IntelliJ, a remote debug configuration has to be created. To do so, perform the following steps:
- Go to
Run
->Edit Configurations...
- Add a new configuration using the button in the top left corner of the dialog
- Choose
Remote
- Assign a name, ignore the arguments section and enter port
8787
(localhost
) in the settings section - click
OK
and select the new configuration at the top right of the toolbar if it has not been selected automatically - run the configuration using the
Debug
button
Known issues
The following issues are currently known in the application:
Gradlew
- The
./gradlew chatbotRun
command does not work on Mac OS X - The general build command
./gradlew build
causes errors
Wildfly
- During the boot process of the Wildfly server, the error
Mount point not found
occurs