shiffman / BodyBlock

Experimenting with BodyPix model and Obscuring faces/bodies.
30 stars 4 forks source link

[State management] Options & Ideas #25

Open joeyklee opened 4 years ago

joeyklee commented 4 years ago

Description

As mentioned in previous issues (e.g. https://github.com/shiffman/BodyBlock/issues/24) we will definitely be approaching the limits of our managing the state of our application as it is currently implemented.

As our application is growing, it is a good time now to define how we might want to proceed about managing state in the project.

In general, a good place to start would be to adopt some kind of Model-View-Controller (MVC) paradigm. We can implement our own like this -- https://www.taniarascia.com/javascript-mvc-todo-app -- or we can go with something more opinionated, but well used like Redux with Redux Toolkit -- https://redux-starter-kit.js.org/.

For the same reason why we might not introduce react (see below), I would say that introducing redux might not also be necessary at the moment and we can just develop our own MVC setup.

Other considerations

This also brings up some questions about whether or not we want to switch to a more robust front-end framework like react.js or vue.js, but for now i'm inclined to not introduce new frameworks since AFAIK @shiffman is not familiar with them yet and I think we don't absolutely need a framework given the relatively contained size of the project. All that being said, I'm totally open to choosing the right tools for the job.

shiffman commented 4 years ago

I would be glad to follow your lead here. You are correct that I am not familiar with react.js or vue.js but I am always willing to learn. I also see my role more on the p5 / ml model side in terms of processing the images so if there is a framework that will help others get more involved with interface and state considerations I'm all for it!!

joeyklee commented 4 years ago

@shiffman - excellent. I am working on a PR right now to show a simple case for a MVC that we might be able to get away with. If it seems like that experiment will not fit our needs, I'll be happy to update our tooling to support something a bit more established like React or Vue.