/WFS-Backend

An incomplete replacement backend for "What's for Supper"

Primary LanguageClojure

What’s for Supper

https://github.com/Briaoeuidhtns/WFS-Backend/workflows/Clojure%20CI/badge.svg

Intro

This is a work in progress backend for my senior design project, What’s for Supper.

While the project was originally a team effort, this is a currently solo continuation for a fork.

Motivation

While I probably could have continued to use CouchDB, some features seemed easier to implement in a more general purpose server framework.

Goals

  • Shared sessions
  • Recipe sharing
  • Dynamic recipe sets, ie. local restaurants

Setup

Docker

The tests use github packages to store docker images, and even though they’re public, you must be authenticated as per these instructions. More info here.

Keys

To generate a fresh keypair for auth tokens, run clj -Akeygen. The generated key is available in edn encoded jwk format in resources/jwk.edn.

Postgres

The model is made using pgModeler. For a production database it just needs to be exported.

To build a new Docker image for ci, first run pgmodeler-cli -if model.dbm -of target/model.sql -ef. This requires a graphical environment so can’t be run in ci, but is otherwise not interactive.

Running tests

After the docker registry has been set up, tests can be run with clj -Atest

Running the server

The server can be run with clj -Arun. This starts it in dev mode with extra traces and GraphiQL support.

Otherwise can be started via repl with (user/start!).

Packaging

The server can be packaged by running clj -Auberjar.