Sample TODO app, based on Vue3 https://basebox.io
Go to file
2023-03-24 19:22:59 +01:00
bbconf Renamed some filed to bbc style 2023-03-24 19:22:59 +01:00
public WIP; Vue3 project tree 2023-02-28 13:57:31 +01:00
src list editing, deleting 2023-03-17 18:41:43 +01:00
.gitignore WIP; Vue3 project tree 2023-02-28 13:57:31 +01:00
index.html WIP... 2023-03-15 17:57:12 +01:00
package-lock.json fixed request syntax 2023-03-16 07:44:05 +01:00
package.json WIP... 2023-03-15 17:57:12 +01:00
README.md README, bbconf updates 2023-03-24 13:35:35 +01:00
vite.config.js WIP; Vue3 project tree 2023-02-28 13:57:31 +01:00

basebox Sample: TODO App

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.

VSCode + Volar (and disable Vetur)

Installation

To install this app, you need

  • npm, node.js
  • A PostgreSQL server, preferably on the local host (simpler)
  • basebox components (broker, dbproxy, bbc)
  • Keycloak

PostgreSQL Preparation

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 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.

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.

´´´sh

Under (Debian) Linux, switch to the postgres user first:

sudo su postgres

createuser -DRP bb_todo # default password: basebox createdb -O bb_todo bb_todo


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:

```conf
# TYPE  DATABASE        USER            ADDRESS                 METHOD
local   bb_todo         bb_todo                                 md5

Reload PostgreSQL config:

systemctl postgresql reload

If PostgreSQL is older than version 13, you need to enable the crypto extension explicitly:

# Under (Debian) Linux, switch to the postgres user first:
# sudo su postgres
psql bb_todo

# At the # bb_todo prompt:
SELECT gen_random_uuid();
# If this prints a UUID, you're ok. If you get an error, do this:
CREATE EXTENSION pgcrypto;
# Might try the SELECT call again.

Database Schema

This repository contains an already compiled SQL file that creates the database schema:

psql -U bb_todo bb_todo < bbconf/todo_datamodel.sql