Giter Site home page Giter Site logo

sbuergers / sustainable-recipe-recommender-website Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 47.26 MB

Flask web-app for recommending sustainable recipes to users.

Python 55.03% CSS 2.90% HTML 42.07%
environmental-impacts food-categories recipes recommending-sustainable-recipes

sustainable-recipe-recommender-website's People

Contributors

dependabot[bot] avatar sbuergers avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

eedama

sustainable-recipe-recommender-website's Issues

Add context to how much 1kg CO2 eq actually is

Is your feature request related to a problem? Please describe.
People might be interested to put the carbon emission scores of recipes into context: E.g. related to their car or home electricity use.

Describe the solution you'd like
We can add some info links for this and refer to this website: https://www.epa.gov/energy/greenhouse-gases-equivalencies-calculator-calculations-and-references, as well as add some summary descriptive statistics to our site - e.g. how much CO2 eq the average car emits per day or the average home emits in utilities.

Security headers in development

When developing (debugging and testing) I use HTTP, not HTTPS, which is used in production.

An enhancement would be to enable HTTPS also in development. mkcert can be used for this presumably.

This is not super urgent right now though, because I created the staging environment on Heroku.

Allow for more advanced search filters

For instance, only search for vegan / vegetarian / pescetarian / paleo ...

It could also be great to allow for selecting certain ingredients, or conversely prohibiting certain ingredients (e.g. due to allergies).

All of these things could be accessed through a "filter" button / link on the home page, or in the navbar next to the search.
Once personal profiles are available, it should be possible to save personal preferences (e.g. allergies / vegan ...). So they do not need to be specified anew everytime.

Incorporate unit tests, integration tests etc.

The codebase needs some tests we can run to assess whether a new add-on (or indeed as it stands now) breaks it's functionality.

Worked on here:
https://github.com/sbuergers/sustainable-recipe-recommender-website/tree/continuous_integration

Tests could be grouped as follows:

  • Database tests (each query gives me what I want? Is it converted correctly and displayed to the user? What happens when the connection fails?)
  • Website functionality tests (use Selenium to simulate users' behaviour. Sign up for account - behaviour as expected? Login, click through etc.) For this it will be useful to simply watch it go through everything and see what happens.

Add footer

A good website needs a footer!

Include my contact info + logo for now.

Limit number of password resets to three per day

If we do not do this, people could theoretically harrass others by sending them endless emails from SSR. I suppose if they can do that they could also spam them in a myriad of other ways, but then at least it does not drag SSR into it.

Low priority though for now.

Use `black` formatting throughout the repo

Using a general code formatting framework makes things easier. ideally we should also add a bot that automatically updated any incoming PRs by running python3 -m black {source_file_or_directory} on it.

Add "forgot password" feature to login page

Required email confirmation to be implemented first.
--> Only confirmed accounts can request password or account reminders (this issue: #26 (comment)).

Is your feature request related to a problem? Please describe.
At the moment, when users forget their password or username, they cannot ask to retrieve it via email.

Describe the solution you'd like
Include a "forgot password" and "forgot username" link to login page. They will be sent their password or username to their email address.

Describe alternatives you've considered
NA

Additional context
NA

Make sure app is secure

Check for vulnerability to the following (see here for more information):

1. SQL injection attacks

  1. Cross site scripting

  2. Cross site request forgery

  3. Man in the middle attacks (check security headers)

Improve free search

Right now the free search only uses LIKE %search_term% and edit distance (aka Levenshtein distance) to sort the search results. The search is implemented in fuzzy_search in sql_queries.py. This should be improved. Postgres has pretty advanced full text search features, which should come in handy.

Disable automatic liking of recipes when bookmarking

Describe the bug
When bookmarking a recipe it is automatically highlighted as liked at the same time on results.html (from compare_recipes route). Interestingly, this does not happen for profile.html and explore.html.

To Reproduce
On results.html click on a bookmark icon of an unbookmarked and unliked recipe.

Expected behavior
Recipe gets highlighted as bookmarked, but not as liked.

Create cookbook

It is possible for users to create an account and login. But there is no functionality that makes this useful.

The Cookbook link should refer users to their personal cookbook, which includes recipes that they liked / added to it. To make this work we need

  • A like button or add to cookbook button next to a recipe.
  • A DB for User's liked recipes (the cookbook)
  • An HTML page to present the cookbook
  • A Flask route for the cookbook

Once the cookbook functionality has been created. The next step would be to integrate collaborative filtering recommendations.

Add licence to repo

Since I cannot revoke a creative commons license, I will for now simply keep the copyright to myself.

Support direct matching to recipe titles in recipe search

This is also described in the about page, which is now incorrect. They are only matched by recipe specific url.

That being said, if you search for the recipe title, the only recipe that is going to be found is the one that contains all the recipe words in the url - so this somewhat works already (though maybe not always). It also does not open the results.html page, but rather explore.html with a single result - the recipe of interest.

Refactor app structure

Following good practice with application factories, consider implementing a structure like suggested here.

Basically, do not lump too many things into app.py and modularize extensions.

I had a brief look at this and ran into problems with copying folders using the git comman line (permissions denied). A brief google offered no quick fix.

This is related to rewriting all psycopg2 queries as flask_sqlalchemy queries. It is still not clear to me though if I should use flask-sqlalchemy or simply sqlalchemy.

After deleting account redirection to main.home fails

Describe the bug
After deleting account redirection to main.home fails. Instead we stay on main.profile.

To Reproduce
Steps to reproduce the behavior:

  1. Go to main.profile whilst logged in with account you are happy to delete
  2. Click on delete account button after typing in your username
  3. See that you are still on the main.profile route, not main.home

Expected behavior
After account deletion we should be redirected to main.home

Formatting of web-page falls apart after resizing browser window

Describe the bug
When I resize the browser image the emissions histogram on the profile page does not resize (which may be sort of ok), but it also starts overlapping with the text next to it.
Similarly, the options/links (recipe, suggestions, thumbs up ...) below recipe items in the cookbook do not rescale to fit the width of each recipe picture, which makes it look funny.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'cookbook'
  2. Resize the browser window to be smaller than normal until formatting falls apart

Expected behavior

Emissions histogram should never overlap with text (either run out of screen or horizontally stack). Is it possible to resize the image depending on the browser width?

Links below recipe items should match the image in width whatever the browser window size

Screenshots
image

Desktop (please complete the following information):

  • OS: [Windows 10, 19018.1198]
  • Browser [Chrome 87.0.4280.66]
  • Version [NA (I did not include github versioning yet)]

Smartphone (please complete the following information):

  • Not tested on smarthpone

Additional context
NA

Improvements to search results interface

I believe the following would make interaction with the website more pleasant:

  1. Allow clicking on recipe title or picture to select it as new reference recipe. The only link to epicurious should be what is now calles "visit recipe". This link should be renamed to "recipe on epicurious", where epicurious is a variable in order to make it possible to later extend to other recipe websites.

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.