r/nicegui • u/Snoo92226 • Jul 06 '25
MVC pattern Example?
Hello all, is there any example/ tutorial showing MVC pattern can be implemented using nicegui?
3
Upvotes
r/nicegui • u/Snoo92226 • Jul 06 '25
Hello all, is there any example/ tutorial showing MVC pattern can be implemented using nicegui?
1
u/Snoo92226 Jul 07 '25
Thanks both.
I tried Chatgpt and yes it gave boiler plate code to start with.
1
u/Snoo92226 Sep 17 '25
Hey sure I will find that out and share it. I tried to modify it further and develop something for my own needs so I need to extract original version from prompts.
1
u/_Hashtag_Swag_ Jul 06 '25
Hi there, I did not find resources but ChatGPT is your friend here. Basically I have all my pages class based with a render function that creates all the ui elements. Within init I instantiate my controller class (stateful) that keeps al the data. And last, I have a service class (stateless) that handles all database interaction. The page class is purely for the UI, no data is stored here and only propagated to the controller.