Giter Site home page Giter Site logo

dboehmer / coocook Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 2.0 4.06 MB

👨‍🍳🦉 Web application for collecting recipes and making food plans

Home Page: https://coocook.org/

License: Other

Perl 42.67% CSS 18.20% HTML 8.77% JavaScript 30.10% Dockerfile 0.06% Shell 0.20%
perl catalyst dbix-class food web-application hosted self-hosted markdown template-toolkit recipes cooking kitchen

coocook's Introduction

Coocook

build status dishes served license

Web application for collecting recipes and making food plans

Main features

  • collect recipes
  • create food plans
    • simply import dishes from your recipes
  • gather purchase lists
    • convert units to summarize list items
  • print views for whole project and each day
    • including ingredients, cooking instructions
  • special features
    • define maximum shelf life or limit for need to preorder of articles
    • select some ingredients and part of cooking instructions to be done at an earlier meals

Quick start

Get source code:

$ git clone https://github.com/dboehmer/coocook.git
$ cd coocook/

Configure database

Copy the config template share/examples/dbic.yaml to the working directory:

$ cp share/examples/dbic.yaml dbic.yaml

A database from the YAML file other than development or a literal DSN can be configured in coocook_local.yaml. For other possible settings see the default values defined in lib/Coocook.pm.

Run with native Perl (works best on Unix-like Operating Systems)

Prerequisites:

With Ubuntu or Debian Linux:

$ sudo apt-get install cpanminus sqlite3

To install Perl distributions that include C code you’ll probably need a C toolchain and some libraries:

$ sudo apt-get install build-essential
$ sudo apt-get install libssl-dev zlib1g-dev             # for Net::SSLeay
$ sudo apt-get install libexpat1-dev                     # for XML::Parser
$ sudo apt-get install libncurses-dev libreadline-dev    # for Term::ReadLine::Gnu for development mode
$ sudo apt-get install libsqlite3-dev                    # for DBD::SQLite
$ sudo apt-get install libpq-dev                         # for DBD::Pg

Install Perl5 dependencies required for running the application:

$ cpanm --installdeps .

There are a few additional dependencies for development as well recommended and suggested dependencies. To install these as well run:

$ cpanm --installdeps --with-develop --with-recommends --with-suggests .

Install database schema into configured database (see above) and start development server in debug mode:

$ script/coocook_deploy.pl install
$ script/coocook_server.pl --debug
...
HTTP::Server::PSGI: Accepting connections at http://0:3000/

Hint: With the --restart option the development server restarts automatically when files in lib/ are changed. This requires Catalyst::Restarter.

Run with Docker

Follow the instructions at hub.docker.com/r/coocook/coocook-dev to use the Docker image for development.

Mailing list

Terminology

Name Description Example
Project self-contained collection of Coocook data Paris vacation
Meal an occasion for food on a particular date lunch at August 15th
Dish an actual food planned for a certain meal apple pie for lunch on August 15th
Recipe a scalable template for a dish apple pie
Ingredient an amount of some article for a dish/recipe 1kg of apples
Article a single sort of food that can be purchased apples
Unit a type of measurement kilograms
Quantity a collection of physical units that can be converted masses

Author

Daniel Böhmer [email protected]

Contributors

Copyright and License

This software is copyright (c) 2015-2022 by Daniel Böhmer. This web application is free software, licensed under the GNU Affero General Public License, Version 3, 19 November 2007.

coocook's People

Contributors

christinasi avatar dboehmer avatar kuro610 avatar moseschmiedel avatar rico-hengst avatar tjfoerster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

rol1 cncpl

coocook's Issues

Make Travis CI work

I have a new account at travis-ci.org but Coocook fails to build due to travis.yaml (?) missing.

Gray background of prepared ingredients in print view of day is not printed

Browsers ignore background images and colors while printing.

How to print the print view without the green background of the program but with any type of markup of the prepared ingredients?

Other ideas:

  • add a key below the table
  • use some kind of markup that's visible on most basic black & white printers

Add button to delete project

In the project overview there should be a possibility to delete projects, perhaps with a warning and a second confirmation.

Changing dish ingredients doesn't affect purchase list item's value

Steps to reproduce:

  1. create dish with ingredient
  2. add ingredient to purchase list
  3. change value of ingredient

Actual result: purchase list item still holds old value

Expected result: purchase list item is updated

Open questions: How to handle purchase list items with value changed by hand, e.g. ceiled number? Maybe save if value was edited by hand and warn if?

Update README.md for Github

  • description
  • remove Catalyst template
  • mailing list
  • (link to public instance)
  • (((public demo which is wiped hourly for access without registration)))

Fix warning in Controller::Recipe

"my" variable $input_okay masks earlier declaration in same statement at /home/daniel/workspace/coocook/script/../lib/Coocook/Controller/Recipe.pm line 73, line 1.

You just have to look for multiple my $input_okay statements. Can you fix that?

Validate number input fields

Even without I18n we should validate number input fields and reject inputs with wrong format or cast them into numbers.

Currently causes exception on the units page when adding a unit with conversion factor containing a comma like 0,001.

Project editor: nested forms with dish deletion and meal update don't work

Firefox correctly claims that nested <form>s don't work. I didn't test other browsers yet.

Problem in the project editor is that the list of meals & dishes is a large table. The are small forms inside the table to edit meals and dishes. Also there is a larger outer form to delete selected dishes.

  • Originally the first form in the table doesn't work because Firefox deems it invalid. All remaining forms work.
  • As a workaround I put <form></form> inside the outer form above the table. Now all inner forms work but the outer one is broken because the <form> is deemed invalid and </form> closes the outer form.

How to fix this? Ideas:

  • work with 1 super form submitting to 1 master controller method and different submit buttons with distinguishable identifiers
  • redesign the whole page which is bloated anyway

Error message or warning when adding articles w/o unit to recipe/dish

Below recipes/dishes there is a form for adding articles. We need to somehow handle articles without name. That could mean:

  • hide these articles
  • disable the select option for these articles
  • prevent form submit if such article is selected
  • display error message instead of performing request

Edit design of error message

In the new surface the error message is displayed in the header. Put it in the content part and change its look.

Adjust original recipe when changing dish

When the dish in the current plan is changed one should be able to adjust the original recipe accordingly.

I imagine two buttons:

  1. update recipe (=remove all recipe ingredients, copy new dish ingredients to recipe, update description etc.)
  2. save as new recipe

Apply FOSS license

Coocook should be free and open source software (FOSS).

  • choose license
  • create LICENSE file
  • tag license on Github
  • add/update (if desired) or remove license comments in source files

Finish and upload changes in database

You made some changes in the database, especially the added columns that reference projects. Please push your changes and merge your extra branch so that I can continue to work.

Offer selection of optional print data

Optional print data:

  • project overview
    • project
    • comments for dishes
    • comments for meals
  • day
    • comments for meals
    • comments for dishes
    • comments for ingredients
  • purchase list
    • related ingredients at all
      • name of dish
      • name/date of meal
      • comments for ingredients
    • comments for items

Non-linear calculation of ingredients

From SOLA Lippe:

Ich habe von unserem Sola-Koch aus der ersten Sola-Woche gehört, dass die nötige Menge an Salz und Gewürzen nicht proportional mit der Menge steigen soll, sondern dass bei größeren Mengen weniger nötig ist. D. h. es liegt nicht mehr ein linearer Zusammenhang vor. Ich kenne leider keine neue Formel.

This is not a must-have for now but should be kept in mind. But I think we can't do that right now. If we ever implement this, we'll just need to change the database and have a migration.

Handle purchase list item when deleting meal, dish or dish ingredient

Should the delete action be prohibited or what should be done with the purchase list item?

Caution: Not yet implemented but planned is that the purchase list item can have an offset, e.g. to get a rounded value. Example: 400g + 0.5kg = 0.9kg. An offset of +0.1kg is used to get exactly 1kg. Now if 400g is deleted 0.5kg+0.1kg remains …

Add function to import data from other projects

There is one import dialog:
You can choose the project to import data from.
There are several options which part of the project you want to import:

  • units

  • units, recipes, articles -> additionally you can choose if you want to import recipes and articles with their tags

  • units, articles -> additionally you can choose if you want to import articles with their tags

Additionally you can choose if you want to import the following:

  • shop sections

  • tags

You can not import meals.

Avoid projects without name

At the moment you can add projects without a name. Check if there is a name before creating a project. Otherwise stop it and give a hint to the user that he has to insert a name first.

Validate dates before saving to database

Currently the date format YYYY-MM-DD is expected and passed to the database as is.

  • in Controller::Meal->create
  • in Controller::PurchaseList->create

Thanks to DBIx-Class this is not a security risk because any value is still escaped.

Add print button to print views

For everyone unable to find the print dialog in their browser or press Ctrl+P;-)

How to trigger the print dialog from HTML/JS?

Add comment field to recipes

Add plain text field to recipes to add comments concerning experiences and long remarks.
Alternatives:

  • one additional text box like preparation and description

  • comment input box to add comment to a list of comments (like in github)

Think about printing, if you can choose to add these comments.

Add internationalization (I18n)

  • add translation code
  • add texts translated to German
  • localize number and date formats
  • show errors if input fields have invalid format

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.