|
|
|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
|
|
This project implements the *Hello World* of API-driven apps: a simple TODO app, built with Vue 3.
|
|
|
|
|
|
|
|
|
|
The `bbconf` folder contains basebox config files, database schema, type maps etc. and scripts to run broker and dbproxy from within the `bbconf` directory.
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
@@ -13,7 +13,7 @@ Let's assume you create a `basebox` folder in your home directory, change into i
|
|
|
|
|
cd ~
|
|
|
|
|
mkdir basebox
|
|
|
|
|
cd basebox
|
|
|
|
|
tar xf basebox-version-arch.tgz # adopt this command to the basebox distribution archive you downloaded
|
|
|
|
|
tar xzf basebox-version-arch.tgz # adopt this command to the basebox distribution archive you downloaded
|
|
|
|
|
git clone --single-branch --depth 1 https://gitea.basebox.health/samples/vue-todo.git
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
@@ -30,19 +30,13 @@ To install this app, you need
|
|
|
|
|
|
|
|
|
|
### PostgreSQL Preparation
|
|
|
|
|
|
|
|
|
|
> The following guide assumes you are installing under Debian or Ubuntu Linux; if you are on a Mac, please see our [PostgreSQL Primer](https://docs.basebox.io/getting-started/postgresql/) for some hints.
|
|
|
|
|
> You need a PostgreSQL database to run this app. You can read detailed instructions on how to
|
|
|
|
|
> install PostgreSQL and create a test database at our [PostgreSQL Primer](https://docs.basebox.io/getting-started/postgresql/) page.
|
|
|
|
|
|
|
|
|
|
You need to create a user and a database for the todo app.
|
|
|
|
|
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).
|
|
|
|
|
|
|
|
|
|
> Please note:
|
|
|
|
|
>
|
|
|
|
|
> The recommended way to run basebox is to have a dedicated Unix user for dbproxy that
|
|
|
|
|
> authenticates to PostgreSQL using Peer authentication. This way, no password for the
|
|
|
|
|
> DB user has to be stored anywhere. The Unix user's name must match the name of the
|
|
|
|
|
> PostgreSQL user. For more info, see the basebox installation instructions and
|
|
|
|
|
> [PostgreSQL documentation](https://www.postgresql.org/docs/current/auth-peer.html).
|
|
|
|
|
|
|
|
|
|
For simplicity's sake, we are using a normal PostgreSQL user that authenticates using md5 authentication, thus requires a password, which is set in the dbproxy configuration file.
|
|
|
|
|
Let's create a PostgreSQL user and database for the TODO app:
|
|
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
|
# Under (Debian) Linux, switch to the postgres user first:
|
|
|
|
@@ -76,3 +70,11 @@ psql -U bb_todo bb_todo < bbconf/todo_datamodel.sql # Enter password when promp
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The database configuration and installation is now complete.
|
|
|
|
|
|
|
|
|
|
If you're curious, you can recompile the GraphQL schema like so:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
bin/bbconf --prefix=bb_todo -f todo_schema.graphql -o bbconf
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|