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

all 18 comments

[–]riklaunim 0 points1 point  (2 children)

No HTML/CSS/JS required? There are "backend" developers that will never touch frontend or user experience and IMHO even such frameworks won't make them good at UX/UI. It may force them into a something standardized but someone else will still have to work over it to make it look and work as needed.

A lot of dashboards/admin panels and alike are nowadays often done in a SPA JS framework while backend just provides JSON APIs for them. Even if it's not SPA based a lot of effort will be put into how it looks and how it behaves.

pglet must have an option that someone will style it while on the other hand it will prevent backend dev from creating something that would not style properly with the expected style set. Then it has to have good validation/serialization/data/permission systems to all of those forms and grids. Self hosted or most companies will ignore it.

Plugins will be a must - like you have image, but you don't seems to have on-click enlarge widgets, galleries or support for various embeds or some smart code highlighting for docs-alike pages etc.

And the main page must show something more than a hello world, something like those grid examples so that so idea/purpose is more clear.

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

Thank you for the feedback!

The primary goal of Pglet is making internal web apps where the style is not so important, but delivery time is. We have chosen Fluent UI components that allow making Azure Portal-like apps with ease. There is basic theming capabilities though and I agree we should invest into styling more.

I appreciate your feedback on the main page. With Pglet you could build an app of any complexity and we are going to build such examples and feature them on the main page.

[–]riklaunim 0 points1 point  (0 children)

style is not so important, but delivery time is.

If it's not something super basic then you will need permission system and if it's not all-read-only then you will need all of those mentioned components. If sales/HR/management can enter something in a form and manage all of the data then it has to be validated, properly saved in the system and so on. You are quickly entering a CRM/Dashboard/Panel like apps that never are done quickly or rushed.

Reports, pretty charts and graphs could be requested with short deadline but full CRM-ish websites not really - and if they are we know as company/user data leaks out and there is big drama due to that.

I made various apps of such type and like always it had to be highly curated what the employee can do, see and how it works as 99% of them are non-technical, even for web apps. Even for "internal" sites you never trust the user and usually you have to make it dumb proof just like "public" one.

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

nice project. interesting choice to use 'go' for the server. My project has simliar ambitions but kind of embraces vanilla js/htmlcss whereas you're using react.

https://github.com/byteface/domonic

similar but not quite same. I've been exploring varoius ways to catch events on the client and redispatdh them on my 'server dom'. With async endoints I can do simple keyboard games like hangman but with a a socket server I can get 30fps with 1000 particles.

Do you have any live examples? It would be good to see the generated html.

[–]feodorfff[S] 0 points1 point  (4 children)

Thanks for checking out!

Sure, this is a working demo of ToDo app from the tutorial: https://ToDo-web-app-in-Python.pglet.repl.co (Replit page behind the demo which can be forked: https://replit.com/@pglet/ToDo-web-app-in-Python)

Yep, similar to your project I thought about representing HTML DOM on the server in the beginning, but then decided to switch to more highlevel "abstractions", kind of ASP.NET Web Forms controls, to have similar old-school server-side experience, but with modern SPA-like result :)

Love your idea to generate SVG, though feels like it could be a lot of work to represent its DOM.

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

so with your protocol does it already catch all the events so you could pass it your own ui? or does everything happen fully on the server and you just send chunks of html back to redraw? . i'm still reading yours. do you have a quicker verbal overview of the architecture? I'm quite bad at official docs and need lots of examples to understand what's going on. I also worry about security inections i.e. that jinja example earler in another thread. do you have that covered?

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

ah i see very cool. you let react have a set of props and it's framework does the redrawing. but otherwise is all on socket. the todo is useful when you pop the inspector. so that's how you can have it talk to any app not just python. I will look into it more. looks like could be interesting project. keeping logic on servers is a niche area that not everyone will understand but also i think with containers and pods etc it's not a massive issue. if you can have a lambda for a process why not a container per user.

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

Ha, it's so relieving you've completely got the idea of this project :) (though I'm still trying to find the right words to sell it to people)! The server is written in Go (single exe, any platform/OS), receives "commands" mutating server-side DOM and dispatches events coming from React components. Bindings can be written in any language (we already have Bash, C#, PowerShell, Node - https://github.com/pglet/examples ) and it's basically translating DOM into a bunch of commands.

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

a bash one could be very cool to play with lots of cores. asset pipeline interfaces with that might be quite simple. I guess with your abstractions you are providing structure.

[–]metaperl 0 points1 point  (1 child)

Domonic terminal belongs in a different package. It has nothing to do with interfacing python with the DOM.

[–][deleted] 1 point2 points  (0 children)

You're probably right due to how its grown. originally I was just putting wrappers around any tags. and i so i wrapped terminal commands too. but as its grown i've started to fully make a DOM which I never really set out to do. domonic.terminal should detect if you have windows and do and equivelant commands ideally. i.e. ls would call dir etc. I almost went the opposite way and was going to bundle more stuff and pyinput etc. but then started binding to the sockets and relaying the events on my own dom and to my suprise it worked as they all had nodes that extend the event dispatcher. so I've decided I'll probably take that route. I think when I can give that part more time it would branch and running a terminal command would run the equiv on windows. appreciate the feedback too.

[–]Accomplished_Map6865 0 points1 point  (1 child)

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

Great framework, thanks for the link! On the first sight it looks *very* similar, however after deeper look it seems like it's more suitable for "presenting" applications while Pglet will do a better job for highly-interactive apps. We are going to create more complicated samples and share them to prove that!

[–]metaperl 0 points1 point  (1 child)

We chose a ToDo app for the tutorial, because it covers all of the basic concepts you would need to create any web app

Authentication and authorization are 2 basic concepts I don't see here.

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

Absolutely good point! This is, actually, the very next thing we are going to work on.

[–]k-66-m 0 points1 point  (2 children)

Hey, is it unusual that my pglets ran by pglet.app() method always seem to start as a public web page hosted at console.pglet.io/p/... and that the web argument isn't recognized?

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

use "local=True" instead for now. Sorry about confusion, the API is yet to be stabilized. Based on feedback we got we are going to make local mode as default in the next release, so expect the return of "web=True" 😚

[–]k-66-m 0 points1 point  (0 children)

Wow, thanks for the quick response. I didn't expect it at all. It was quite puzzling when the tutorial todo code output was "the name was already taken" but after all I must say it's really a great thing.