# Using golang as front end framework

**URL:** <https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226>\
**Category:** Technical Discussion\
**Created:** [April 21, 2022, 3:41pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226 "2022-04-21T15:41:38Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnk](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://forum.golangbridge.org/u/johnk)\
**Post date:** [April 21, 2022, 3:41pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/1 "2022-04-21T15:41:38Z")

</div>

Hi there,

i want to learn golang but i see no option to use it a fullstack language like javascript. i can build the backend but then again i have to go to react, vue etc to build the front end.

or

is there an actuall tool one can use to make fullstack frontend backend webapp with golang is there an example of a good webapp all built using golang?

thanks

---

<div class="post-metadata">

**Author:** ![Dean\_Davidson](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/dean_davidson/32/9685_2.png) [@Dean\_Davidson](https://forum.golangbridge.org/u/Dean_Davidson)\
**Post date:** [April 21, 2022, 5:38pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/2 "2022-04-21T17:38:09Z")

</div>

> **[GitHub - maxence-charriere/go-app: A package to build progressive web apps...](https://github.com/maxence-charriere/go-app)**
>
> A package to build progressive web apps with Go programming language and WebAssembly. - GitHub - maxence-charriere/go-app: A package to build progressive web apps with Go programming language and W...

> **[GitHub - avelino/awesome-go: A curated list of awesome Go frameworks,...](https://github.com/avelino/awesome-go#web-frameworks)**
>
> A curated list of awesome Go frameworks, libraries and software - GitHub - avelino/awesome-go: A curated list of awesome Go frameworks, libraries and software

---

<div class="post-metadata">

**Author:** ![Sibert](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Sibert](https://forum.golangbridge.org/u/Sibert)\
**Post date:** [April 21, 2022, 6:21pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/3 "2022-04-21T18:21:00Z")

</div>

> [@johnk](#):
>
> is there an actuall tool one can use to make fullstack frontend backend webapp with golang is there an example of a good webapp all built using golang?

I have played with Go both frontend / backend. Still a newbie, but you can [check my latest attempt here](https://task.go4webdev.org). No additional framework used. Just standard Go.

---

<div class="post-metadata">

**Author:** ![johnk](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://forum.golangbridge.org/u/johnk)\
**Post date:** [April 22, 2022, 6:01pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/4 "2022-04-22T18:01:46Z")

</div>

hi @Sibert

beautifull ui/ux on top of your golang apps. I am wondering if i can create a website with blog and comments fucntion for users to login and comment and manage the comments. using Facebook, google or custom signup to comment etc. what is your recoemendation for a beginner.

thanks

---

<div class="post-metadata">

**Author:** ![johnk](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://forum.golangbridge.org/u/johnk)\
**Post date:** [April 22, 2022, 6:03pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/5 "2022-04-22T18:03:54Z")

</div>

Hi @Dean_Davidson

the list of availabel frameworks is big, is there a specific tool you can recommend which better from your experience thanks

---

<div class="post-metadata">

**Author:** ![Sibert](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Sibert](https://forum.golangbridge.org/u/Sibert)\
**Post date:** [April 22, 2022, 8:04pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/6 "2022-04-22T20:04:35Z")

</div>

> [@johnk](#):
>
> beautiful ui/ux on top of your golang apps.

Thank you! Plain HTML, CSS and Javascript. The Go code is about 10 MB only. No framework. No dependencies. I have used both PHP, Drupal and WordPress earlier. [But I do like Go templates and sub templates](https://static.go4webdev.org/navigation). The speed and simplicity is the best I have experienced so far.

> [@](#):
>
> I am wondering if i can create a website with blog and comments fucntion for users to login and comment and manage the comments.

Sure it is possible, but this will maybe take some time using Go. Using WordPress solutions from the shelf, you can be up and running in a few days.

---

<div class="post-metadata">

**Author:** ![mikeschinkel](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/mikeschinkel/32/10651_2.png) [@mikeschinkel](https://forum.golangbridge.org/u/mikeschinkel)\
**Post date:** [April 25, 2022, 12:45am UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/7 "2022-04-25T00:45:02Z")

</div>

> [@johnk](#):
>
> _“i want to learn golang but i see no option to use it a fullstack language like javascript. i can build the backend but then again i have to go to react, vue etc to build the front end.”_

In general the reason you have not seen how to use Go as a full-stack language is generally because Go is not a full-stack language, it is a back-end and CLI language, and there is shines. much better than for example Node and Javascript, IMO.

As they say, _“Use the right tools for the job and the job becomes much easier.”_ Go is great if you want to build an API, or even to serve a Single Page App that uses a front-end technologies such as React or Vue.js for the front-end.

That is not to say you can’t create a website using _only_ Go as [Sibert](https://forum.golangbridge.org/u/Sibert) illustrated, but that will have you swimming upstream against a relentless current, assuming you actually want to get something accomplished. Of course if you are just doing the work for learning and exploration sake, more power to you!

And even so it’s not accurate to say that Silbert’s site is 100% Go because he still had to use CSS and JavaScript ([https://task.go4webdev.org/js/nav.js](https://task.go4webdev.org/js/nav.js)) because browsers do not run Go code.

There are a lot of web frameworks for use with Go, but _(pretty much) all(?)_ of them require you to handle the front-end with front-end technologies:

- [https://www.mindinventory.com/blog/top-web-frameworks-for-development-golang/](https://www.mindinventory.com/blog/top-web-frameworks-for-development-golang/)

Now you could generate WebAssembly and implement a website _ **completely** _ in Go but you’ve have to reinvent the wheel that React and Vue.js have already invested probably tens of thousands of man-hours into.

That would be like trying to build a new car and building everything from scratch and not using any already readily available off-the-shelf parts. Unless of course you want to be the one to build _ **the** _ Go developer’s web toolkit that does everything that Vue.js and React do but all in Go-generated WebAssembly. If so, good luck and these links might help:

- [WebAssembly using Go (Golang) | Run Go programs in the browser](https://golangbot.com/webassembly-using-go/)
- [Writing a Frontend Web Framework with WebAssembly And Go | TutorialEdge.net](https://tutorialedge.net/golang/writing-frontend-web-framework-webassembly-go/)
- [Building full-stack web apps with Go, Vecty, and WebAssembly - LogRocket Blog](https://blog.logrocket.com/building-full-stack-web-apps-with-go-vecty-and-webassembly/)
- [WebAssembly with Golang by scratch | ITNEXT](https://itnext.io/webassemply-with-golang-by-scratch-e05ec5230558)
- [A package to build progressive web apps with Go and WebAssembly | GitHub](https://github.com/maxence-charriere/go-app)

> [@johnk](#):
>
> _“is there an actual tool one can use to make fullstack frontend backend webapp with golang is there an example of a good webapp all built using golang?”_

So, as Silbert said, an easy approach is to [just use WordPress](https://www.wpbeginner.com/start-a-wordpress-blog/).

Alternately, if you want to stick with something written in Go you should take a look at [the website generator Hugo](https://gohugo.io/), which is written in Go. Here’s an article explaining how to create a blog using it:

- [How to start a blog using Hugo](https://flaviocopes.com/start-blog-with-hugo/)

If you want to actually code in Go _(to maybe get experience?)_ then you could fork Hugo and make your own modifications to it I guess.

But bottom line, unless you are going the route of everything in WebAssembly then you are going to end up having to use front-end tech in addition to Go to build a modern website.

Hope this helps.

-Mike

---

<div class="post-metadata">

**Author:** ![johnk](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://forum.golangbridge.org/u/johnk)\
**Post date:** [April 26, 2022, 2:54pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/8 "2022-04-26T14:54:28Z")

</div>

> [@mikeschinkel](#):
>
> A package to build progressive web apps with Go and WebAssembly | GitHub

thanks @mikeschinkel

this was a really detailed response i discoverd new tools i didnt knew exist. i get intrested in golang as i was told it can cover both frontend and backend.

should i use tools like this

> **[GitHub - gin-gonic/gin: Gin is a HTTP web framework written in Go (Golang)....](https://github.com/gin-gonic/gin)**
>
> Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin. - ...

as my arguement is if i need to build frontend with react nextjs why not just build the backend with node instead of golang this way one have to manage single resources type js and much easier to manage and learn?

will golang become a full stack language anytime soon or i shoudl abandon golang if i want single frontend backend language.

thanks

---

<div class="post-metadata">

**Author:** ![Sibert](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Sibert](https://forum.golangbridge.org/u/Sibert)\
**Post date:** [April 26, 2022, 3:23pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/9 "2022-04-26T15:23:50Z")

</div>

It sounds to me that you have made up your mind :-). Node (or Nextjs) / React is a very popular combination. The web part of Go is not that mature, but despite that I think that Go will be **my** choice. Make a small test site (Hello World +) in both environments, and this will help you to choose. Nobody else can give you a correct answer. It is a personal preference.

Why I will choose Go is because of the capabilities beyond Web frontend.

---

<div class="post-metadata">

**Author:** ![mikeschinkel](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/mikeschinkel/32/10651_2.png) [@mikeschinkel](https://forum.golangbridge.org/u/mikeschinkel)\
**Post date:** [April 26, 2022, 5:27pm UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/10 "2022-04-26T17:27:55Z")

</div>

## Gin Framework

Gin is a fine web framework, but it **does not handle the front-end** _(AFAIK, at least)_, so that’s up to you. Which means you’ll still have to handle the front-end in Javascript.

BTW, if you are looking for web frameworks that handle more of the front-end, look at [**Buffalo**](https://gobuffalo.io/). But still, you’ll likely have to write Javascript.

## Will Go become “full-stack?”

I cannot speak for the Go team.

However, I can read the tea leaves. In my estimation — based on the past 10+ years — I would say there is less than a 1% chance the Go team has any plans to optimize Go for front-end development, other than to support WebAssembly.

But hey, I could be wrong!

## Why use Go vs. Node?

Why build backend and front-end in different languages? **It lets you use the best tool for each job**.

With Go you get compiled code in a single executable for ease of deployment, and in most cases faster execution. And you also get type safety, which you don’t get in Javascript _(although you can get it with TypeScript.)_

### Avoid Dependency Hell

Further, you don’t have dependency hell in GoLang anywhere near the way you do with Node; no `node_modules` directory with an infinite number of files and directories _(I exaggerate. Well, only a little):_

 ![node_modules suck!](https://forum.golangbridge.org/uploads/default/original/2X/6/68170030c6712d00f464d24d987b6cbe1b996022.jpeg)

[**This blog post**](https://research.swtch.com/npm-colors) from a member of the Go team explains in detail why Node dependency management is such as problem and why GoLang is so much better _( **Note** : Read the whole post, not just these headline because reading only the headline might give you the wrong impression of what the problem is.)_

## Different folks, different strokes

But like Sibert said, it sounds like you’ve already know what you want and that is you want to go with some form of JavaScript. If using the same language is most important to you then have at it. At the end of the day both approaches will allow you to create websites; what works best for you is what works best for you.

But I can say that — having done web development for 20+ years — I really enjoy coding in Go whereas dealing with Javascript and especially Node was always painful to me. So much so that I decided to focus exclusively on backend development _(and DevOps)_ in the past year, and so I no longer do front-end dev, pretty much at all.

For me, life is so much nicer now! _And the pay is a lot better, too_. 🙂

So it’s up to you to choose what you want. Sibert and I tag-teamed to answer your questions and we’ve given you plenty to go on; now the choice is yours.

## P.S. A 3rd Option

But before you go, you might consider a third option. Not as great as Go on the backend, IMO, but better than dealing with Javascript and Node:

- [**Dart**](https://dart.dev/web) with [**Flutter**](https://flutter.dev/).

#fwiw

Again, hope this helps.

-Mike

---

<div class="post-metadata">

**Author:** ![amnon](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/amnon/32/6617_2.png) [@amnon](https://forum.golangbridge.org/u/amnon)\
**Post date:** [May 7, 2022, 8:18am UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/11 "2022-05-07T08:18:31Z")

</div>

Go is great for backend, but is not really designed for frontend work.

---

<div class="post-metadata">

**Author:** ![system](https://forum.golangbridge.org/uploads/default/original/2X/5/5ad234f7c3dbc68b6cc72d338ce4f2973d9fd81c.png) [@system](https://forum.golangbridge.org/u/system)\
**Post date:** [August 5, 2022, 8:19am UTC](https://forum.golangbridge.org/t/using-golang-as-front-end-framework/27226/12 "2022-08-05T08:19:08Z")

</div>

Closed on August 5, 2022, 8:19am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
