Commit 88b289e566823c04755e678399c009831740eecb
1 parent
b295b481
Add documentation for Adminer
Showing
4 changed files
with
36 additions
and
1 deletions
README.md
... | ... | @@ -10,7 +10,7 @@ BeuthBot is a master project of the Beuth University of Applied Sciences Berlin. |
10 | 10 | - [Docker configuration](#docker-configuration) |
11 | 11 | - [Local tunnel](#local-tunnel) |
12 | 12 | - [Debug application](#debugging) |
13 | -- [Deploy application](#aeploy-application) | |
13 | +- [Deploy application](#deploy-application) | |
14 | 14 | - [Known issues](#known-issues) |
15 | 15 | - [Used online sources](#used-online-sources) |
16 | 16 | |
... | ... | @@ -116,6 +116,7 @@ General |
116 | 116 | |
117 | 117 | - [infrastructure](docu/infrastructure.md) - The individual modules of the application |
118 | 118 | - [persistence](docu/persistence.md) - DAOs, Entities, Hibernate, PostgreSQL |
119 | +- [adminer](docu/adminer.md) - Database management web app | |
119 | 120 | |
120 | 121 | Individual modules |
121 | 122 | ... | ... |
docu/adminer.md
0 → 100644
1 | +# Adminer - database management web app | |
2 | + | |
3 | +[Adminer](https://www.adminer.org/en/) can be used to connect to a database server and select, update or delete data, show table structures, indexes, forgeign keys or triggers and much more. It is similar to `phpMyAdmin` in its intent and usage. | |
4 | + | |
5 | +In this project it is running in a separate docker container that is not mandatory to run but brings advantages when debugging the chat bot application. | |
6 | + | |
7 | +## Setup | |
8 | + | |
9 | +To start Adminer along with the project the [docker-compose.yml](../docker/docker-compose.yml) file has to contain the following: | |
10 | + | |
11 | +``` | |
12 | +adminer: | |
13 | + container_name: adminer_dbmanagement | |
14 | + image: adminer | |
15 | + ports: | |
16 | + - "8081:8080" | |
17 | +``` | |
18 | + | |
19 | +If the database server's ports are opened using the `expose` keyword instead of `ports`, the Adminer container needs an additional `link` to the database server container. | |
20 | +The Adminer container can be left out completely when deploying to the production server. | |
21 | + | |
22 | +When the Adminer container is started along with the project, it should be hosted on `http://localhost:8081`. Entering this in a web browser opens the web interface asking for credentials. To connect to the PostgreSQL database choose `PostgreSQL` as database type. Database name, username and password are found in the [docker-compose.yml](../docker/docker-compose.yml) file where they are defined as `POSTGRES_DB`, `POSTGRES_USER` and `POSTGRES_PASSWORD`. The database server is the PostgreSQL database docker container which can be referenced using the container name and its port. | |
23 | + | |
24 | +See the following screenshot as an example: | |
25 | + | |
26 | +![Adminer successful login](img/persistence/adminer-login.png) | |
27 | + | |
28 | +## Usage | |
29 | + | |
30 | +Once logged in, the database schema can be seen. It should not be modified though, because it is generated by Hibernate and changes will be lost on the shutdown of the container. Clicking on a table name and selecting `select data` shows the currently persisted entities. | |
31 | + | |
32 | +Please note that when debugging and going step by step through the application code, changes made to the entities might not be visible in Adminer directly. The reason for this is that Hibernate starts to send changes to the database when a session is commited which is not necessarily the case when an entity is updated. | |
33 | + | |
34 | +![Adminer overview](img/persistence/adminer-overview.png) | |
0 | 35 | \ No newline at end of file | ... | ... |
docu/img/persistence/adminer-login.png
0 → 100644
12.9 KB
docu/img/persistence/adminer-overview.png
0 → 100644
122 KB