Framework g-sui pour Go

VérifiéSûr

Framework d'interface utilisateur en Go avec rendu côté serveur. Génère tout le HTML sur le serveur et gère l'interactivité via des actions de serveur et des correctifs WebSocket. Utile pour créer des applications web dynamiques en Go sans nécessiter de JavaScript côté client.

Spar Skills Guide Bot
DeveloppementIntermédiaire
10002/06/2026
Claude Code
#go#server-rendered#ui-framework#websocket#components

Recommandé pour

Notre avis

Framework UI rendu côté serveur pour Go, générant tout le HTML et la logique métier côté serveur avec interactivité via actions serveur et WebSocket.

Points forts

  • Rendu entièrement côté serveur simplifiant le déploiement
  • Composants sous forme de fonctions Go retournant des chaînes HTML
  • Interactivité via actions serveur et mises à jour WebSocket en temps réel
  • Support intégré pour formulaires, tables et export Excel

Limites

  • Nécessite une bonne connaissance de Go
  • Écosystème limité par rapport aux frameworks JavaScript
  • Lourdeur potentielle pour une application très interactive côté client
Quand l'utiliser

Lorsque vous développez une application web Go où le rendu serveur et les mises à jour en temps réel sont prioritaires.

Quand l'éviter

Si vous avez besoin d'une interface utilisateur riche côté client ou si votre équipe maîtrise mieux les frameworks JavaScript.

Analyse de sécurité

Sûr
Score qualité88/100

The skill describes a legitimate Go UI framework with no destructive or exfiltrating instructions. It uses allowed tools like Bash for development commands (go test, deploy), but only in a standard development context.

Aucun point d'attention détecté

Exemples

Create a new page with g-sui
Create a new g-sui page at the route '/about' that displays a simple about section with a title and description, using the ui.Div and ui.HTML helpers.
Handle form submission with server action
In a g-sui app, implement a form with a text input and a submit button. When submitted, the server action should return a thank-you message using ui.Alert.
Set up WebSocket real-time update
Using g-sui, set up a page that displays a live counter updated via WebSocket. The server should broadcast the current count every second.

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

| Topic | File | Description | |-------|------|-------------| | Core Concepts | CORE.md | Architecture, Context, Actions, Targets, server rendering | | UI Components | COMPONENTS.md | Buttons, inputs, forms, tables, alerts, cards, tabs, etc. | | Data Management | DATA.md | Data collation, search, sort, filter, pagination, Excel export | | Server Setup | SERVER.md | App initialization, routes, WebSocket, PWA, assets | | Best Practices | PATTERNS.md | Testing, 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.

Skills similaires