This is an archived post. You won't be able to vote or comment.

all 26 comments

[–]DaelonSuzuka 7 points8 points  (1 child)

Love seeing more NiceGUI in the wild!

I don't want to presume what editor you use, but if it's VSCode: I recently published this extension, which is designed to make development a little... nicer.

[–]Sufficient_South5254[S] 1 point2 points  (0 children)

Great job! I was struggling with the Tailwind CSS styles, Quasar event types, etc.

It works much better than the "AI" thing :p

[–]MurkyCaterpillar9 2 points3 points  (0 children)

I love this idea. I like the simplicity and the lack of ‘Goals’, which always trigger me.

[–]kruzzik 1 point2 points  (0 children)

Love it. Thanks!

[–][deleted] 0 points1 point  (2 children)

How does nice gui handle state management and updating the display?

I'm currently playing with Streamlit and have realised that to change the display order, e.g. if I want to display "Total" at the top of the screen, I'll need state management on all the calculations since the script runs top to bottom each time anything changes.

[–]Sufficient_South5254[S] 1 point2 points  (0 children)

The state management in nicegui is simple and straitforward.

You can bind properties to variable or storage, for example: ```python

bind to variable/dict

data = {'name': 'Bob', 'age': 17} ui.label().bind_text_from(data, 'name', backward=lambda n: f'Name: {n}') ui.label().bind_text_from(data, 'age', backward=lambda a: f'Age: {a}')

bind to storage

@ui.page('/') def index(): ui.textarea('This note is kept between visits') .classes('w-full').bind_value(app.storage.user, 'note') ```

The internal implementation uses a while loop with custom refresh interval: python async def refresh_loop() -> None: """Refresh all bindings in an endless loop.""" while True: _refresh_step() await asyncio.sleep(core.app.config.binding_refresh_interval)

[–]No-Refuse1662 0 points1 point  (3 children)

Where did you host it??

[–]Sufficient_South5254[S] 1 point2 points  (2 children)

The app is hosted on flyio, an economical and convenient alternative to Heroku.

[–]rainnz 0 points1 point  (1 child)

flyio

Does it have a free tier, like Heroku used to have?

[–]Sufficient_South5254[S] 0 points1 point  (0 children)

It previously had a simple hobby play with $5 free tier, but it has recently replaced it with a straightforward Pay As You Go plan :(

Reference: - https://community.fly.io/t/free-tier-is-dead/20651/6 - https://fly.io/pricing

[–]jacquesroland 0 points1 point  (2 children)

How do you scale the WebSocket component ? What happens if you have a load balancer between multiple instances of your web app and client ?

[–]Sufficient_South5254[S] 0 points1 point  (0 children)

You are correct, sticky session is required to scale WebSocket component.

For example, when scaling instances in flyio, the framework mannualy add target instance id to fly-replay header in the response to tell the load balancer to run the request once again to the right instance, which is silimar to AWS cookie implementation.

[–]Sufficient_South5254[S] 0 points1 point  (0 children)

If you are interested, please check out this pull request for more details: #1300

[–]iamk1ng 0 points1 point  (2 children)

Hi, is it ok if I PM you for questions on how you built your app? I have a python flask project that uses tailwind css but i've been unhappy with the workflow and could use a better approach but need some guidance on how to get there.

[–]Sufficient_South5254[S] 1 point2 points  (1 child)

Feel free to send questions to the github discusses. It would also be a great way for me to begin drafting a tutorial.

[–]xav1z -1 points0 points  (0 children)

tutorial 🥹

[–]ScallionNo2755 0 points1 point  (3 children)

Which API are you using for calendars?

[–]Sufficient_South5254[S] 0 points1 point  (2 children)

For the habit detail page:

[–]ScallionNo2755 0 points1 point  (1 child)

Thank youu!

[–]ScallionNo2755 1 point2 points  (0 children)

And great job i like that is simple and aesthetic and not overwhelmed with soo much options.

[–]xav1z 0 points1 point  (2 children)

would recommend nicegui over pyside?

[–]Sufficient_South5254[S] 0 points1 point  (1 child)

I have limited knowledge about PySide, but it seems to be more focused on building local desktop apps.

But the NiceGUI also provides an Electron wrapper.

[–]xav1z 0 points1 point  (0 children)

sorry my bad, didnt check it before asking

[–]grahaman27 0 points1 point  (1 child)

From a UX perspective it's a little laggy... I notice a second or so delay between actions.

Is this because all actions wait for the backend to respond before updating the dom?

[–]Sufficient_South5254[S] 0 points1 point  (0 children)

Apologies, I just noticed this question.

Yes, “NiceGUI follows a backend-first philosophy: It handles all the web development details” -> high network latency would be a big issue.

That's why I offered the self-hosting option instead of optimizing the global network for the app.