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.
- Clone this repo.
- Install dependences:
$ bundle install
- Create database structure:
$ rails db:migrate
- Run web server:
$ rails s
- 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.
To use Google accounts, you'll need to create your own Google API key and store the credentials inside a local file.
-
Make a new
.env
file in the main directory. This file has been ignored by Git, so it will stay local. -
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>
Note: Handy screenshot instructions are in the "Create Google App" section of https://medium.com/@amoschoo/google-oauth-for-ruby-on-rails-129ce7196f35.
-
Navigate to https://console.developers.google.com/ and log in with a Google account.
-
Select '+' to create a new Google project. The project name can be anything you choose.
-
Select 'Credentials' and 'Oauth consent screen'. Input your own contact information. The app doesn't require terms or other URLs.
-
Create Oauth client ID and input the following URL in the 'Authorized redirect URIs' field: http://localhost:3000/auth/google_oauth2/callback
-
Add the resulting client id and secret to your
.env
file.
To interact with many users, ingredients, and recipes, add the seed data and CSV files below.
- Run the seed file to create default users and starter ingredients:
$ rails db:seed
-
Add larger ingredient list by importing included CSV file:
- Log in as the admin user, David Baker (with password
testing123
). - Navigate to
/ingredients
and upload theingredients.csv
file fromapp/assets
. - Look at all that new ingredient data!
- Log in as the admin user, David Baker (with password
-
Add more recipes to each user by uploading their individual CSV files:
- Log in as any default user from
/db/seeds.rb
, such as Paul Hollywood, Mary Berry, and Peter Reinhart (all with passwordstesting123
). - Navigate to
/recipes
and notice the recipes don't have ingredients or costs. Upload the CSV matching the user's name fromapp/assets
. - Each recipe now has costs and ingredient amounts!
- Log in as any default user from
In addition to the web interface, you can interact with the app via command line by using rails c
.
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.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in this project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.