gomyadmin

module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT

README

GoMyAdmin

Generate a commit-friendly admin panel for existing Go + PostgreSQL apps.

GoMyAdmin gives you a small CLI, a Go resource API, PostgreSQL introspection, and a Next.js backoffice template. The generated code is meant to be read, committed, customized, and deployed with your application.

PostgreSQL CI

GoMyAdmin CLI demo
GoMyAdmin admin UI screenshot

Why

Most Go teams eventually need an internal admin panel for users, billing, support, content, operations, or CRM data.

You can hand-write it, wire a low-code tool into production, or adopt a framework that hides too much. GoMyAdmin takes a narrower path:

PostgreSQL schema -> resource definitions in Go -> generated admin API + Next.js UI

The output is explicit Go, SQL, and TypeScript. There is no runtime model magic and no requirement to replace your router, ORM, auth, or deployment flow.

Quick Start

go install github.com/darwvin-dev/gomyadmin/cmd/gomyadmin@latest

gomyadmin demo my-admin
cd my-admin
cp .env.example .env
docker compose up --build

Open http://localhost:3000/admin and use:

admin@example.com / password

You can also start from an existing database:

gomyadmin introspect --database-url "$DATABASE_URL" > schema.json
gomyadmin generate from-schema schema.json

What You Get

  • A CLI for scaffolding, schema introspection, resource generation, OpenAPI output, and local checks.
  • A Go resource builder for fields, actions, permissions, audit logging, and tenant scoping.
  • A PostgreSQL-backed admin API with search, sort, filters, pagination, CRUD, bulk actions, file uploads, sessions, CSRF, RBAC, and audit logs.
  • A Next.js + TypeScript + Tailwind + shadcn/ui admin template.
  • Generated files that stay in your repo and can be edited by hand.

Resource Example

import "github.com/darwvin-dev/gomyadmin/pkg/admin"

app := admin.New("Acme Admin")

app.Resource(User{}).
    Label("Users").
    TableName("users").
    Field("ID").UUID().Primary().Readonly().
    Field("Email").Email().Required().Searchable().Sortable().Unique().
    Field("Name").String().Searchable().
    Field("Role").Enum("admin", "manager", "support", "viewer").Filterable().
    Field("Status").Enum("active", "blocked", "pending").Filterable().Badge().
    Field("CreatedAt").DateTime().Readonly().Sortable().DateRangeFilter().
    Action("Block User", blockUserHandler).Danger().RequireConfirmation().
    Audit().
    TenantScoped("tenant_id")

CLI

gomyadmin init <name> [--backend go] [--db postgres] [--frontend next] [--ui shadcn]
gomyadmin demo [name]
gomyadmin introspect --database-url "$DATABASE_URL"
gomyadmin generate resource <Name> [--table <table>] [--package <pkg>] [--force]
gomyadmin generate from-schema <schema.json> [--package <pkg>] [--force]
gomyadmin doctor
gomyadmin openapi generate [--out openapi.json]
gomyadmin version

Install As A Library

go get github.com/darwvin-dev/gomyadmin@latest

Mount the admin handler on your existing Go server:

srv, err := server.New(ctx, server.Config{
    DatabaseURL:  os.Getenv("DATABASE_URL"),
    App:          app,
    Authenticate: verifyAdminCredentials,
})
if err != nil {
    log.Fatal(err)
}
defer srv.Close()

mux.Handle("/admin/", srv.Handler())

Scope

GoMyAdmin is PostgreSQL-first and optimized for Go applications that want generated, committable code.

It is not trying to be a hosted low-code platform, a BI tool, or a universal replacement for every admin framework. Optional adapters exist for integration points such as sessions, storage, cache, ORM-backed access, and document resources, but the main path is Go + PostgreSQL.

See comparison notes for when GoMyAdmin is a good fit.

Documentation

Verification

go test ./...
go vet ./...

cd templates/frontend-next-shadcn
yarn install --frozen-lockfile
yarn run typecheck
yarn run build

Roadmap

  • CLI install and runnable local demo
  • PostgreSQL introspection
  • Resource generation from schema JSON
  • Go resource builder API
  • Admin API with CRUD, filters, search, sort, pagination, actions, audit, RBAC, sessions, and files
  • Next.js admin template
  • Drop-in HTTP handler for existing Go backends
  • Hosted public demo
  • Relation field rendering in the frontend
  • Playwright e2e coverage for the CRM demo
  • Split heavier optional adapters into separate modules or documented opt-in packages

Contributing

Small focused PRs are welcome. Good first areas:

  • docs and examples
  • relation-field UI
  • demo polish
  • adapter docs
  • e2e coverage

See CONTRIBUTING.md and SECURITY.md.

License

MIT

Directories

Path Synopsis
cmd
gomyadmin command
examples
crm
internal
cli
pkg
adapters/gormstore
Package gormstore adapts GORM-managed database connections to GoMyAdmin.
Package gormstore adapts GORM-managed database connections to GoMyAdmin.
adapters/mongostore
Package mongostore adapts MongoDB collections to GoMyAdmin resources.
Package mongostore adapts MongoDB collections to GoMyAdmin resources.
adapters/redisstore
Package redisstore provides Redis-backed auth.SessionStore construction.
Package redisstore provides Redis-backed auth.SessionStore construction.
adapters/sqlstore
Package sqlstore adapts database/sql connections to server.AdminStore.
Package sqlstore adapts database/sql connections to server.AdminStore.
cache
Package cache defines a tiny adapter boundary for optional caching layers.
Package cache defines a tiny adapter boundary for optional caching layers.
migrate
Package migrate applies ordered SQL migrations and records checksums.
Package migrate applies ordered SQL migrations and records checksums.
server
Package server exposes the drop-in GoMyAdmin HTTP server.
Package server exposes the drop-in GoMyAdmin HTTP server.
templates

Jump to

Keyboard shortcuts

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