← Home ← Back to /g/

Thread 105688680

23 posts 2 images /g/
Anonymous No.105688680 [Report] >>105689236 >>105693307 >>105694886
I want to make a app with Go
But i dont know how to make the UI nice, is there any way i could quickly learn how to make some decent ass uis?

No, LLM's dont help cause they give garbage code that i dont know how to extend

My JS Knowledge goes as far as knowing how to get an element by it's id and modify the content
Anonymous No.105688866 [Report]
bumpastic
Anonymous No.105689014 [Report] >>105689132
https://fyne.io/
Anonymous No.105689132 [Report]
>>105689014
i looked into it and it's missing some features for handling offline stuff like drag and drop files, also arent the binaries super big and slow?
Anonymous No.105689236 [Report] >>105691598
>>105688680 (OP)
The most popular options are: Fyne, Wails, and Gio.

Go was designed with server-side programming, distributed systems, and command-line tools in mind. Its strengths lie in concurrency, networking, and performance for these domains. GUI development was not a core design goal.
Anonymous No.105689287 [Report] >>105691598
I would unironically suggest raylib-go (raygui). It's fun.
Anonymous No.105691598 [Report] >>105691893 >>105692883
>>105689287
>>105689236
i meant a webapp in the browser, not necessarily a bloated bastardization of a embedded browser
Anonymous No.105691893 [Report] >>105691984
>>105691598
Use template or a-h templ theirs only static HTML maybe htmx
Anonymous No.105691984 [Report] >>105692971 >>105693083 >>105693104
>>105691893
but for example if i want to send some data non stop to the UI to display a graph.. i cant do that with html right? i dont know if i can just open a socket with javascript
Anonymous No.105692883 [Report] >>105692969 >>105693032
>>105691598
did this retarded zoomer just call native UI an "embedded browser" ?
Jesus, I knew Golang was for morons but I didn't think it's this bad...
Anonymous No.105692969 [Report]
>>105692883
>fyne, wails, gio
>native ui
lol
Anonymous No.105692971 [Report] >>105692993
>>105691984
Yes you can!
If the graph is a SVG, all the server needs to do is to send the last <path> and htmx will handle the append.
Or you can use chart.js and add some javascript to it.
There is all kinds of stuff you can do with modern HTML, and if you sprinkle some JS, you get joy.
Anonymous No.105692993 [Report] >>105693160
>>105692971
can you give me an example?

let's say i have a canvas element, and my server wants to send json data that i will interpret and plot a graph by hand drawing pixel by pixel on the canvas

How do i go about it? i dont want to make fetch() every second, even tho that's the only solution i can come up with
Anonymous No.105693032 [Report]
>>105692883
No, he didn't. I think you just struggle with reading comprehension.
Anonymous No.105693083 [Report] >>105694643
>>105691984
>send some data non stop to the UI
I'd probably use htmx with the WebSocket extension and set up a websocket server in Go (gorilla/websocket is still the best library go has I think), or use htmx with the Server Sent Event (SSE) extension with whatever http setup you'd like.
Anonymous No.105693104 [Report]
>>105691984
Theirs many ways, googling or asking chatgpt might aid u
Anonymous No.105693160 [Report] >>105693205
>>105692993
You would use a websocket for that.
Also, doing fetch() every second might seen "dumb" but it's the easiest way to do it. And it scales surprisingly well.
t. saas developer that did that with 10k+ users
Anonymous No.105693205 [Report] >>105693275 >>105693336
>>105693160
how quick can i realistically fetch if my server is reading files and sending them as json (few kb at most)
Anonymous No.105693275 [Report]
>>105693205
Depends on ur Internet up to gigabytes easily
Anonymous No.105693307 [Report]
>>105688680 (OP)
What does JavaScript have to do with making the UI look nice, retard?
Have you even learned HTML & CSS before you started vibe coding?
After you do look into CSS frameworks.
Anonymous No.105693336 [Report]
>>105693205
Depends on the nature of the data.
In my case the data did not change very often, so I added a cache and then fetched every second.
Also consider what your user want, on my case and the case of every single place I worked on, a chart is used to indicate a trend, and to indicate a trend you can use a lot of stuff that is not a chart.
For example, the user doesn't care about the current number of stuff, but it care about how much new stuff there is, or other info.
It's not fancy, but it communicates a real information, instead of chart that is hard to analyze in a blink of an eye.
Anonymous No.105694643 [Report]
>>105693083
coder/websocket is usually what I use now
Anonymous No.105694886 [Report]
>>105688680 (OP)
>go
go back to india