Skip to content

Mirror of BGCat, A board game catalog

License

Notifications You must be signed in to change notification settings

imstevenxyz/bgcat

Repository files navigation

This is a mirror! Go to the official repository on Gitlab

BGCat Logo

BGCat

BGCat, short for Boardgame Catalog, is a web app for displaying your magnificent boardgame collection to your friends. With the search and filter features you and your friends can effortlessly find the game to play!

Get StartedDemoAPI Docs

BGCat Homepage

1. Installation

Manual

  1. Install SurrealDB

  2. Install BGCat

    1. Download the latest release and unpack in a directory of your choosing

    2. Configure BGCat, see below

  3. Run the bgcat binary, eg: ./bgcat

Container

Supported architectures:

  • linux/amd64

  • linux/arm64

docker run --detach --restart=always \
    -e BGCAT_ADMIN_TOKEN="a_good_password" \
    -e BGCAT_SECRET="super_secret_cookie_that_should_be_really_long" \
    -p 8000:8000 \
    -v </your/local/data>:/app/data \
    registry.gitlab.com/imstevenxyz/bgcat:latest

By default the container will run with user uid and gid 65534 (nobody). Running with an arbritrary id is possible using --user {uid}:{gid}. Make sure this matches the ownership of your local data directory.

The images include a local installation of SurrealDB. To use this instance don’t change the db_start_local and db_cmd configuration options!

Helm

TODO

Build manually

  1. Install Rust

  2. Download this repo

  3. Build BGCat for your native architecture:

    cargo build --release
  4. Run the build binary:

    ./target/release/bgcat

2. Configuration

BGCat can be configured using a config file (bgcat.toml) or environment variables. Environment variables should be all uppercase and prefixed with BGCAT_, eg: BGCAT_ADMIN_TOKEN

Possible options:

Option Description Type Default

admin_token

The token for the admin interface

string required

secret

Secret token used for session cookie

string required

adr

Address to listen on

string

0.0.0.0

port

Port to listen on

u16

8000

data_dir

The directory to store the assets and db file if applicable

string

./data

webp_quality

The encoding quality to use when converting uploaded images

f32

0.50

default_page_limit

The default limit of items to show per page

u32

8

ui_page_limit_step

Step interval of the page limit input field

u32

4

db_start_local

Wether to start a local SurrealDB instance

bool

true

db_cmd

SurrealDB command to start local instance

string

surreal

db_adr

The address of the database

string

ws://localhost:8001

db_ns

Database namespace

string

bgcat

db_name

Database name

string

bgcat

db_user

Database authentication username

string

root

db_pass

Database authentication password

string

root

log_level

The log level to show in console

string (error, warn, info, debug)

info

3. Usage

Admin web interface

The interface is available at the /admin endpoint, eg: localhost:8000/admin.

Here you can create, delete and update your boardgames. Uploaded images are converted to webp and stored in the assets folder under your data directory.

Rest API

Swagger interface is available at /api/v1/docs/.
The openapi specification is available at /api/v1/openapi.json

4. Development

Building and running in a container

cargo build --release --target x86_64-unknown-linux-gnu --target-dir ./builds
ln -sr ./builds/x86_64-unknown-linux-gnu ./builds/amd64
buildah build --file container/Containerfile -t bgcat:dev .
podman run --rm --name bgcat -p 8000:8000 -e BGCAT_ADMIN_TOKEN=password -e BGCAT_SECRET=really_long_super_secret_token localhost/bgcat:dev

Other Rust targets

Dynamic binary:
  • x86_64-unknown-linux-gnu

  • aarch64-unknown-linux-gnu

Static binary:
  • x86_64-unknown-linux-musl

  • aarch64-unknown-linux-musl

Get toolchains:
rustup target add <target>
cargo build --target <target>

5. Acknowledgment

Inspirations for theme and colors: