From 66bb390568f6aed2b75888d4ec54685cefb9cad7 Mon Sep 17 00:00:00 2001 From: Markus Thielen Date: Wed, 5 Apr 2023 11:52:29 +0200 Subject: [PATCH] README and bbconf updates --- README.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++- bbconf/broker.sh | 2 +- bbconf/compile.sh | 2 +- bbconf/dbproxy.sh | 2 +- 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 855fab3..3e830a2 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,16 @@ Let's assume you create a `basebox` folder in your home directory, change into i cd ~ mkdir basebox cd basebox -tar xzf basebox-version-arch.tgz # adopt this command to the basebox distribution archive you downloaded +tar xzf basebox-version.tgz # adopt this command to the archive you downloaded git clone --single-branch --depth 1 https://gitea.basebox.health/samples/vue-todo.git ``` +The basebox archive will be extracted into a directory named `basebox-`; for the scripts in `vue-todo/bbconf` to find the basebox binaries, please create a symbolic link to the basebox directory named `basebox`, e.g. + +``` sh +ln -s basebox-0.1.1-beta.1 basebox +``` + If you follow these steps, the scripts in `bbconf` will work out of the box. ## Installation @@ -45,6 +51,8 @@ createuser -DRP bb_todo # default password: basebox createdb -O bb_todo bb_todo ``` +If you use a different password than `basebox`, you also have to change `bbconf/dbproxy-config.toml` accordingly. + Tell PostgreSQL that the `bb_todo` user connects to the database using md5 authentication. To do so, edit `/etc/postgresql//main/pg_hba.conf` (on Debian based Linux systems) to contain the following: ```conf @@ -77,4 +85,58 @@ If you're curious, you can recompile the GraphQL schema like so: bin/bbconf --prefix=bb_todo -f todo_schema.graphql -o bbconf ``` +### Client Installation +After installing [node.js](https://nodejs.org/en/download) and [npm](https://www.npmjs.com/package/npm), open a terminal window, go to the root of the vue-todo repository and enter the following commands: + +``` sh +cd vue-todo +npm i +``` + +This will install the client app's dependencies. + +### OpenID Connect + +You can setup and or use your own OpenID Connect server; if you do so, you also have to update the config files `bbconf/broker-config.toml` and `bbconf/dbroxy-config.toml` accordingly. + +If you just want to try things out, you are welcome to use our development Keycloak server. The config files are already setup to use it. There is a test user named `tester`, the password is `rantanplan`. + +We have an extra page in our documentation dedicated to [Authorization](https://docs.basebox.io/guide/authorization/). + +## Run + +### Start dbproxy + +Open a new terminal window, then: + +``` sh +cd ~/basebox/vue-todo/bbconf +./dbproxy.sh +``` + +This command starts dbproxy; you will see a lot of log messages being written to the console. + +### Start broker + +Open another terminal window, then: + +``` sh +cd ~/basebox/vue-todo/bbconf +./broker.sh +``` + +Again, you see broker's log messages on the console. Each request to the broker will be shown, similar to an Apache or nginx access log. + +### Start the Client + +In another terminal window: + +``` sh +cd ~/basebox/vue-todo +npm run dev +``` + +This will start a node.js based HTTP test server that will host the client application. It will print the URL where you can load it to the console. + +Open your browser, go go the URL in the npm console, and enjoy. diff --git a/bbconf/broker.sh b/bbconf/broker.sh index 7c32642..be0b5b2 100755 --- a/bbconf/broker.sh +++ b/bbconf/broker.sh @@ -1,3 +1,3 @@ #!/bin/sh # Run basebox broker from the samples/toodo/bbconf directory -../../bin/broker -c broker-config.toml +../../basebox/bin/broker -c broker-config.toml diff --git a/bbconf/compile.sh b/bbconf/compile.sh index bbb9842..d948faa 100755 --- a/bbconf/compile.sh +++ b/bbconf/compile.sh @@ -2,4 +2,4 @@ # # Compile the todo schema. # -../../bin/bbc --prefix=bb_todo -f todo_schema.graphql +../../baseboxbin/bbc --prefix=bb_todo -f todo_schema.graphql diff --git a/bbconf/dbproxy.sh b/bbconf/dbproxy.sh index 95a4dd3..9bd79aa 100755 --- a/bbconf/dbproxy.sh +++ b/bbconf/dbproxy.sh @@ -1,3 +1,3 @@ #!/bin/sh # Run basebox dbproxy from the samples/toodo/bbconf directory -../../bin/dbproxy -c dbproxy-config.toml +../../basebox/bin/dbproxy -c dbproxy-config.toml