Skip to content
/ go-react Public template

Go executable with an embedded React SPA

Notifications You must be signed in to change notification settings

anurag-roy/go-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-react

image


This is a simple Go executable with an embedded React app.

This particular implementation uses:

  • embed to embed static assets in the go binary
  • webview_go to run HTML, CSS, Js without bundling a browser
  • vite to scaffold and bundle the UI

Essentially any JavaScript UI framework/library can be used like Angular, Vue, Svelte, Solid, etc as long as the generated code doesn't depend on Node.js and is runnable on a browser.

Prerequisites

These need to be installed on your system to be able to develop/build the app:

Build

Build the ui first to generate your static assets. Inside the ui folder, run:

npm run build

Then build the binary. Inside the root folder, run

go build

That's it! The size of the binary on linux-amd64 comes to ~7.3MB.

About

Go executable with an embedded React SPA

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published