Giter VIP home page Giter VIP logo

brew-tracker's Introduction

Brew Tracker

I've been using a word document to track my recipes and brews and it's becoming overwhelming. I need the ability to track recipes and the brews I make with them.

How to Run

npm start;

How to Run Development

docker-compose up -d;

# wait for the database and mongo-express to come up

npm run dev;

Docker Compose will create a MongoDB database instance and spin up a Mongo Express instance to provide easy access to the data. Then run the NodeJS server configured to point to the MongoDB database.

Integration Tests

Integration tests are written using Cypress. They are able to be run using Docker Compose or interactively for development.

For information on running interactively, go to the Integration Tests Readme.

Docker Compose

docker compose -f dc-e2e.yml up

Upgrades

brew-tracker's People

Contributors

beeronbeard avatar

Watchers

James Cloos avatar  avatar

brew-tracker's Issues

Combine notes to a single form with ability to specify type.

This will be a breaking change. A conversion tool must be provided to change the form of the data. The tool must not change the data in place, but create a new database with the transformed data.

On the brew page, show the user one form at the top that replaces the three forms for "Brew Note", "Fermentation Note", and "Tasting Note". The single form should contain the following:

Text field: Note type
Textarea: Note contents

Each note must continue to have a timestamp.

Data structure:

{ time: 'ISO-8601 date', type: 'brew', text: 'Contents of the note' }

The list of notes at the bottom of the brew page will also need to be updated. Use the type to create sections for each unique type and list all notes of that type in descending chronological order. For example, given three notes as follows:

[
  { time: '2020-02-02T12:00:00z', type: 'Brew', text: 'brew 1' },
  { time: '2020-02-02T13:00:00z', type: 'Observation', text: 'observation' },
  { time: '2020-02-02T14:00:00z', type: 'Brew', text: 'brew 2' }
]

The following should be rendered:

Brew
2020-02-02 @ 12:00:00
brew1

2020-02-02 @ 14:00:00
brew 2

Observation
2020-02-02 @ 13:00:00

Add Fields to Track Original and Final Brix in a Brew and Calculate ABV

I use a refractometer to measure how much sugar is in my wort before and after fermentation to understand how much alcohol is in the beer. After some reading, it seems that measuring using the Brix scale on my device will be the most accurate. Using the original and final brix reading, ABV can be calculated. However, the alcohol present in the final brix reading skews the refractometer's reading. Using the following algorithms, ABV can be calculated taking into account the correction for the refractometer.

Calculating ABV

Terms

  • OB: Original Brix reading before fermentation
  • FB: Final Brix reading after fermentation
  • FG: Final Gravity
  • ABW: Alcohol by Weight
  • ABV: Alcohol by Volume

Algorithm

const OB = 12;
const FB = 6;
const FG = 1 + (-0.002349 * OB) + (0.006276 * FB);
const ABW = (0.67062 * OB) - (0.66091 * FB);
const ABV = (FG * ABW) / 0.791;

References

Disconnect Recipes and Brews

As a user
I want to brew the same recipe multiple times
So I can track how different brew days produce different results on the same recipe

This will be a breaking change. A tool must be provided to migrate brews in a v1 database to the new structure. The tool must not modify the original database.

  • The index page must be updated to show a list of recipes
  • The recipe page must have an action to start a new brew day
  • The recipe page must list the brews that have been started using that recipe
  • The brew page must display the recipe so it's easy to work through a brew day without leaving that page
  • The brew page must allow a user to add a note
  • The brew page must display the notes on that brew

Add Optimistic Concurrency to Mongo Documents

If a user or users have the same recipe of brew open at the same time, make different changes, and both commit, the document will be updated with the second user's changes losing the changes from the first user. Adding a field to each document that contains a revision identifier and checking that the document in the database is the same revision before committing the changes will prevent overwrites.

Definition of Done

  • Each recipe and brew document must contain a new field named _version that contains a integer that is incremented when a change is made to the document
  • When saving a document, a new check must be in place that verifies the _version in the document being changed is the same as the revision in the database
  • If the _version is not the same, the server must respond with a 400 http status code with the text "DOCUMENT_OUT_OF_DATE" and include the latest version of the document from the database
  • If the client receives a status of 400 with status text "DOCUMENT_OUT_OF_DATE", the client should use the object returned with the 400, make the changes requested by the user, and re-submit the PUT request

Add Ability to Update Recipe

As a user
I want to be able to update a recipe
So that when I'm shopping for ingredients and find they are not available, I'm able to change the recipe on the fly

The recipe is available in two places: the recipe itself, and the copy of the recipe inside a brew when a new brew day is started. The system should allow editing the recipe in both places.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.