Comments (17)
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.
Great suggestion and thank you for writing out the structure so thoroughly!
from exer_log.
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.
I think I will get started with very basic implementation. And then we can proceed from there. I am using Riverpod
from exer_log.
Ideally inside authentication directory this is what I normally do:
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.
We can also throw a local widget directory in there, if needed.
from exer_log.
@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.
@KalleHallden Expecting your feedback. If you agree I'll get started
from exer_log.
I believe this would be fine to work on in the master branch
from exer_log.
@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.
@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
.
from exer_log.
@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.
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.
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.
@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.
@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.
@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)
- Workouts not saved to database and historical workouts not show in calendar HOT 6
- Error, while creating a new workout in debug-mode HOT 7
- Unit Tests For essential features HOT 6
- Mergeable not working now HOT 3
- Refactor: replace ThemeProvider HOT 1
- Proposing to change license from MIT to GPLv3 HOT 18
- Implement named routing HOT 1
- Run build checks in every PR HOT 3
- Add template for pull requests
- Request to create a website for this open-source project HOT 10
- Add stalebot to manage stale and irrelevant PRs and issues HOT 8
- Proposal to add issue templates HOT 3
- Please add logo to @EXERLOG organization HOT 2
- Implement Exercise type
- Firebase config: add workoutId in documents returned from getWorkoutOnDate HOT 2
- Ensure all contributors are added HOT 4
- Configure stale management in mergeable
- Firebase configuration HOT 3
- Dart Legacy code and Null Safety HOT 1
- [BUG] Cannot build the app for android HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exer_log.