Neutron Go
A Go framework for concurrent services with auth, real-time, and database already finished. Goroutine-native handlers, pgx/v5 transport, typed Nucleus client. One binary, zero runtime.
Go's concurrency, without bringing your own auth.
Auth is already done.
The reason Go backends get abandoned halfway isn't the language — it's the hour on day three when you realize you need OAuth and there's no batteries-included option. Neutron Go ships neutronauth with OAuth2 for GitHub, Google, and Discord (PKCE-first), WebAuthn passkeys (P-256 ECDSA), JWT signing and verification, session handling, and CSRF. You wire a provider, register a callback, and you're done.
package main
import (
"github.com/neutron-dev/neutron-go/neutron"
"github.com/neutron-dev/neutron-go/neutronauth"
"github.com/neutron-dev/neutron-go/nucleus"
)
func main() {
db := nucleus.Connect("postgres://localhost/app")
auth := neutronauth.New(neutronauth.Config{
GitHub: neutronauth.OAuth{ClientID: env("GH_ID"), Secret: env("GH_SECRET")},
Google: neutronauth.OAuth{ClientID: env("GG_ID"), Secret: env("GG_SECRET")},
WebAuthn: neutronauth.WebAuthnConfig{RPID: "example.com", Origin: "https://example.com"},
SessionDB: db.KV("sessions"),
})
app := neutron.New()
app.Mount("/auth", auth.Routes())
app.GET("/me", auth.Required(), func(c *neutron.Ctx) error {
return c.JSON(200, auth.User(c))
})
app.Listen(":8080")
}All 14 data models, one connection.
The nucleus package gives you typed accessors for every model Nucleus supports — no separate library per storage engine, no version skew.
func recommend(c *neutron.Ctx) error {
var q struct {
Prompt string ``json:"prompt"``
K int ``json:"k"``
}
if err := c.Bind(&q); err != nil { return err }
emb, err := embed(c.Context(), q.Prompt)
if err != nil { return err }
tx, _ := db.Begin(c.Context())
defer tx.Rollback(c.Context())
hits, _ := tx.Vector("articles").Search(emb).K(q.K).Do(c.Context())
enriched, _ := tx.SQL().Query(
"SELECT id, title, author FROM articles WHERE id = ANY($1)",
hitIDs(hits),
).All(c.Context())
tx.Commit(c.Context())
return c.JSON(200, enriched)
}Deploy. Done.
Compile to one static binary with go build. No runtime to install, no dependency tree to vendor, no golang:1.21-alpine base image. The binary is the artifact.
# Build for Linux, copy to server, restart systemd unit.
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o app .
scp app prod:/usr/local/bin/myapp
ssh prod systemctl restart myappWhat it's for
API gateways handling millions of requests. Microservice architectures with gRPC between services. Cloud infrastructure tooling — CLIs, controllers, Kubernetes operators. Real-time services with WebSocket fan-out. Background job workers. Anywhere you want Go's concurrency story and would rather not reimplement a login screen.
Why Go for services?
Goroutines give you concurrency without callbacks or async runtimes. The type system catches errors at compile time without generics-heavy ceremony. Single-binary deployment means no runtime install, no dependency hell, no container layer audit. And it compiles in seconds.
Part of a bigger system
Neutron TypeScript on the edge. Neutron Go for the services. Neutron Rust where performance wins. All three talk to the same Nucleus database through the same contract — same wire protocol, same RFC 7807 errors, same health endpoints. Add what you need without rearchitecting.