Stdlib-first runtime
Built on net/http, database/sql, log/slog and context. New third-party deps require an ADR and a dependency-impact review.
Nucleus is an MVC + REST framework built on Go's standard library. Explicit lifecycle, SQL-first data layer, embedded admin, and a public surface governed by contracts. Production defaults from day one.
Six properties define the framework. Each is enforced by tests, not by aspirations in a README.
Built on net/http, database/sql, log/slog and context. New third-party deps require an ADR and a dependency-impact review.
Public symbols in pkg/*, registered CLI commands and config keys are pinned by freeze tests under contracts/. No silent removals.
React + TypeScript admin auto-generated from your registered models. CRUD, bulk actions, audit log, RBAC, multi-tenant filters — all in the binary.
Plain database/sql with health checks, telemetry, and SQL migrations. No ORM. Postgres, MySQL, SQLite by default; MSSQL and Oracle as build tags.
Argon2id passwords, CSRF on for state-changing form posts, secure cookies in production, CORS that denies unknown origins, rate limiting on every public route.
Structured slog logging, OpenTelemetry traces and metrics, deterministic /healthz endpoints. Configure once in nucleus.yml.
The fluent entry point assembles a full application — config, database, model registry, router, handlers — in a builder you can read top-to-bottom. For real projects, the same wiring lives in cmd/server/main.go.
App instances per process for tests.Run, Shutdown, hooks.package main
import "github.com/jcsvwinston/nucleus/pkg/nucleus"
type Article struct {
ID int64 `json:"id" db:"id,primary"`
Title string `json:"title" db:"title" validate:"required"`
}
func main() {
nucleus.New().
Port(8080).
SQLite("app.db").
Model(&Article{}).
AutoMigrate().
Get("/api/articles", listArticles).
Run()
}
Each subsystem ships with sane defaults, structured logging, health hooks and a place in the embedded admin.
pkg/appComposition root. Lifecycle, extensions, request scope.
pkg/routerHTTP router + middleware: CORS, CSRF, rate limit, OTel.
pkg/dbdatabase/sql wrapper with telemetry, health, migrations.
pkg/modelMetadata-driven registry. Drives admin and CRUD.
pkg/authJWT, Argon2id, session manager (memory/SQL/Redis).
pkg/adminEmbedded React admin generated from your models.
pkg/storageLocal, S3, GCS, Azure — one provider-agnostic API.
pkg/tasksBackground jobs on Asynq + Redis with outbox.
Install the CLI, scaffold a project, and have a database, an admin panel, and a REST API running locally before the kettle boils.