A cross-platform app-development module for Go.

Overview

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.

Issues
  • 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'.
    
    
    opened by mar1n3r0 3
  • 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.

    opened by joeblew99 3
  • 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.

    opened by DemonZito 1
  • 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

    opened by DemonZito 1
  • 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.
    opened by DemonZito 1
  • 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.

    opened by DemonZito 1
  • 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.

    opened by Splizard 0
Releases(v0.3.1)
  • v0.3.1(Dec 2, 2020)

  • v0.3.0(Dec 2, 2020)

    After a complete rewrite of the module, I am pleases to announce Qlovaseed v0.3 which is one step closer to a stable API.

    The rewrite has revamped the UI construction to be more functional so that it is easier to copy/paste UI code & no variable names are requried for each seed. The clientside API has been rethought and redesigned to feature function scripts operating on clientside.Values.

    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Feb 14, 2020)

  • v0.2.1(Nov 11, 2019)

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

Google 4.5k Jun 21, 2022
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

Serge Zaitsev 7.3k Jun 29, 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

webview 10.2k Jun 24, 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

Quentin Renard 4.4k Jun 23, 2022
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

Danny 361 Jun 22, 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

vgo 7.6k Jun 23, 2022
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

null 226 Jun 10, 2022
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

Allen Dang 65 Apr 15, 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

Milan Nikolic 364 Jun 13, 2022
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

Mechiel Lukkien 849 Jun 24, 2022
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

Allen Dang 1.4k Jun 22, 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

webview 10.2k Jun 24, 2022
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

Jannis Rieger 1 Mar 5, 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. Inspired by Flutter, React. S

zhuah 106 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

zhuah 106 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

不在乎y 1.6k Jun 28, 2022
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

null 0 Nov 2, 2021
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

Terra Informatica Software, Inc 2.4k Jun 29, 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

Lantern 2.4k Jun 24, 2022