asaka

module
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2026 License: MIT

README

Asaka

CI Go Reference

The Go-native Server-Driven Admin for Laravel Go + PostgreSQL / MySQL / SQLite + Inertia v3 + React.

Built for Go from day one — not ported from PHP abstractions. Declare a resource once as a plain Go struct and ship a single ~55 MB binary with goroutine-parallel dashboard widgets, O(1) constant-memory streaming CSV, zero-dependency native PDF export, real-time SSE notifications, and drop-in React extensibility.

Live Demo (10,000 PostgreSQL rows) · Website & Docs

Asaka Dashboard

Asaka Orders Table

Why Asaka?

  • Built for Go, not ported from PHP: No trait hierarchies, magic containers, or Livewire compatibility layers — just plain, type-safe Go structs you can read in minutes.
  • Runs comfortably on a $5 VPS (512 MB RAM): Single static binary (go build), ~30–55 MB idle RAM, zero PHP-FPM / Node runtime / headless Chromium / Redis required for core features.
  • Ready in production today: Ships with PostgreSQL, MySQL, and SQLite dialects, live demos on 10,000 rows, asaka:doctor schema checks, and asakatest + Playwright E2E coverage.
  • Built for AI-assisted development: Flat Go struct schemas + 0.36 s Go rebuilds + bundled Agent Skill (.agents/skills/asaka) let coding agents scaffold complete resources accurately.
  • Drop-in React ecosystem: Declare 90% of your admin in Go, and plug any React component (shadcn/ui, TanStack, Recharts, WarpUI) into fields, widgets, or custom pages in 10 lines via registerAsakaField / registerAsakaWidget.

Highlights

  • Go-Native Superpowers: Built-in asaka.RuntimeWidget() (live heap RAM, goroutines, GC pause, uptime at 0 ms SQL cost), concurrent goroutine widget resolution, O(1) constant-memory streaming CSV export (up to 50k rows via web.Stream), and single-binary deployment (go build).
  • Built for Real Data Volume (PostgreSQL / MySQL / SQLite): Tested with 10,000 PostgreSQL rows and up to 1,000 rows per page (~9 ms LEFT JOIN query, ~11 ms full Dashboard aggregation, ~3.9 ms Cmd+K global search on a standard VPS). Supports O(log N) Cursor / Keyset Pagination (asaka.PaginationCursor) and COUNT(*)-free PaginationSimple, plus DialectMySQL and DialectSQLite (zero-dependency single-binary + SQLite admin).
  • Zero-External-Daemon Production Stack: Real-time SSE Notifications (EventSource, no polling/Redis required), Native PDF 1.4 Export (table reports & single-record sheets with optional TrueType CJK/UTF-8 embedding, no Chromium/wkhtmltopdf), column-mapped async CSV imports (SAVEPOINTs), built-in Auth/Profile, opt-in RBAC, per-record Policy, Multi-Panel, and Multi-Tenancy UI.
  • Declarative Schema & All 20 Form Fields: Familiar declarative model if you know Filament — CRUD tables, dedicated Create/View (Infolists)/Edit pages, Action Modals & Slide-Overs, Soft Deletes, Relation Managers, Clusters, all 20 form fields (Builder, Repeater, FileUpload, RichEditor, MarkdownEditor, CodeEditor, CustomField, etc.), and server-driven live() reactivity.
  • Global-Ready RTL & Custom i18n: First-class RTL layout (Panel.WithRTL(true) + header LTR/RTL toggle), built-in en / ja / ar dictionaries, and server-side translation overrides.
  • Drop-in React Extensibility: Register any custom React field (registerAsakaField) or dashboard widget (registerAsakaWidget) in 10 lines without touching Asaka core.

Defining a Resource

func OrdersResource() *asaka.Resource {
	statuses := []asaka.Option{
		{Value: "pending", Label: "Pending", Color: "amber"},
		{Value: "processing", Label: "Processing", Color: "sky"},
		{Value: "shipped", Label: "Shipped", Color: "indigo"},
		{Value: "completed", Label: "Completed", Color: "emerald"},
		{Value: "cancelled", Label: "Cancelled", Color: "rose"},
	}

	return &asaka.Resource{
		Slug:          "orders",
		Table:         "orders",
		Label:         "Orders",
		SingularLabel: "Order",
		Icon:          "shopping-cart",
		Group:         "Sales & Operations",
		PerPage:       25,
		Columns: []asaka.Column{
			asaka.TextColumn("order_number", "Order #").MakeSortable().MakeSearchable(),
			asaka.BelongsToColumn("customer_id", "Customer", "customers", "company_name").MakeSortable().MakeSearchable(),
			asaka.TextColumn("item_summary", "Line Item").MakeSearchable(),
			asaka.BadgeColumn("status", "Status", statuses).MakeSortable(),
			asaka.MoneyColumn("amount", "Amount").MakeSortable().MakeEditable(),
			asaka.DateColumn("due_date", "Due Date").MakeSortable().MakeEditable(),
		},
		Filters: []asaka.Filter{
			asaka.SelectFilter("status", "Status", statuses),
		},
		Fields: []asaka.Field{
			asaka.TextInput("order_number", "Order Number").MakeRequired().MakeUnique().InSection("Order Information"),
			asaka.BelongsToSelect("customer_id", "Customer", "customers", "company_name").MakeRequired().InSection("Order Information"),
			asaka.TextInput("item_summary", "Line Item").MakeRequired().InSection("Order Information"),
			asaka.SelectInput("status", "Status", statuses).MakeRequired().InSection("Order Information"),
			asaka.NumberInput("amount", "Amount (USD)").MakeRequired().WithMin(1).InSection("Schedule & Notes"),
			asaka.DateInput("due_date", "Due Date").InSection("Schedule & Notes"),
			asaka.TextareaInput("notes", "Delivery Notes").InSection("Schedule & Notes"),
		},
	}
}

Register resources (with optional auth guard, opt-in RBAC, SQLite dialect, and multi-tenant scoping):

p := asaka.New("Asaka", "/admin").
	// Optional: .WithRBAC(asaka.RBACConfig{Enabled: true, RegisterRolesResource: true})
	// Optional: .WithRTL(true)
	// Optional: .WithLocale("ar").WithTranslations("fr", map[string]string{"dashboard": "Tableau de bord"})
	// Optional: .WithDialect(asaka.DialectMySQL) // or asaka.DialectSQLite
	// Optional: .WithPDFFontFile("/path/to/NotoSansJP-Regular.ttf") // or .WithPDFFont(ttfBytes) for UTF-8/CJK PDFs
	Register(
		OrdersResource(),
		CustomersResource(),
	)
// Optional: p.Guard = requireAuth
// Optional: p.TenantColumn = "tenant_id"; p.TenantResolver = resolveTenant
// Optional: p.PDFRenderer = customPDFRenderer
p.Mount(route)

Prerequisites

  • Go 1.27+
  • Node.js 22+
  • PostgreSQL

Quick Start

A. Add to an existing Laravel Go app
go get github.com/qalainau/asaka
go run github.com/qalainau/asaka/cmd/asaka install
npm install lucide-react
  1. Enable class-based dark mode in resources/css/app.css:
@custom-variant dark (&:where(.dark, .dark *));
  1. Register your resources and mount the panel in routes/web.go:
import "github.com/qalainau/asaka/asaka"

asaka.New("Admin", "/admin").Register(
	OrdersResource(),
).Mount(route)
  1. Build your frontend assets (npm run build or npm run dev) and open /admin.

Pass --force to asaka install to overwrite existing UI files when upgrading.

CLI Generators & Schema Doctor
go run github.com/qalainau/asaka/cmd/asaka install --force
go run github.com/qalainau/asaka/cmd/asaka make:resource Invoice
go run github.com/qalainau/asaka/cmd/asaka make:resource Invoice --from-db --table=invoices
go run github.com/qalainau/asaka/cmd/asaka make:page GeneralSettings
go run github.com/qalainau/asaka/cmd/asaka make:widget RevenueTrend --type=chart
go run github.com/qalainau/asaka/cmd/asaka make:relation-manager Customer Order

# Verify all registered resources against your live PostgreSQL schema
go run . asaka:doctor
B. Try the standalone 10,000-row demo locally

The full runnable demo application (10,000 PostgreSQL rows, Dashboard, Orders, Customers, Activity Logs, CSV/PDF exports, SSE notifications, and Playwright E2E suite) lives in its own repository: qalainau/asaka-demo.

git clone https://github.com/qalainau/asaka-demo.git
cd asaka-demo
cp .env.example .env
# Point DATABASE_URL in .env to your PostgreSQL database

npm install && npm run build
go run . migrate --seed
go run .

Open http://127.0.0.1:8000/admin.

Testing

# Go unit tests, asakatest helpers, CLI tests, and embedded stub verification
go test -race ./...

Use github.com/qalainau/asaka/asaka/asakatest to assert panel registration, route wiring, and policy enforcement in Go tests without booting a full server.

Project Structure

  • asaka/ — Core server-driven panel package (schema, CRUD/JOIN/inline handlers, global search, dashboard metrics, policy/guard, RBAC, multi-tenant scoping, native PDF/CSV exports, SSE notifications, unit tests).
  • asaka/asakatest/ — Testing helpers for asserting panel registration, routes, and policies.
  • asaka/stubs/ — Embedded React/TypeScript UI stubs installed by cmd/asaka install.
  • cmd/asaka/ — CLI installer & code generators (install, make:resource, make:page, make:widget, make:relation-manager).
  • .agents/skills/asaka/ — Official Agent Skill for AI coding assistants.

License

MIT


Built in Asaka, Japan.

Directories

Path Synopsis
Package asaka provides a Filament-inspired, server-driven admin panel framework for Laravel Go (go.laravel.com) + PostgreSQL/MySQL/SQLite + Inertia v3 + React.
Package asaka provides a Filament-inspired, server-driven admin panel framework for Laravel Go (go.laravel.com) + PostgreSQL/MySQL/SQLite + Inertia v3 + React.
cmd
asaka command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL