- Notifications
You must be signed in to change notification settings - Fork33
Build awesome Golang desktop apps and beautiful interfaces with Vue.js, React.js, Framework 7, and more...
License
guark/guark
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Guark allows you to build beautiful user interfaces using modern web technologies such as Vue.js, React.js..., while your app logic handled and powered by the amazingGo.
Guark is an open-source framework to build cross platform desktop GUI applications.
Go + Quark = Guark
Simplify cross platform desktop apps development.
Demo Video:https://youtu.be/_k_tq9sj-do
Guark backend and logic part handled by native Go code, while the user interfaces built with modern web technologies (Vue.js, React.js, etc...), and with Guark javascript API you can communicate between your Go and UI framework, and calling your exported Go functions and plugin(s) methods.
- Desktop applications with GO ♥
- One codebase for Gnu/Linux, macOS, and Windows.
- UI Hot Reload.
- You can use any front end framework.
- Supports Chrome, and native webview engine or both.
- Windows MSI bundler builtin.
go install github.com/guark/guark/cmd/guark@latest
// fedorasudo dnf install gtk3-devel webkit2gtk3-devel gcc-c++ pkgconf-pkg-config// Ubuntusudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev build-essential// Windows// https://jmeubank.github.io/tdm-gcc/download/
Open a console and make sure the tdm-gcc tools chain are in the PATH:
gcc --versiongcc (tdm64-1) 10.3.0Copyright (C) 2020 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.After installing guark CLI tool, the next step is to create a new guark project based on the template that you like:
# cd to empty directory and run:guark init --template vue --mod github.com/username/appnameAfter creating new project run:
guark run
// lib/funcs/foo_bar.goimport ("github.com/guark/guark/app")funcFooBar(c app.Context) (interface{},error) {c.App.Log.Debug("Foo bar called")return"This is a my return value to javasript",nil}
// Exposed functions to guark Javascript api.varFuncs= app.Funcs{"foo":funcs.FooBar,}
3. Then you can call your function in #"Permalink: 3. Then you can call your function in javascript:" href="#3-then-you-can-call-your-function-in-javascript">
importgfrom"guark"g.call("foo").then(res=>console.log(res)).catch(err=>console.error(err))
See Vue template as an example:https://github.com/guark/vue
You can change the engine inguark.yaml file.
webview: Uses native system webview.chrome: Uses and requires google chrome.hybrid: Uses chrome if exists in the system, if chrome not available guark will switch to native webview by default.
guark-build.yaml contains all configuration and path required for the build, like the compilers or default platform.
The C/C++ compilers are not using the PATH environment and need an absolute path to them, on linux it will use the default paths for Linux builds.
For cross platform build, it will look like:
linux: ldflags: ""darwin: ldflags: ""windows: cc: /usr/bin/x86_64-w64-mingw32-gcc cxx: /usr/bin/x86_64-w64-mingw32-g++ ldflags: "-H windowsgui" windres: /usr/bin/x86_64-w64-mingw32-windresUpdate these paths accordingly (check the GCC/distributions documentations for the right paths)
On Windows, make sure to have installed tdm-gcc, once done, update the guark-build.yaml:
# Guark build config file.setup: - cmd: yarn install dir: ui - cmd: go mod download - cmd: go mod tidy - cmd: go mod verifylinux: ldflags: ""darwin: ldflags: ""windows: cc: C:\apps\tdm-gcc1030\bin\gcc cxx: C:\apps\tdm-gcc1030\bin\g++ ldflags: "-H windowsgui" windres: C:\apps\tdm-gcc1030\bin\windres.exeYou can build your app with
guark build
After building your app you can bundle your windows app into msi using WIX.
guark bundle
Install it from:https://wixtoolset.org/
You can build windows app from your linux based system, usingmingw64
// Fedorasudo dnf install mingw64-gcc// Ubuntusudo apt install binutils-mingw-w64
Double check the binary paths inguark-build.yaml.
# this command will build and compile linux, and windows app. you can find your compiled apps in `dist/` directory.guark build --target linux --target windowsYou can use any cross compiler for example:guark build --target darwin. just change the options inguark-build.yaml file.
You can also bundle windows app into MSI file from your linux based system viaguark bundle, but you need to install wix tools:
# fedoradnf install msitools# Ubuntusudo apt-get install wixl
PRs, issues, and feedback from ninja gophers are very welcomed.
Guark is provided under theMIT License.
About
Build awesome Golang desktop apps and beautiful interfaces with Vue.js, React.js, Framework 7, and more...
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.
