A cross-platform app-development module for Go.

logo Godoc Go Report Card Build Status

The cross-platform Go module for building apps (pronounced klo-va-seed).

Usecases

As a lightweight alternative to Electron
Write your frontend and native code in Go, distribute native binaries of your app. Supported on Windows, Mac & Linux. Mobile support planned.

Full-stack progressive webapp
Write the complete app in Go, place binaries on public-facing web servers. Access these apps on Windows, Mac, Linux, IOS & Android.

As a lightweight alternative to Phonegap (WIP linux-only)
Write your app in Go, export the frontend as a native app. Android-only. IOS support planned.

Examples

showcase

Getting started

Create HelloWorld.go file and paste in the following contents:

package main

import "qlova.org/seed/new/app"

func main() {
	app.New("Hello World").Launch()
}

In the same folder, run 'go mod init .' to initialise the project and then 'go build' to create an executable for the app, run this to launch the app. By default, Qlovaseed will start a WebServer and open a browser window displaying your app.

Core Concepts

Qlovaseed is a full-stack cross-platform application-development framework.
This means that Apps created with Qlovaseed under the hood feature both a client and server component.

Qlovaseed aims to blur the client-server distinction, the app is written as a whole, in Go. Then communication is achieved with 'client' and 'clientside' packages.

Javascript and http.Handlers are managed by the framework.

This is a clientside pattern that changes the text of the button on the client-side.

    var Text = new(clientside.String)

    button.New(
        text.SetTo(Text),

        client.OnClick(Text.Set("You Clicked me")),
    )

This is client handler that changes the text of the button from the server.

	var Text = new(clientside.String)

    button.New(
        text.SetTo(Text),

        client.OnClick(client.Go(func() client.Script {
            return Text.Set("You Clicked me")
        }),
    )

Given an App, by default Qlovaseed will create a web server, manage the handlers, HTML, JS & CSS. All these resources are pre-rendered by Qlovaseed. Then the app will be launched on the local web browser in kiosk mode (if available).
Alternatively, the app can be placed on a remote server and proxied through a webserver with automatic HTTPS (such as Caddy).
This will serve the app as a Lighthouse-compliant progressive WebApp.

Full App example.

package main

import (
	"image/color"

	"qlova.org/seed/client"
	"qlova.org/seed/client/clientside"

	//Import a seed to use it, a list of seeds can be found [here](https://github.com/qlova/seed/tree/master/new).
	"qlova.org/seed/new/app"
	"qlova.org/seed/new/button"
	"qlova.org/seed/new/text"

	"qlova.org/seed/set"
)

func main() {
	var Text1 = &clientside.String{Value: "My callback runs on the client"}
	var Text2 = &clientside.String{Value: "My callback runs on the server"}

	app.New("My App",
		button.New(
			text.SetStringTo(Text1),

			client.OnClick(Text1.Set("You Clicked me")),
		),

		button.New(
			text.SetStringTo(Text2),

			set.Color(color.RGBA{100, 100, 0, 255}),

			client.OnClick(client.Go(func() client.Script {
				return Text2.Set("You Clicked me")
			})),
		),
	).Launch()
}

This example shows a quick glimpse on how powerful Qlovaseed is.

Project folder structure

For larger apps, it is a good idea to seperate the ui from the business logic. The recomended folder structure is:

    domain (business logic)
    |
    ├───── main (main package that launches the app)
    |      └─── main.go
    |
    ├───── ui (pages & popups)
    |      ├─ new (place custom seed packages in here)
    |      |  └─── customseed
    |      |        └──────── customseed.go
    |      |
    |      ├─ user (global clientside state)
    |      |  └─── user.go
    |      |
    |      ├─ style (styles for your seeds)
    |      |  └─── styles.go
    |      |
    |      └─ page.Home.go
    |
    └───── domain.go

Styles

All seeds can be styled with methods from the set package.

import "color"
import "qlova.org/seed/set"
import "qlova.org/seed/new/text"
import "qlova.org/seed/use/css/units/rem"

text.New(set.Color(color.RGBA{100, 0, 0, 255}),
    set.Margin(rem.One, rem.One),

    text.Set("Some stylable text"),
)

HTML/CSS/JS

The use of raw HTML, CSS and Javascript to build apps is discouraged. However, there may be good reasons to use these technologies to extend functionality or to create new seeds.

  • Seeds have a html.Set option for setting raw HTML.
  • When in doubt, css.Set can be used to set css styles with strings,
  • js.Bundle is useful for embedding Javascript and CSS files. Checkout the gallery seed.

Contributing

If you are missing a minor feature (such as a standard javascript wrapper, a css unit or the like) and decide to implement it please create a pull request so that the feature can be added into the framework.

Community

There is a reddit community: /r/Qlovaseed. You can also ask questions on the Github Discussions page.

Please remember, this framework is in development, it does not have a stable API and features are currently implemented as needed.

License
This work is subject to the terms of the Qlova Public License, Version 2.0. If a copy of the QPL was not distributed with this work, You can obtain one at https://license.qlova.org/v2

The QPL is similar to the MPL except it tracks modifications at the Go package level instead at the file level and you must release changes you make to the packages in this module if you distribute/host an app with a modified version of Qlovaseed. The intent is to keep the Qlovaseed module open but allows you to import and use the framework inside a proprietary app.

The QPL is compatible with the AGPL which is why both licenses are provided within this repository.

Comments
  • go build - Checksum mismatch

    go build - Checksum mismatch

    Hi and congrats for the efforts put into this project. The get started information is a bit scarce so here is where I stumbled trying the helloworld example.

    go build
    verifying github.com/qlova/[email protected]/go.mod: checksum mismatch
            downloaded: h1:5/vqbyAknPhFNKQC7fCMULFxBEd90EJ7cLD/OqfNHzQ=
            sum.golang.org: h1:QHqOYVlyNabZtQY04si4L7VKgej3kVQNPf0aPv+I4Ws=
    
    SECURITY ERROR
    This download does NOT match the one reported by the checksum server.
    The bits may have been replaced on the origin server, or an attacker may
    have intercepted the download attempt.
    
    For more information, see 'go help module-auth'.
    
    
  • Webview

    Webview

    was looking here: https://github.com/qlova/seed/blob/master/launch.go#L10

    Its great that your are looking for so many places where it coudl be installed. Keep this.

    But also you can use the zserve lib to have embedded. THen the app does not have all the menu crapola :)

    Also you DONT need to OPEN a tcp port !! It can do direct messaging from web to go.

    https://github.com/zserge/webview

    https://github.com/zserge/webview/tree/webview-x

    • this one is new and shakey but will support Windows Edge soon.

    Happy to collaborate on this. i like your framework. Its pretty nice archi.

  • Added date constraints for datebox

    Added date constraints for datebox

    Added new seed options for the datebox seed that constrains min and max date ranges. This is useful for cases where you want to prevent the user from selecting a date in the past, or selecting a date too far in the future.

  • Add styling options for markdown

    Add styling options for markdown

    • A markdown seed can be added with markdown.New but has no styling.
    • Allow developers to add their own css styling.

    Example, H1 and H2 are currently rendered as this:

    image

  • Added reading holidays from JSON and basic mobile support

    Added reading holidays from JSON and basic mobile support

    Description

    • Popular holidays will be read from the supplied JSON file instead of hardcoded. I want to get this to the point where the data will never need to be manually updated again and instead automatically generated from JSON data to save time.
    • Rudimentary mobile support added. The app will now resize its elements accordingly.
  • Added dating app example

    Added dating app example

    Description

    I've added an example application - a simple date tracking app where you can view popular upcoming dates (e.g. Christmas) or create your own. It demonstrates styling, page flow, event handling and data caching. I also added support for the HTML timebox widget.

    As this example is a complete application, it will give developers a better understanding and greater confidence to build their own apps. It can also be used as a starting point for their projects.

    Status

    This is a finished example, however I will continue iterating upon it with further pull requests.

  • Use async API where possible.

    Use async API where possible.

    Promises are really messy. The script Promises are even worse. Need to make all scripts async so that q.Go(...).Wait() can be called returning a dynamic script Value.

An experimental Go cross platform UI library.

GXUI - A Go cross platform UI library. Notice: Unfortunately due to a shortage of hours in a day, GXUI is no longer maintained. If you're looking for

Jan 6, 2023
Build cross-platform modern desktop apps in Go + HTML5
Build cross-platform modern desktop apps in Go + HTML5

Lorca A very small library to build modern HTML5 desktop apps in Go. It uses Chrome browser as a UI layer. Unlike Electron it doesn't bundle Chrome in

Jan 6, 2023
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

Dec 28, 2022
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)

Thanks to go-astilectron build cross platform GUI apps with GO and HTML/JS/CSS. It is the official GO bindings of astilectron and is powered by Electr

Jan 9, 2023
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)

gowd Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs) How to use this library: Download and install nwjs Install this library g

Dec 11, 2022
RobotGo, Go Native cross-platform GUI automation @vcaesar

Robotgo Golang Desktop Automation. Control the mouse, keyboard, bitmap, read the screen, Window Handle and global event listener. RobotGo supports Mac

Jan 7, 2023
Cross-platform Go library to place an icon in the host operating system's taskbar.

trayhost Package trayhost is a cross-platform Go library to place an icon in the host operating system's taskbar. Platform Support macOS - Fully imple

Nov 6, 2022
Cross-platform GUI for go is never this easy and clean.
Cross-platform GUI for go is never this easy and clean.

gimu Strongly suggest NOT to use this project anymore, the auto-generated cgo wrapper of Nuklear has a random crash issue which is hard to fix (becaus

Jul 12, 2022
Go cross-platform library for displaying dialogs and input boxes

dlgs dlgs is a cross-platform library for displaying dialogs and input boxes. Installation go get -u github.com/gen2brain/dlgs Documentation Document

Dec 24, 2022
pure go, cross-platform, MIT-licensed ui toolkit for developers
pure go, cross-platform, MIT-licensed ui toolkit for developers

duit - developer ui toolkit WARNING: this library is work in progress. backwards incompatible changes will be made. details duit is a pure go (*), cro

Dec 24, 2022
Cross platform rapid GUI framework for golang based on Dear ImGui.
Cross platform rapid GUI framework for golang based on Dear ImGui.

giu Cross platform rapid GUI framework for golang based on Dear ImGui and the great golang binding imgui-go. Any contribution (features, widgets, tuto

Dec 28, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

Jan 1, 2023
Cross-Platform GUI Framework for Go

⚠️ I'm currently working on this project as part of my master's thesis at the Berlin University of Applied Sciences and Technology. It is under active

Oct 31, 2022
Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase
Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase. Inspired by Flutter, React. S

Apr 18, 2022
UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase
 UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

Apr 18, 2022
Cross-platform Go/Golang GUI library.

中文 | English GoVCL Cross-platform Golang GUI library, The core binding is liblcl, a common cross-platform GUI library created by Lazarus. GoVCL is a n

Dec 30, 2022
Built Virtual Operating System and integrated application like calculator, gallery app , weather app, and text editor.
Built Virtual Operating System and integrated application like calculator, gallery app , weather app, and text editor.

Virtual Operating System Built Virtual Operating System and integrated application like calculator, gallery app , weather app, and text editor. Langua

Nov 2, 2021
Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development
Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development

Go bindings for Sciter Check this page for other language bindings (Delphi / D / Go / .NET / Python / Rust). Attention The ownership of project is tra

Dec 23, 2022
a cross platfrom Go library to place an icon and menu in the notification area

systray is a cross-platform Go library to place an icon and menu in the notification area. Features Supported on Windows, macOS, and Linux Menu items

Dec 27, 2022