Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Display.pm into API.pm and Frontend.pm, make frontend use the API #5205

Open
Tracked by #5527 ...
stephanegigandet opened this issue May 5, 2021 · 8 comments
Open
Tracked by #5527 ...
Labels
API Refactor API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🎯 P1 refactor ⭐ top issue Top issue.

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented May 5, 2021

What

Related to the discussion about rearchitecturing Product Opener: #5170

I've been trying to find ways to better separate things in Product Opener: what's relative to the web frontend, to the API, to MongoDB queries, to processing products when we write them etc.

I'm thinking we could try to split Display.pm which is probably the worse module in terms of how everything is mixed together.

We could do it gradually:

  • create API.pm and Frontend.pm
  • gradually move functions from Display.pm to API.pm and Frontend.pm if there is a clear split
  • if there isn't a clear split, refactor the function so that there is one
  • gradually remove dependencies to Display.pm in other modules and scripts
  • gradually remove MongoDB / product .sto files write and read access from the frontend, and have the frontend use the API instead
  • create missing APIs (e.g. user management, products aggregates (list of tags for a facet) etc.)

What do you think?

Part of

@stephanegigandet stephanegigandet added the ✨ Feature Features or enhancements to Open Food Facts server label May 5, 2021
@M123-dev
Copy link
Member

M123-dev commented May 8, 2021

@stephanegigandet, as I mentioned in #5170 I think this is a good idea. But how do you imagine the transition time, this process will take a relatively long and possibly lead to many errors and broken things.
Should this repo be continued, should API.pm and Frontend.pm be new repositories or what were you thinking of?

@stephanegigandet
Copy link
Contributor Author

I think we can do it gradually without breaking anything, we can create new empty modules API.pm and Frontend.pm, and move functions one by one.

@M123-dev
Copy link
Member

M123-dev commented May 8, 2021

sounds good

@CharlesNepote
Copy link
Member

A great idea IMHO. I think there are many benefits:

  • code architecture will be more clear for newcomers
  • it will help front-end devs
  • it will help to fine-tune the API
  • it's a concrete and first step to architecture changes we talked about (languages, etc.)
  • as Stéphane already said, it allows moving gradually without breaking things

@M123-dev
Copy link
Member

M123-dev commented Jun 8, 2021

Is there already any progress here

@teolemon
Copy link
Member

@stephanegigandet @M123-dev I believe there will be progress tomorrow when this is deployed to .net

@teolemon
Copy link
Member

teolemon commented Sep 5, 2023

For the record, @VaiTon has started an alternative web frontend: https://openfoodfacts-explorer.vercel.app/

Copy link
Contributor

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Jan 30, 2024
@teolemon teolemon added API Refactor and removed ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Refactor API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🎯 P1 refactor ⭐ top issue Top issue.
Development

No branches or pull requests

4 participants