Better Programming

Advice for programmers.

Follow publication

Member-only story

Build a Desktop App in Go Using Wails and React

Ed Rutherford (@dedsyn4ps3)
Better Programming
Published in
6 min readOct 13, 2022

Photo by Lautaro Andreani on Unsplash

Many of us who’ve invested the time and effort to build a nice web application using React or another frontend framework have usually had the thought in the back of our heads at one time or another: “I wonder how hard it would be to create a desktop app just like this?”.

Let’s face it, we all use the web each and every day, and for many developers, it’s how we started getting into programming. While web apps are an awesome way to start building your skills and professional portfolio, sometimes we want to step it up a bit and get into the realm of standalone applications…perhaps even on to packaging and distribution for multiple platforms and devices.

There’s no better way to start than by creating a desktop application from a new or existing project using a web framework you know best! And now you can use these front ends with a super quick, easy to learn, concurrent, and statically typed back end with Go and the Wails framework!

Let’s get started, shall we? Firstly, it’s always important to get all your dependencies set up before setting out to do any projects. Fortunately, there’s not a whole lot to worry about when using Wails to set things up. Two key necessities are:

  • Go v1.18+
  • npm

If you fancy yourself a yarn person (like myself), go ahead and make sure you have that as well…which you more than likely do if you’ve gone through building web applications already.

If you’re building your application on Mac, make sure you’ve got Xcode command line tools installed by running xcode-select --install in a terminal. Wails utilizes native device browser APIs to avoid bundling an entire browser into the final binary, as a result, developers not running Windows 11 will need to make sure to install the WebView2 runtime.

With all that out of the way, the only thing left to do is install the Wails framework by running go install github.com/wailsapp/wails/v2/cmd/wails@latest. For those planning on doing development on a Linux-based system, make sure to run wails doctor to check whether you have the proper dependencies installed.

Project Setup

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Ed Rutherford (@dedsyn4ps3)
Ed Rutherford (@dedsyn4ps3)

Written by Ed Rutherford (@dedsyn4ps3)

Avid multi-language programmer, with a passion for Application Development, Cybersecurity and IoT. Always looking to learn something new and spread knowledge!

No responses yet

Write a response