Nguyen.go — Next.js for Go
Full-stack Go framework for modern web. Write both frontend and backend in Go, compile frontend to WebAssembly, deploy a single binary.
Highlights
Rendering & Frontend:
File-based routing like Next.js (file .gox = one route)
React-style hooks written in Go: UseState, UseEffect, UseQuery, UseMutation...
SSR / ISR / CSR + Streaming SSR
Islands architecture — only hydrate interactive parts
HMR, image optimization (WebP/AVIF), PWA, per-route code splitting
GEO (SEO for AI) — auto-generate llms.txt, sitemap, JSON-LD
Backend (new in v1.0.7):
Database layer — query builder, transaction, migration system
Auth — JWT, refresh token, bcrypt, session, OAuth2 (Google, GitHub, Facebook)
CSRF protection — token auto-rotate, constant-time validation
Validator — 13+ rules, struct tag + map validation, Fiber middleware
File upload — local + S3, MIME filtering, single/multiple handlers
WebSocket — hub, rooms, broadcast, send-to-client
i18n — JSON translations, nested keys, auto locale detection
Mail — SMTP/TLS, HTML templates, attachments
Event bus — sync/async, decouple business logic
Rate limit per-endpoint
Docker — multi-stage build, compose (app + PostgreSQL + Redis)
CLI:
nguyen create # Scaffold project
nguyen dev # Dev server + HMR
nguyen build # Compile .gox → WASM + static HTML
nguyen start # Production server
nguyen export # Static pre-render for CDN
nguyen migrate # Database migrations (up/down/create/status)
Quick example
---
import "nguyen.go/pkg/core"
count, setCount := core.UseState("count", 0)
func increment() {
setCount(count + 1)
}
---
<h1>Count: {count}</h1>
<button @click="increment()">+1</button>
Backend API
app := nguyen.New(
nguyen.WithPort(3000),
nguyen.WithPages("pages"),
nguyen.WithDatabase(config.DatabaseConfig{
Driver: "postgres",
DSN: "postgres://user:pass@localhost/mydb?sslmode=disable",
}),
nguyen.WithAuth(config.AuthConfig{Enabled: true, JWTSecret: "secret"}),
nguyen.WithSetup(func(f *fiber.App) {
api := f.Group("/api")
api.Post("/login", server.RateLimit(5, time.Minute), loginHandler)
api.Get("/me", app.Auth().Required(), meHandler)
}),
)
app.Events().On("user.registered", func(payload interface{}) {
app.Mailer().SendTemplate([]string{user.Email}, "Welcome!", "welcome", user)
})
app.Listen(":3000")
Requirements
Go 1.25+
TinyGo (optional, for client-side WASM)
Installation
go install github.com/dev2k6/Nguyen.go/cmd/nguyen@latest
nguyen create my-app
nguyen dev
Links
GitHub:

Thuê bot Zalo quảng bá, Chatbot tự động hóa tích hợp AI

Dùng AI coding tool bất kỳ với CommandCode — qua chuẩn OpenAI API.

Mã nguồn bán proxy xoay, proxy tĩnh tự động

Công cụ tính GPA thuộc Thái Nguyên IT

Hệ thống chuyên cung cấp mã nguồn website uy tín tại Việt Nam

No reviews yet
Việc kết hợp Go backend với WebAssembly frontend trong một framework duy nhất là một ý tưởng khá thú vị. Tính năng Islands architecture và code splitting tự động sẽ giúp nhà phát triển tối ưu hoá performance dễ dàng hơn. Mình gợi ý bạn nên thêm một phần ngắn gọn nêu các trường hợp sử dụng cụ thể, ví dụ như dự án nào sẽ được hưởng lợi nhiều nhất từ Nguyen.go so với các giải pháp khác. Điều này sẽ giúp nhà phát triển nhanh chóng quyết định liệu framework này có phù hợp với nhu cầu của họ hay không. Dự án có vẻ được phát triển kỹ lưỡng. Hãy cân nhắc viết một bài blog hay tài liệu chi tiết hơn về migration từ Next.js sang Nguyen.go để thu hút cộng đồng Node.js.
No talks yet
Create the first talk
Reviews & comments