This is a simple recipe database and an exercise in Haskell. It's primarily intended to be an ingredient lookup, an index to one or more print or other sources, which you'd turn to for instruction if the procedure weren't obvious or well-known.
- Install Haskell
Stack and run
stack setup
- Clone this repo and enter the directory:
git clone https://github.com/bensteinberg/recipes.hs.git ; cd recipes.hs
stack build
to build the application- Make a data file in
data/recipes.yaml
-- see below. stack test
if you like- Install
npm
and runnpm install
(the front end is now written in Vue and built by webpack) make build
to prepare the application for deployment- After
make run
, the application should be running locally, at http://127.0.0.1:26544/index.html rsync -avz build/ you@yourserver:/some/directory/
(but note that the executable built locally may not be correct for your deployment environment; see below)
You can run the application informally on yourserver
with cd /some/directory ; ./recipes
inside tmux or screen; systemd users
might try adding something like recipes.service to
/etc/systemd/system/
. To expose the service via an existing nginx
setup, try a stanza like
location /recipes/ {
rewrite ^/recipes/$ /index.html break;
proxy_pass http://127.0.0.1:26544/;
include /etc/nginx/proxy_params;
}
To build for another target, try make debian_bookworm
, which should
put the binary recipes.bookworm
in this directory -- see the
Makefile and Dockerfiles for how this works.
The data file, data/recipes.yaml
, should be a series of entries like
this:
- ingredients:
- amount: 0.25 oz
ingredient: dry French vermouth
- amount: 2 oz
ingredient: gin
- amount: garnish
ingredient: lemon peel
name: Dry Martini
source: Ben
The source can be a page number, title and page number, name, URL, or
whatever you like. Each entry can optionally have a list of tags
.
The tests only test that the application is running, really.