Back to list
michalCapo

g-sui

by michalCapo

Server‑rendered UI for Go: interactive pages with server actions and DOM/WebSocket patches—no frontend framework

2🍴 0📅 Jan 24, 2026

SKILL.md


name: g-sui description: Server-rendered Go UI framework. Use when building g-sui applications, creating UI components, handling forms with server actions, using data tables, setting up routes, or implementing WebSocket patches. Triggered by "g-sui", "server-rendered UI", "Go UI framework", form handling, or data collation. allowed-tools: Read, Grep, Glob, Bash, Edit, Write

g-sui Framework

Server-rendered UI framework for Go. All HTML generation, business logic, and state management occur on the server. Interactivity achieved through server actions and WebSocket patches.

Quick Start

package main

import "github.com/michalCapo/g-sui/ui"

func main() {
    app := ui.MakeApp("en")

    app.Page("/", func(ctx *ui.Context) string {
        return app.HTML("Home", "bg-gray-100",
            ui.Div("p-8")(
                ui.Div("text-2xl font-bold")("Hello World"),
            ),
        )
    })

    app.Listen(":8080")
}

Documentation Index

TopicFileDescription
Core ConceptsCORE.mdArchitecture, Context, Actions, Targets, server rendering
UI ComponentsCOMPONENTS.mdButtons, inputs, forms, tables, alerts, cards, tabs, etc.
Data ManagementDATA.mdData collation, search, sort, filter, pagination, Excel export
Server SetupSERVER.mdApp initialization, routes, WebSocket, PWA, assets
Best PracticesPATTERNS.mdTesting, validation, security, state management

Core Philosophy

  1. Server-Centric Rendering - All HTML generated server-side as strings
  2. String-Based Components - Components are Go functions returning HTML strings
  3. Action-Based Interactivity - User interactions trigger server handlers returning HTML
  4. WebSocket-Enhanced - Real-time updates via /__ws endpoint

Key Types

type Callable = func(*ui.Context) string  // All handlers return HTML
type Attr struct { ID, Class, Value, OnClick, OnSubmit, ... }  // HTML attributes

Common Imports

import "github.com/michalCapo/g-sui/ui"

Development Commands

go run examples/main.go      # Run example app
go test ./...                # Run all tests
go test ./ui/...             # Test UI package
go build                     # Build project
./deploy                     # Create and push new version tag

Releases

To create a new version release:

./deploy

The deploy script automatically:

  • Starts at version v0.100 if no tags exist
  • Increments the minor version by 1 (e.g., v0.100v0.101v0.102)
  • Ensures working tree is clean before tagging
  • Creates an annotated git tag and pushes to remote

Version numbering: v0.XXX format, auto-incremented from v0.100.

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon