Skip to content

Bilbottom/billiam-database

Repository files navigation

Python Poetry Docker tests GitHub last commit

code style: prettier pre-commit.ci status DuckDB Metabase


Billiam's Database 🧙‍♂️

OLAP database project for life admin (feat. dbt).

About

As part of my life admin, I keep track of:

  • Every transaction I make at an item level (since 2018-01-18)
  • On the job, what I'm working on every 15 minutes (since 2019-04-23)

Note that the job tracker is my daily-tracker project.

Documentation is hosted at:

Setup

Since this is a personal project, I don't expect anyone else to do this, but I'm still documenting it for myself (I have a very, very bad memory).

Pre-requisites

This project requires the following three tools to be installed:

The required versions are specified in the badges at the top of this README, and also in:

Installation (dbt)

After cloning the repo, install the dependencies and enable pre-commit:

poetry install --sync --with dev
pre-commit install --install-hooks

One of the dependencies is dbt-core. In this project, running dbt requires an .env file to be created and configured; see the dbt-commands.sh file for the required environment variables and common dbt commands.

Installation (Metabase)

Metabase is a tool for visualising data.

In this project, Metabase is run in a Docker container; run the following command:

# start
docker-compose --file docker-compose.yaml --project-name billiam-database up --detach

# stop
docker-compose --file docker-compose.yaml --project-name billiam-database down --remove-orphans

This will make Metabase available at:

Warning

There are two important notes about the current Metabase configuration:

  • Since DuckDB only supports one connection at a time, you can't use Metabase and dbt at the same time.
  • The Metabase data is stored locally in the dockerfiles/metaduck-data directory so that it persists between container restarts.