Code Monkey home page Code Monkey logo

recipe_costs's Introduction

Recipe Costs

Professional kitchens need to know their recipe costs to profitably price their food. Recipe Costs makes it easy for chefs to figure out the cost-per-serving of their recipes.

App Features

  • Users can log in directly or with their Google account.
  • Authenticated users can create, read, update, and delete their own recipes and ingredients.
  • Recipe costs are calculated per recipe and per serving.
  • Ingredient conversions are automatic. Recipe amounts entered as cups will seamlessly take advantage of costs entered as liters or gallons, for example.
  • App-wide ingredients and default costs provide faster recipe creation, and users can customize ingredient prices for their own recipes.
  • Users can browse their full recipe list or recipes by ingredient.

Basic Installation

  1. Clone this repo.
  2. Install dependences:
$ bundle install
  1. Create database structure:
$ rails db:migrate
  1. Run web server:
$ rails s
  1. Navigate to localhost:3000 in your browser to begin using the app.

Add your own data to get started, or add Google Sign In functionlity and/or bulk users, ingredients, and recipes below.

Google Sign In Installation (Google Oauth)

To use Google accounts, you'll need to create your own Google API key and store the credentials inside a local file.

Create Credentials File

  1. Make a new .env file in the main directory. This file has been ignored by Git, so it will stay local.

  2. Add the following placeholders to your .env file. Once you've created your id and secret, add them to the appropriate variable name below.

GOOGLE_CLIENT_ID=<replace me with ID>
GOOGLE_CLIENT_SECRET=<replace me with secret>

Create Google Credentials

Note: Handy screenshot instructions are in the "Create Google App" section of https://medium.com/@amoschoo/google-oauth-for-ruby-on-rails-129ce7196f35.

  1. Navigate to https://console.developers.google.com/ and log in with a Google account.

  2. Select '+' to create a new Google project. The project name can be anything you choose.

  3. Select 'Credentials' and 'Oauth consent screen'. Input your own contact information. The app doesn't require terms or other URLs.

  4. Create Oauth client ID and input the following URL in the 'Authorized redirect URIs' field: http://localhost:3000/auth/google_oauth2/callback

  5. Add the resulting client id and secret to your .env file.

Add Bulk Users, Ingredients, and Recipes

To interact with many users, ingredients, and recipes, add the seed data and CSV files below.

  1. Run the seed file to create default users and starter ingredients:
    $ rails db:seed
  1. Add larger ingredient list by importing included CSV file:

    1. Log in as the admin user, David Baker (with password testing123).
    2. Navigate to /ingredients and upload the ingredients.csv file from app/assets.
    3. Look at all that new ingredient data!
  2. Add more recipes to each user by uploading their individual CSV files:

    1. Log in as any default user from /db/seeds.rb, such as Paul Hollywood, Mary Berry, and Peter Reinhart (all with passwords testing123).
    2. Navigate to /recipes and notice the recipes don't have ingredients or costs. Upload the CSV matching the user's name from app/assets.
    3. Each recipe now has costs and ingredient amounts!

Development

In addition to the web interface, you can interact with the app via command line by using rails c.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/aparkening/recipe_costs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in this project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

recipe_costs's People

Contributors

aparkening avatar dependabot[bot] avatar

Stargazers

Ismael Trejo Serrano avatar

Watchers

James Cloos avatar  avatar

recipe_costs's Issues

Add Ingredient Search

Current search only matches Recipes table. Widen search to include Ingredients table.

Fix POST links

Gem update broke all previously working POST links for Google login, recipe delete, and ingredient delete. Investigate cause and update needed gems and/or links.

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.