MCBoarder289 / shelf-help

MIT License
3 stars 0 forks source link

Refactor to be React App w/ Flask Backend #26

Closed MCBoarder289 closed 4 days ago

MCBoarder289 commented 1 week ago

Now that the app is functional as a prototype with Plotly's Dash platform, I'd like to try and refactor this to have a distinct FE and BE so that the visual experience is cleaner / more modern. With a React FE, there would be more flexibility for the interactivity, which also might solve some of the PWA issues (not leveraging the url params).

This will be a significant refactor which will take more time, but I'd like to grow this full-stack skillset. I think it will be worth the investment. This resource seems useful as a good place to start.

Overall Vision

FE specifics

BE Specifics

Refactor Concerns

MCBoarder289 commented 1 week ago

Mantine UI Components

MCBoarder289 commented 1 week ago

Helpful article on Pydantic for BE validation / JSON serde: https://medium.com/@danielwume/exploring-pydantic-and-dataclasses-in-python-a-comprehensive-comparison-c3269eb606af

MCBoarder289 commented 1 week ago

Started with create react app, but might want to look into their pwa template: https://create-react-app.dev/docs/making-a-progressive-web-app/

MCBoarder289 commented 1 week ago

This might be needed for awaiting components to finish? https://stackoverflow.com/questions/71778278/how-can-i-ensure-that-a-react-component-is-loaded-only-after-some-api-call-has-b

Or loading behavior?

MCBoarder289 commented 1 week ago

https://stackoverflow.com/questions/66444067/react-display-loading-animation-for-api-call-duration

Loading behavior example

MCBoarder289 commented 1 week ago

https://dev.to/will_yama/how-to-render-responses-96c

Another helpful article about calling external apis

MCBoarder289 commented 1 week ago

Render static site info regarding redirects: https://community.render.com/t/cant-connect-api-calls-to-web-service-express-from-my-static-site/10229/3

MCBoarder289 commented 1 week ago

Looks like I need to go with a Vite template because create react app doesn’t work maybe?

https://help.mantine.dev/q/can-i-use-mantine-with-cra

Vite PWA- https://vite-pwa-org.netlify.app/guide/

Vite PWA- https://dev.to/_ibrahimturan/adding-pwa-to-vite-applications-1bce

MCBoarder289 commented 1 week ago

Might need this for changing the URL without refreshing the page? https://stackoverflow.com/questions/57101831/react-router-how-do-i-update-the-url-without-causing-a-navigation-reload

MCBoarder289 commented 1 week ago

Backend: Might need to consider the BE returning ALL the books, so that the FE can avoid using bandwidth to simply get a random selection.

Frontend: This might mean a refactor to use ReactQuery and manage the cache that way.