asaka

module
v0.11.3 Latest Latest
Warning

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

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

README

Asaka

CI Go Reference

A server-driven admin panel framework for Laravel Go + PostgreSQL + Inertia v3 + React.

Declare a resource once in Go — get a complete, blazing-fast admin panel with live Dashboard charts, Cmd+K global search, BelongsTo relations, inline cell editing, sectioned modals, relation manager tabs, authorization policies, multi-tenant scoping, and EN/JA i18n — without writing per-resource React.

Live Demo (10,000 PostgreSQL rows + Pro views preview)

Asaka Dashboard

Asaka Orders Table

Highlights

  • Full Filament Parity in Go: Declare a resource once in Go (asaka.Resource) and get CRUD tables, dedicated Create / View (Infolists) / Edit pages, Action Modal & Slide-Over Forms, List Page Tabs, Soft Deletes (Restore / Force Delete), Row Reordering, CRUD & Many-to-Many Relation Managers, Pluggable Widgets, Custom Pages & Clusters, Real-time SSE + Database Notifications, Async CSV Import/Export, Built-in Auth & Profile, Opt-in RBAC, Multi-Panel, and Multi-Tenancy UI.
  • All 20 Filament Form Fields + Layouts + Reactivity: Complete 20-field catalog (Builder, Repeater, FileUpload, RichEditor, MarkdownEditor, CodeEditor, ColorPicker, Slider, Tags, KeyValue, ToggleButtons, CustomField, etc.), Wizard / Split / Fieldset / Tabs / Collapsible Section / Callout, plus server-driven live() reactivity and async BelongsToSelect with CreateOptionForm.
  • Real-Time SSE Notifications, Async CSV & Native PDF Exports: Live toast & bell-drawer delivery over GET {prefix}/notifications/stream (EventSource), background CSV exports (up to 100k rows) with downloadable notification links, column-mapped async CSV imports (up to 50k rows) using per-row SAVEPOINTs, plus built-in Native PDF Export (GET {prefix}/{slug}/export.pdf table reports & GET {prefix}/{slug}/{id}/pdf single-record detail sheets) with zero-config PDF 1.4 generation, optional TrueType font embedding (Panel.WithPDFFont(ttfBytes) / Panel.WithPDFFontFile(path)) for full Japanese/CJK/UTF-8 output, and a Panel.PDFRenderer hook.
  • 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 (Resource.PaginationMode = asaka.PaginationCursor) and COUNT(*)-free PaginationSimple for deep tables, plus Panel.WithDialect(asaka.DialectMySQL) and Panel.WithDialect(asaka.DialectSQLite).
  • 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 via Panel.WithLocale(...), Panel.WithTranslations(...), and Panel.WithLabelTranslations(...).
  • Production foundations: Panel-level Guard & built-in Auth, opt-in RBAC (Panel.WithRBAC(...), default OFF / zero overhead), per-resource & per-record Policy, lifecycle Hooks, automatic multi-tenant scoping + Tenant Switcher UI, asaka make:resource --from-db PostgreSQL introspection, asaka:doctor schema verification, and asakatest + Playwright E2E smoke tests.
  • Go-native superpowers: Built-in asaka.RuntimeWidget() (live heap RAM, goroutines, GC pause, uptime in 0ms 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).

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