Skip to content

darwvin-dev/gomyadmin

Repository files navigation

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.

Go 1.25+ PostgreSQL License: MIT CI

GoMyAdmin admin dashboard

The generated CRM admin — try the live demo (admin@example.com / password)

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.

Live Demo

Try the generated CRM admin UI without installing anything:

https://gomyadmin-next-shadcn.darwvin-dev.workers.dev/admin/login
admin@example.com / password

The demo frontend runs on Cloudflare Workers (OpenNext) and talks to a seeded, read-only demo API worker. The demo data is served fresh per request, so visitors can explore freely without affecting a real database.

Screenshots from the live demo: dashboard · resource list · edit form · audit log — see docs/screenshots/.

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

Public demo deployment instructions are in docs/cloudflare-demo-deploy.md for a card-free Cloudflare demo and docs/free-demo-deploy.md for a Render + Neon demo that runs the Go backend.

You can also start from an existing database:

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

For a hosted Postgres flow, see the Supabase/Postgres example.

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. The core module stays lightweight: heavier integrations (Redis sessions, GORM, MongoDB, extra SQL drivers) live in separate opt-in adapter modules under pkg/adapters/, so they only join your build when you go get them. The main path is Go + PostgreSQL. See drop-in adapters.

See comparison notes for when GoMyAdmin is a good fit.

Documentation

Verification

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

# Opt-in adapter modules are separate Go modules:
for m in sqlstore redisstore gormstore mongostore; do
  (cd "pkg/adapters/$m" && go test ./...)
done

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

About

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

Topics

Resources

License

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors