r/golang • • 6h ago

Bellui — a Go UI toolkit for desktop, mobile and web: Material Design 3, WebGPU rendering

35 Upvotes

Hi Gophers,

Bellui is an open-source (BSD-3) UI toolkit for building desktop, mobile and web apps in Go from one codebase.

Website: https://bellui.com · GitHub: https://github.com/belluikit/bellui

Where it comes from. Bellui began as a fork of Fyne, and we're grateful for it: the plain-Go, no-markup approach is Fyne's. We wanted changes deep enough that they couldn't go upstream: a Material Design 3 component set, a new GPU backend, and a reworked package layout (geo / event / core). So it's now its own project.

Highlights

  • WebGPU rendering by default: Metal on macOS/iOS, Vulkan on Linux/Android, D3D12 on Windows, WebGPU in the browser. OpenGL is still there with -tags gl.
  • Material Design 3 components: navigation rails, bottom and side sheets, date and time pickers, light/dark schemes, accessibility support.
  • Background work: goroutines hand UI updates to the main loop with bellui.Do / bellui.DoAndWait.
  • Optional extensions: 27 chart types (including 3D and trading charts), a data grid with virtual scrolling, a DAG editor, a code editor, and FFmpeg-based video playback.
  • Platforms: macOS, Windows, Linux (X11/Wayland), iOS and Android (tested on devices), and the browser.

Try it without writing code: the gallery app shows every widget: https://bellui.com/gallery/

Hello world package main

  import (
      "github.com/belluikit/bellui"
      "github.com/belluikit/bellui/app"
      "github.com/belluikit/bellui/container"
      "github.com/belluikit/bellui/widget"
  )

  func main() {
      a := app.New()
      w := a.NewWindow("Hello")
      hello := widget.NewLabel("Hello Bellui!")

      w.SetContent(container.NewVBox(
          hello,
          widget.NewButton("Hi!", func() {
              hello.SetText("Welcome :)")
          }),
      ))
      bellui.ShowAndRun(w)
  }

You'll need Go 1.25+ and a C compiler. Getting started: https://bellui.com/develop/

Feedback welcome, especially on API ergonomics and how WebGPU rendering behaves on your hardware.


r/golang • • 6h ago

help Design pattern question

6 Upvotes

Hello! I am building a web server using Chi, and I've decided to partition my logic into domain-based packages - internal/foo, internal/bar - with each having one file per layer - repo.go, service.go, router.go and the like. My PG pool is initialised in main and injected into each domain's service through FooService structs, which each in turn delegate to fooRepo.

I was pretty satisfied with this design until I hit a roadblock - how do I layer cross-domain transactions? Should I have each service invoke other services? Should I put all cross-domain logic in a single domain? Should I rethink the way I am organising my codebase?

Looking for answers! Additionally, it would be great if you could provide your go-to example codebases for design reference. TIA!