Giter Site home page Giter Site logo

Comments (17)

vancegillies avatar vancegillies commented on July 30, 2024 2

This is by far the biggest issue with the codebase and should be nailed down before continuing. Especially because you have open sourced this, You want anyone jumping in to understand the codebase and how it is to be structured.

I would recommend just making a new folder and start transferring stuff across, the app is small enough that it wouldn't take to long and it avoids all the merge conflicts. Once the new folder is in the desired state you can just point the 'main.dart' at the new folder

Another suggestion I have but can wait until after this change is complete is to move the app to the root of the repo.

from exer_log.

KalleHallden avatar KalleHallden commented on July 30, 2024 1

Great suggestion and thank you for writing out the structure so thoroughly!

from exer_log.

KalleHallden avatar KalleHallden commented on July 30, 2024 1

Yeah definitely man! Go for it, seems like you have a better idea of creating proper structure than me so that would be awesome!

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024 1

I think I will get started with very basic implementation. And then we can proceed from there. I am using Riverpod

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024

Ideally inside authentication directory this is what I normally do:

Screenshot 2022-08-05 at 11 29 44 PM

But since this is done in firebase, we don't have that much going on in here. So we can simplify this like the first image

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024

We can also throw a local widget directory in there, if needed.

Screenshot 2022-08-05 at 11 32 27 PM

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024

@KalleHallden do you want me to convert a feature like this? I think Login, Sign up would be a great point to start. Let me know if you want that.

Also, if we start working on this, then until this gets merged we should not accept any other changes in the authentication area to avoid merge conflict. Given this would be a huge change. LMK, what you think

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024

@KalleHallden Expecting your feedback. If you agree I'll get started

from exer_log.

KalleHallden avatar KalleHallden commented on July 30, 2024

I believe this would be fine to work on in the master branch

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024

@KalleHallden I have been wondering if we should stick with Bloc or change to something else? For example Riverpod may be? Let me know what you think. If you have any preferences or not.

from exer_log.

Scount avatar Scount commented on July 30, 2024

@dinurymomshad As i can see, we aren't using the real bloc atm. I think it's more like an repository approach since the networking calls are directly inside the 'bloc'.
I would prefere to use Riverpod, since we can also provide own states with the StateNotifierProvider or simply can use AsyncData or something like that.

Architecture change suggestion

Also i would make a change in the architecture. I can't see any folder for logic, therefore i would suggest to create a 'domain' and inside a 'logic' folder where all the logic can stay. It forces the developer to seperate logic from ui.
Further more i would like to split the models into entity and model.

  • The entity is inside the domain folder. It is a class without any fromJson or toJson stuff.
  • The model is inside data folder. It extends the entity and has all needed parsing methods like fromJson and toJson.

Example:
architecture

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024

@Scount #10 (comment)
What do think about this?

Never mind. I vote for riverpod as well. Since, we haven't implemented bloc. Riverpod would be much simpler and less boilerplate heavy.

Regarding the change in architecture:
I was thinking more like, view will only hold the UI. UI will watch a StateNotifier (aka Controller), Controller will hold all the business logic. Controller will also have access to repository to do the api calls.

Here, what logic do you want separated in a logic folder?

from exer_log.

Scount avatar Scount commented on July 30, 2024

Yes you are right with the view --> controller including controller specific logic --> repository.
What i mean with logic is global logic, functions like sort and filter which are used multiple times from different controllers. I didn't dive in the code that deep to search for things like that but i think, if something like this exists it has to be defined globally so any controller hat access to the same logic.

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024

Work In Progress: https://github.com/dinurymomshad/exer_log/tree/feature/authentication-refactor

@KalleHallden can you assign this issue to me please? And also update in project board if you have any?

from exer_log.

suzanpradhan avatar suzanpradhan commented on July 30, 2024

@dinurymomshad I suggest you to change the project folder to root too. (Currently its in app/exerlog/) Since this is already a massive update might as well add that too.

And, @KalleHallden, lets merge #55 pull request first than anything, then we can update other features and contribute base on this architecture.

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024

@dinurymomshad I suggest you to change the project folder to root too. (Currently its in app/exerlog/) Since this is already a massive update might as well add that too.

You are right. Gonna do that.

from exer_log.

momshaddinury avatar momshaddinury commented on July 30, 2024

@suzanpradhan done. Please give it a review if you will. I have built the project and ran the app.

from exer_log.

Related Issues (20)

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.