Skip to content

drodil/rustybeer

Repository files navigation

All Contributors

MIT License Contributors Issues PRs

RustyBeer is a CLI tool / web server written in Rust, to calculate values used in the process of brewing beer.

Live server running at https://rustybeer.herokuapp.com/

Installation

If you don't already have the toolset installed, you will first need to install Rust. From the root of the repository, run the following command:

cargo build

Running CLI

You can now run the CLI tool with:

cargo run --bin rustybeer <subcommand>

Running HTTP server

To start the server:

cargo run --bin rustybeer-server

You can access the OpenAPI UI from http://localhost:3000/docs. To change the port number, you can define environment variable PORT.

Testing

Tests can be ran by calling:

cargo test

If you would like to run only one test, you can do this by specifying the test name:

cargo test -- --nocapture <test name>

Files and Folders

  • rustybeer - The folder containing everything for the business logic
    • src - The folder containing the business logic source code
      • calculators - The folder containing calculators to be used in lib or CLI tool
    • Cargo.toml - The file containing build and dependency infomation
  • rustybeer-cli - The folder containing everything for the CLI
    • src - The folder containing the CLI source code
      • commands - The folder containing subcommands for CLI
      • main.rs - The file containing the main function
    • Cargo.toml- The file containing build and dependency infomation
  • rustybeer-server - The folder containing the HTTP server implementation
    • src - The folder containing server source code
    • Cargo.toml - The file containing server build and dependency information
  • Cargo.toml - The file containing build and dependency infomation
  • CONTRIBUTING.md - Contribution guidelines for this repository
  • LICENSE - The file containing the terms that this code package is released under
  • README.md - The file you are currently reading

Acronyms

Beer brewing has a lot of acronyms that have a meaning. This table is to help out with figuring out what everything means:

Acronum Description
ABV Alcohol By Volume
ABW Alcohol By Weight
OG Original Gravity
FG Final Gravity
SG Specific Gravity
IBU International Bittering Units

CLI Functionality

Below is a table of the features currently implemented.

Implemented Function Description Usage
ABV Calculates ABV from OG and FG or FG from OG and ABV abv --og <Original gravity> (--fg <Final gravity>) (--abv <Alcohol by volume>)
ABV <-> ABW Calculates alcohol by weight (ABW) from alcohol by volume (ABV) abv_abw --percent <alcohol percentage> (--total_volume <total beer volume>) (--total_density <density of beer in g/cm³) (--reverse)
Beer style Finds beer styles matching given parameters beer_style (--og <Original gravity>) (--fg <Final gravity>) (--abv <Alcohol by volume>) (--ibu <International bittering units> (--color <SRM color>)
Boil-off Gravity Calculates the volume needed to be boiled down to for a desired SG `boil_off --current_gravity <current_gravity> --wort_volume <wort_volume> <--target_volume <target_volume>
Calories Calculates calories by volume from OG and FG or from ABV calories (--og <Original gravity>) (--fg <Final gravity>) (--abv <Alcohol by volume>) (--volume <Beer volume>)
Dilution Calculates the SG after dilution diluting --sg <Current specific gravity> --cv <Current volume> --tv <Target volume>
FG Calculates FG from OG and yeast attenuation fg --og <Original gravity> --att <Yeast attenuation>
Num Of Bottles Calculates the number of bottles required for a given volume num_of_bottles --volume <volume>
Priming Beer Priming Calculator priming --temp <Beer temperature> --amount <Beer volume> --co2_volumes <co2_volumes>
SG Correction Corrects SG reading for differences between measurement and calibration temperatures sg_correction --sg <Specific gravity reading> --ct <Calibration temperature> --mt <Measurement temperature>
Yeast Viability Estimates yeast viability based off production date yeast-viability --pd <Production date> --cc <Cell count> --f <Date format>

This list will expand as ideas and suggestions come in.

Other Tasks to Do

See Issues

Contributors ✨

Thanks goes to these wonderful people (emoji key):


drodil

💻

mlatief

💻

Joseph Russell

💻

flauntingspade4

💻

Ilakkiyan Jeyakumar

💻

Tom Milligan

💻

Roger Y

💻

Sampsa Sarjanoja

💻

Philip Golovin

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Contributing

See CONTRIBUTING.md