openfoodfacts / smooth-app

🤳🥫 The new Open Food Facts mobile application for Android and iOS, crafted with Flutter and Dart
https://world.openfoodfacts.org/open-food-facts-mobile-app?utm_source=off&utf_medium=web&utm_campaign=github-repo
Apache License 2.0
851 stars 282 forks source link

Project Structure revision #1647

Open M123-dev opened 2 years ago

M123-dev commented 2 years ago

Problem

Somehow Smoothie's project structure has become very confusing lately.

Proposed solution

Looking at all the files we currently have I propose a separation by features with some exceptions. Meaning that we split all the Pages including theire specific widgets into theire own folders e.g scan, product_page, user_managment ... But I would keep a dedicated lib/widgets folder for common widgets like SmoothCard etc and keep the database folder (you could even see it as a own feature)

I'd like to hear your opinions on that @monsieurtanuki @g123k @cli1005 @AshAman999 @bhattabhi013 @vik4114 @teolemon

AshAman999 commented 2 years ago

I agree with the suggestions, though not sure if we would separate widgets by features or just keep them separate in the widgets folder. To me keeping widgets separately makes more appealing and easy then making them separate by functionality

Still thinking much before i make further suggestions, Till then waiting for everyone else's suggestions

monsieurtanuki commented 2 years ago

I don't say that the files are always in the good folders (I don't even have an opinion on that), but I read somewhere about a deadline on May 23rd and now I have limited time to devote to Smoothie. In short: to me, that's not a priority at all.

bhattabhi013 commented 2 years ago

Hi @M123-dev, I also think that there is a need to re-structure the project. I also have some suggestions regarding the structure e.g.

I'll share a detailed structure soon. I think @AshAman999 did a good job with folder structure and I also believe that we should wait for others suggestions.

M123-dev commented 1 year ago

This has gotten a bit stale, understandably, there were many other things with higher priority. However, I think that it is still quite a big problem, I personally have trouble finding my way around the folders, instead I always search for the class names and find my way around, but for new contributors I imagine it to be much more difficult.

It's not a big refactoring per se, it's moving around files and fixing imports, the bigger part is finding a suitable system,

Here is an example of my suggestion (according to this article, it's called feature-first):

The main point being, if I want to change something in the lists, I can work in the list's folder, why search together all the needed files in different folders if we can combine them.