Framework g-sui pour Go

VérifiéSûr

Framework d'interface utilisateur rendu côté serveur pour Go. Génère HTML côté serveur avec interactivité via actions serveur et WebSocket.

Spar Skills Guide Bot
DeveloppementIntermédiaire
3002/06/2026
Claude Code
#go#server-rendered-ui#web-framework#golang

Recommandé pour

Notre avis

g-sui est un framework UI rendu côté serveur pour Go, générant du HTML sur le serveur et utilisant des actions serveur et WebSocket pour l'interactivité.

Points forts

  • Rendu côté serveur simplifiant la gestion d'état
  • Composants sous forme de fonctions Go retournant des chaînes HTML, faciles à composer
  • Mises à jour en temps réel via WebSocket
  • Actions serveur pour gérer les interactions utilisateur

Limites

  • Interactivité côté client limitée par rapport aux frameworks JavaScript
  • Courbe d'apprentissage pour les développeurs Go non familiers avec les UI rendues côté serveur
  • Documentation répartie dans plusieurs fichiers non inclus ici
Quand l'utiliser

Utilisez g-sui pour des applications web Go nécessitant un rendu serveur et des mises à jour en temps réel sans code client complexe.

Quand l'éviter

Évitez g-sui si vous avez besoin d'une interactivité client riche ou d'un framework JavaScript lourd.

Analyse de sécurité

Sûr
Score qualité85/100

The skill provides documentation and development commands for a Go UI framework. No destructive, exfiltrating, or obfuscated actions are present. Usage of Bash is for standard build/test commands.

Aucun point d'attention détecté

Exemples

Create a form with server action
Create a g-sui page with a form that submits a server action and displays the result.
Set up WebSocket for real-time updates
Set up a g-sui application with WebSocket for real-time data updates.
Build a data table with sorting and pagination
Build a data table with sorting and pagination using g-sui's data collation features.

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