The `bbconf` folder contains basebox config files, GraphQL schema, precompiled database schema, type maps etc. and scripts to run broker and dbproxy from within the `bbconf` directory.
These files assume that you extracted the [basebox distribution](https://basebox.io/download) next to this repository's root.
Example:
Let's assume you create a `basebox` folder in your home directory, change into it, extract the basebox distribution archive in that folder and then clone the contents of this repository into the same folder:
The basebox archive will be extracted into a directory named `basebox-<version>`; 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.
The recommended way to run basebox is to have a dedicated Unix user for basebox that authenticates to PostgreSQL using Peer authentication. This way, no password for the DB user has to be stored anywhere.
However, to keep things simple for the test app, we create a local user that authenticates to the database server via password (md5).
Tell PostgreSQL that the `bb_todo` user connects to the database using md5 authentication. To do so, edit `/etc/postgresql/<PostgreSQL version>/main/pg_hba.conf` (on Debian based Linux systems) to contain the following:
Make sure to add the line that starts with `local bb_todo...` under the commented header that starts with `# TYPE...`. PostgreSQL uses the first line that matches, so having the new line on top makes sure no other line overrides it.
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.
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:
```
VITE v4.1.4 ready in 273 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
```
**Important Note**: If the URL you are seeing uses *localhost*, you have to edit broker's config file accordingly. The value you have to change is `redirect_url`; replace "127.0.0.1" with "localhost".