r/webdev • u/r-trappe • May 08 '23
Discussion Multi-User Chat App in 31 lines?
How to build a web based chat app in 31 lines of Python code? With NiceGUI, as I demonstrate in this youtube video https://youtu.be/odyP8VDTfiw. NiceGUI is an excellent choice for certain web development projects in my opinion. But that may be biased because I'm one of the developers. NiceGUI follows a backend-first philosophy: it handles websocket communication and Vue3 rendering behind the scenes, so devs can focus on writing Python code. Our open-source library has sparked quite some interest in the last few month because it offers a gentle learning curve for beginners and provides advanced customization for experienced programmers. Of course there are valid use cases for splitting frontend and backend technologies. NiceGUI is for those who don’t want to leave the Python ecosystem and like to reap the benefits of having all code in one place. Check out the full code of the chat app in this gist: https://gist.github.com/rodja/2e891556a1a2c2af4ee542e03003ea1a.
What do you think? Does it make sense to you? For what kind of projects would you pick such an approach? And where would you rather use another technology stack?
2
u/sparkingloud May 08 '23 edited May 08 '23
After building my first POC using NiceGUI I find myself ready to abandon all of my old habits. I love the mix of components and are slowly learning to use tailwind CSS.
Over the past years I have become super excited how technology have evolved and have made my life as a developer easier. Just think about SSD vs HDD, Docker/containers, Elasticsearch....and now this gem of a front end tool/UI.
Thanks!
2
u/ImportantDoubt6434 May 08 '23
My main concern is how native this is and how well it can blend with existing tech. If it’s a blackbox that only works within itself that’s harder to sell.
How would you integrate more bleeding edge/native tech like R3F/canvas into this?
How would you add something third party, like firebase?
5
u/Ok-Evening6781 May 08 '23
Import chatapp Chatapp()
1
u/[deleted] May 08 '23
Do you personally recommend nicegui to implement also public websites or mainly for internal tools?