Code Monkey home page Code Monkey logo

veganify-api's People

Contributors

actions-user avatar dependabot[bot] avatar kodiakhq[bot] avatar philipbrembeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

iqneoxen

veganify-api's Issues

[Bug] 2 non-vegan ingredients always return {vegan: true}

Description:
If there are only two non-vegan ingredients in the ingredients list, data.vegan in the response is always true.

How to reproduce:
You can use any 2 non-vegan ingredients in the query. ("chicken, pork" for example).
Vegan ingredients don't affect the results.

Example js code I used.

let response = await fetch(
    'https://api.vegancheck.me/v0/ingredients/egg, milk',
    {
      method: 'GET',
    }
  );

The problem can be reproduced on the https://vegancheck.me/ingredients website as well.

[Feat] Dockerize Backend

Proposed changes

The BE of the project should be dockerized to be more scalable.
This would could potentially fix our ongoing uptime issues.

[Feat] Convert to NestJS

Proposed changes

For a better overview of the code as well as better extend ability in the future, we should switch from Pure Express to NestJS.

This is an effort we can now make, since we previously switched to ES6 (better late than never! ๐Ÿ˜Š)

Also, the current logic to scrape the data from Peta for cruelty-free brands (including a cronjob) does not work anymore because of the Docker-Setup.
I think it would be best to extract this logic into a GitHub action (if possible) an then just push the latest file to the repo (which will automatically create a new build).

Acceptance Criteria

  • Codebase is updated to NestJS
  • Dockerfile is updated to start and build NestJS server
  • PetaCron is extracted into a GitHub Action
  • Tests are rewritten to the NestJS API
  • Tests are extended

Fix false-positives for unknowns

Bug description

Currently, if VeganCheck.me is given an ingredient that it doesn't recognize, it says that it is vegan -- even if it isn't

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to https://vegancheck.me/ingredients
  2. Type "cow"
  3. See message indicating that "cow" is vegan

Solution

If a query for an ingredient that is submitted to VeganCheck is not known to VeganCheck's backend, then it should respond with an "I don't know" error, instead of a false-positive guess (green checkbox).

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.