README
¶
Asaka
The Go-native Server-Driven Admin for Laravel Go + PostgreSQL (MySQL and SQLite are experimental) + 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


Why Asaka?
- Your model's hooks and events run when someone edits in the panel: Bind a resource to a Laravel for Go model (
Model: asaka.Model[models.Order]()) and every create, edit, inline edit, delete, bulk delete, soft delete and restore goes throughmodel.Create/model.Update/model.Delete. YourCreating/Updating/Deletinghooks run and yourmodel.Created/Updated/Deletedlisteners fire, just as they do for writes in your own handlers. Integer, UUID and ULID primary keys work. See Models, hooks and events for the writes that do not dispatch events. - 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.
- Single static binary:
go buildproduces one binary with no PHP-FPM, Node runtime, headless Chromium, or Redis required for core features. The author runs it on a small VPS and has seen roughly 30–55 MB of idle RAM there; this is an observation, not something CI measures. - Young, PostgreSQL-first: First public release 2026-12-03. PostgreSQL is the primary target; MySQL and SQLite are experimental (see Status). Includes
asaka:doctorschema checks and theasakatesthelpers. The Playwright E2E suite lives in the separate asaka-demo repository and is not run by this repository's CI. - Built for AI-assisted development: Flat Go struct schemas, fast Go rebuilds, and a 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.
Status and tested databases
Asaka is young: the first public release was on 2026-12-03, so expect rough edges and API changes between minor versions.
What CI runs on every push to main and every pull request:
go vet ./...andgo test -race ./...(unit tests; no database is involved).- Real-database smoke tests (
TestRealDBinasaka/realdb_test.go) against PostgreSQL 16, MySQL 8.4, and SQLite, each in its own job. They mount a panel on a real database and drive it over HTTP: list, search, sort, create, update, delete, soft delete, bulk delete, CSV export, CSV import, and database notifications. They are skipped unlessASAKA_TEST_DRIVERandASAKA_TEST_DSNare set.
Measured coverage: as of 2026-12-05, go test -cover ./asaka/... reports 59.0% of statements for asaka and 97.7% for asaka/asakatest, without a database (the real-database tests are skipped). Treat these as a snapshot, not a guarantee.
Databases
| Database | Status | Notes |
|---|---|---|
| PostgreSQL | Primary target | Smoke tests in CI (PostgreSQL 16). The author's demo and benchmarks run on PostgreSQL 14. |
| MySQL | Experimental | Smoke tests in CI (MySQL 8.4) cover only the features listed above. |
| SQLite | Experimental | Smoke tests in CI cover only the features listed above. |
Known unsupported or untested on MySQL and SQLite. These features are not covered by the smoke tests, and their SQL is still written for PostgreSQL (RETURNING, unnest, to_regclass, ILIKE, NULLS LAST), so expect failures until they are ported and tested:
- Built-in Auth and Profile pages, and opt-in RBAC tables
- Relation managers
- Async CSV export and import jobs
- Query builder
- Dashboard widgets that query your tables and global search (
Cmd+K) - Live-form option creation, drag-and-drop reorder, and restoring soft-deleted rows
- PDF export with search
Running anything beyond the smoke-tested features on MySQL or SQLite is at your own risk. Bug reports with the failing SQL are welcome.
Backup (experimental, opt-in). WithBackupEnabled(true) exposes GET {prefix}/backup.sql.gz, a gzipped data-only INSERT dump of your registered resource tables (no schema, sequences, indexes or other tables). It is not a replacement for pg_dump / mysqldump. With tenancy configured the dump contains only the current tenant's rows and SkipTenant (shared) resources are excluded; with RBAC enabled only the super-admin role can download it. Reads run in one read-only transaction; if anything fails the archive is left truncated and has no -- Asaka backup complete line. Its tests run on SQLite only.
Access control. Export downloads and per-user jobs (panel.StartJob) are visible only to the user and tenant that created them. Users are told apart by WithNotificationRecipient, else RBAC ResolveUserID, else the built-in Auth user; a panel that cannot tell users apart shares them. Uploaded files are public to anyone who has the (unguessable) URL, and fully public if your web server serves public/ directly.
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 viaweb.Stream), and single-binary deployment (go build). - Built for Real Data Volume: Measured once by the author on a VPS running PostgreSQL 14 with 10,000 rows, at up to 1,000 rows per page: ~9 ms LEFT JOIN query, ~11 ms full Dashboard aggregation, ~3.9 ms
Cmd+Kglobal search. These numbers are not produced by CI and are not guaranteed on other hardware or databases. Supports O(log N) Cursor / Keyset Pagination (asaka.PaginationCursor) andCOUNT(*)-freePaginationSimple, plus experimentalDialectMySQLandDialectSQLitedialects. - Zero-External-Daemon 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-drivenlive()reactivity. - Global-Ready RTL & Custom i18n: First-class RTL layout (
Panel.WithRTL(true)+ header LTR/RTL toggle), built-inen/ja/ardictionaries, 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",
Model: asaka.Model[models.Order](), // the table, key and timestamps come from the model
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"),
},
}
}
Approvals with workflows
A row action can resume a Laravel for Go workflow that waits for a decision (v0.16+):
RowActions: []asaka.Action{
asaka.ResumeAction("approve", "Approve",
func(rec map[string]any) workflow.Token[workflows.Decision] {
return workflows.DecisionFor(asaka.RecordInt(rec, "id"))
},
workflows.Approved,
).WithTone("emerald").WithConfirm("Approve this order?").
WithAuthorize(func(r *web.Request, rec map[string]any) bool { return canApprove(r) }),
},
The button appears on the record's View and Edit pages only while a run waits for that token. Pressing it checks the tenant, the record policy, Authorize and that the run still waits, then calls workflow.Resume. Wait for each token once in your workflow (or put run.ID() in it): with an asynchronous queue, two quick presses can deliver two values. Production needs workflow.CreateTables in a migration and a queue worker.
Models, hooks and events
Model: asaka.Model[models.Order]() binds a resource to a Laravel for Go model. The table name, primary key type and timestamps are read from the struct, so Table can be left out (if you set it and it differs, Register panics). Without Model, a resource keeps writing with plain SQL, exactly as before.
| Panel action | With Model |
Hook | Event |
|---|---|---|---|
| Create | model.Create |
Creating |
model.Created |
| Edit, inline edit | model.Update (only changed columns) |
Updating |
model.Updated (none when nothing changed) |
| Delete, bulk delete | model.Delete, one transaction for the bulk delete |
Deleting |
model.Deleted for each row |
| Soft delete, restore | model.Update on deleted_at |
Updating |
model.Updated (not Deleted) |
| Force delete | model.Delete |
Deleting |
model.Deleted |
| CSV import (sync and async) | model.Create per row |
Creating |
none by default; set ImportDispatchesEvents: true to dispatch Created |
| Drag-and-drop reordering | plain SQL | none | none |
| Relation manager create, edit, attach | plain SQL | none | none |
| Row and bulk actions | your own function | whatever it calls | whatever it calls |
- Only the columns declared in the resource's
Fieldsare written, plus the tenant column. Form values are converted to the struct's field types (date.Date,numeric.Decimal,uuid.UUID,db.JSON[T], pointers for nullable columns); a value that does not convert is a validation error on that field. - Columns of the model that are not in
Fieldsare written bymodel.Createas the struct's zero value (that is how the framework creates models). Tag columns that should keep their database defaultdb:",default", or make them pointers. - A hook that returns an error stops the write. The panel shows the error above the form (HTTP 422), unless the error has a
StatusCode() intmethod, which then decides the status. - The tenant scope and the record lookup are one query (
model.Query[T]().WhereEq(tenantColumn, tenant).Find(ctx, id)), so another tenant's id is a 404 on the model path too. Per-record policies run as before. - With
EnableActivityLog, edits, deletes and restores write the activity log in the same transaction as the change. If youractivity_logstable has achangescolumn (text or JSON), each entry also stores the changed columns with their old and new values (updated_atis left out). - Primary keys: integer keys work everywhere. UUID (
uuid.UUID) and string keys (db:",uuid",db:",ulid") work for the list, view, create, edit, delete, bulk delete, soft delete, restore and cursor pagination. On those resourcesRegisterpanics if you also use theint64-basedHooks(AfterCreate,BeforeUpdate,AfterUpdate,BeforeDelete,AfterDelete),RowActions,BulkActions,RelationsorReorderColumn; use the model's hooks and events instead. - The key column must be named
id(the framework's default for theIDfield). asaka:doctorlists the resources without aModelas information, not as errors.
Register resources (with optional auth guard, opt-in RBAC, SQLite dialect, and multi-tenant scoping):
p := asaka.New("Asaka", "/admin").
WithAuthGuard(requireAuth). // or .WithAuth(asaka.AuthConfig{...}); Mount panics without one of them
// Optional: .WithTenantScope("tenant_id", resolveTenant)
// Optional: .WithPDFRenderer(customPDFRenderer)
// Optional: .WithNotificationRecipient(func(r *web.Request) string { ... })
// 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(),
)
p.Mount(route)
Mount panics unless the panel has WithAuthGuard(...) or an enabled WithAuth(...). For demos and local development only, WithoutAuth() mounts the panel publicly (every route, including CRUD, import, bulk delete, uploads and backup, is open to anyone).
Prerequisites
- Go 1.27+
- Node.js 22+
- PostgreSQL (MySQL and SQLite are experimental, see Status)
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
- Enable class-based dark mode in
resources/css/app.css:
@custom-variant dark (&:where(.dark, .dark *));
- Build the panel and list it in
Packagesinbootstrap/app.go:
import "github.com/qalainau/asaka/asaka"
func Options() laravel.Options {
return laravel.Options{
Packages: []laravel.Package{
asaka.Package(admin.NewPanel()), // several panels: asaka.Package(admin.NewPanel(), ops.NewPanel())
},
// ...
}
}
// admin/panel.go
func NewPanel() *asaka.Panel {
return asaka.New("Admin", "/admin").
WithAuthGuard(requireAuth). // or .WithAuth(asaka.AuthConfig{...})
Register(OrdersResource())
}
The package mounts the panel's routes, adds the migrations of Asaka's own tables (asaka_notifications, asaka_roles, asaka_user_roles) and the asaka:doctor command. If there is no panel, two panels share a prefix, a panel has no access control, or a public (WithoutAuth()) panel is listed before a guarded one, the application refuses to start with an error naming the problem. A resource whose Model the panel cannot serve still panics in Panel.Register, when the panel is built.
activity_logs stays your application's table: create it in your own migration (columns id, resource_slug, record_id, action, summary, created_at, and optionally changes).
If you mounted the panel inside a route group with extra middleware (an IP allowlist, your own auth) and used WithoutAuth() because the group protected it, the package path does not have that group: give the panel its own guard (WithAuthGuard) before you switch.
- Run
laravel migrate(the migrations skip Asaka tables that already exist), build your frontend assets (npm run buildornpm run dev) and open/admin.
The older way still works: call panel.Mount(route) in routes/web.go instead of listing the package (asaka install --mount prints those steps). Mount panics where the package returns an error, and creates its tables at runtime.
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 bycmd/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
|