Wall-Brew-Co / brew-bot

A quick, dirty way to get randomized beer recipes
https://brewbot.wallbrew.com/
MIT License
11 stars 4 forks source link
beer beer-recipes brewing clojure-library clojurescript-library randomized-beer-recipes

brew-bot - The algorithmic beer recipe generator

Clojars Project cljdoc badge GitHub Twitter Follow

We’re making beer. I’m the brewery! Bender Bending Rodriguez from Futurama

A Clojure(Script) library to create randomized beer recipes!

The beta release of our SPA is now available!

This repository follows the guidelines and standards of the Wall Brew Open Source Policy.

Installation

A deployed copy of the most recent version of brew-bot can be found on clojars. To use it, add the following as a dependency in your project.clj file:

Clojars Project

The next time you build your application, Leiningen or deps.edn should pull it automatically. Alternatively, you may clone or fork the repository to work with it directly.

Dependencies

This library heavily relies upon the common-beer-format and returns all recipes and ingredients to match its specification. Therefore, all arguments passed to functions in brew-bot are normalized to these standards as well. Most importantly, it assumes measurements are provided in the International System of Units, also known as the modern metric system. Since many brewing applications, especially those based in America, operate on Imperial Measurements, you may wish to add brewtility to any applications consuming this library to assist with conversions between systems of measure.

Usage

All functions necessary to generate a recipe are provided in the core namespace.

(:require [brew-bot.core :refer :all])

(def fermentables
  (select-fermentables))

(def hops
  (select-hops :random))

(def yeast
  (select-yeasts :random {:count-cutoff 1}))

(def my-random-recipe
  (ingredients->cbf-recipe-template fermentables hops yeast))

Each of the three functions select-fermentables, select-hops, and select-yeasts support multiple arities:

These are the currently supported strategies:

These are the currently supported options:

Additionally, per ingredient type, you may focus the possible ingredient selections. Hops also support two additional options for determining when hops are added and their primary use case.

Fermentables

Hops

Yeasts

Testing

doo, a Leiningen plugin used to run ClojureScript tests in many JS environments, is already in project.clj. Karma is used as the test runner, and is included in package.json.

To install Karma, simply install the Node package:

npm install

Then build the application and run the tests:

lein test-build

The tests will also execute on the JVM, to ensure the library is compatible for both runtime environments.

Contributors

The GitHub profile pictures of all current contributors. Clicking this image will lead you to the GitHub contribution graph.

License

Copyright © Wall Brew Co

This software is provided for free, public use as outlined in the MIT License