Lurker News
Hey HN! I want to share my side project with you. It's called Bud and it's a full-stack web framework for Go.

I created a short video to show you how to create a minimal Hacker News clone with Bud: https://www.youtube.com/watch?v=LoypcRqn-xA.
The framework is free, open source and MIT Licensed. You can find it on Github: https://github.com/livebud/bud.
I started working on Bud 2 years ago after watching the introductory Laracast videos about the Laravel web framework. I was just blown away by how productive you can be in Laravel. However, like many of you, I've been so spoiled by Go. I didn't want to go back to writing PHP, so I decided to try creating Laravel for the Go ecosystem.
At this point, I just had the following goal:
• Be as productive as Laravel in a typed language like Go.
I got the first version working in 6 months and tried building a blog from it... It fell flat. You needed to scaffold all these files just to get started. If you're coming from Rails or Laravel you may shrug, this is pretty normal. Unfortunately, I've also been spoiled by the renaissance in frontend frameworks like Next.js. What I love about Next is that it starts out barebones and every file you add incrementally enhances your web application. This keeps the initial complexity under control.
With these newly discovered constraints, I started working on the next iteration. Bud should:
• Generate files only as you need them. Keep these generated files away from your application code and give developers the choice to keep them out of source control.
• Feel like using a modern JS framework. This means it should work with modern frontend frameworks like Svelte and React, support live reload and have server-side rendering for better performance and SEO.
With these new goals, the Bud you see today started to take shape. But along the way, I discovered a few more project goals:
• The framework should be extensible from Day 1. Bud is too ambitious for one person. We're going to need an ambitious community behind this framework.
• Bud should be able to provide high-level APIs for developers while compiling down to performant low-level Go code for production.
• Bud should compile to a single binary. With platforms like Fly.io and Heroku, these days it's easy to not care about this, but I still cherish the idea that I can build a single binary that contains my entire web app and secure copy it up to a tiny server that doesn't even have Go installed.
It's still super early days. You can find the the Roadmap on Github: https://github.com/livebud/bud/discussions/9. I encourage you to contribute your thoughts.
And here's the current documentation for what's already in Bud: https://denim-cub-301.notion.site/Hey-Bud-4d81622cc49942f991.... Comments are enabled for anyone to chime in.
I have big plans for the framework. I hope you'll join me on this journey to build ambitious websites faster with Go!

Comments (99) 32 threads

Earlier comments
cjohansson2 replies#
I'm experimenting with something similar as well, I'm curious - how do you solve HTTPS support since it's a built-in web-server?
mholt#
Yes, definitely use CertMagic. Let me know if you have any questions!
matthewmueller#
Not available yet. I did write the docs though, digging them up...

Created an RFC: https://github.com/livebud/bud/discussions/33. Feedback very welcome!
Hit me up on Twitter @mattmueller or over email hi@livebud.com. I'd love to hear what you're working on!

matthewmueller#
Thanks for sharing @sunfmin!

I perused the documentation and I can tell a lot of thought went into this. I appreciate the simplicity and applaud all efforts to make Go a serious contender in the full-stack web framework space!

lifeplusplus1 reply#
I thought of building my own framework then I remembered dealing with http headers, ssl, and http2
matthewmueller#
That's the beauty of using Go. All of this stuff is provided by the standard libraries.
dimgl3 replies#
I think using Svelte was a mistake. That being said, I'm pretty impressed with the effort here. Looking forward to seeing how this framework evolves. Cheers.
drewry1 reply#
In the video it says they are frontend agnostic and will be adding multiple frameworks soon. React was mentioned specifically as coming soon.
theptip1 reply#
To me I think the approach of Hotwire, LiveView, Django-HTMX etc. is more interesting for a Go framework, since websockets/async are baked into the Go language.

In other words, render the HTML in Go and ship the diffs to a small blob of JS running in the client over a websocket, instead of baking a whole React build into your server-side app. Much simpler toolchain this way, much easier to reason about.
I appreciate that this is a fairly different solution; one of the author’s explicit goals is that it should “Feel like using a modern JS framework”. Personally I’d rather have it “feel like I’m using Django / Rails”, except with most of the superpowers that were historically FE-framework-only.

quickthrower27 replies#
Where nextjs kicks ass is that coding front end interaction (sans back end interaction) and doing interaction in response to server feels almost identical.

There is no “ugh ok … better set up react now” feeling to make say an interactive chart because it was always there.
Similarly there is no “ugh ok … better set up a backend now” feeling you get using create-react-app as it was always there.
There is almost no mental gear switch as you switch from front to back to front.
The only small negative is you need to be careful what that first “server side” render produces and what it can access. But that is also part of the magic, as you can fine grain control the initial flash of content. For example include the layout/menus. Or include a cached view of a list that then updates on final render.
It just feels so well integrated more than any other framework I have tried (like aspnet mvc or RoR for example).
It will be hard to beat: If you want to beat it in Go you need at least a good Go->JS transpiler so you can use the same language. But even then anything other than JS/Typscript means I need a mental modal of what the transpiler is doing. I don’t get a free pass on understanding JS or the DOM.

Continue this thread — 7 replies

fsociety999#
> I think using Svelte was a mistake

Why do you think that?

matthewmueller#
Thanks for your comment @dimgl!

As @drewry mentioned, we're aiming to be frontend-agnostic. Changing the renderer should be as simple as creating files with different extensions:
- index.svelte for Svelte
- index.jsx for React
- index.html for HTML
- index.gohtml for go/template
There's more information in this discussion: https://github.com/livebud/bud/discussions/8

Load more comments