Just Released

NexGo v2.2.1

SEO Killer Mode — the most SEO-complete Go framework. Auto sitemap, robots.txt, 10 JSON-LD schema types, OpenGraph, Twitter Cards, RSS feeds, Core Web Vitals, hreflang, breadcrumbs, SEO audit — all built-in with zero config. Plus 200k+ req/sec performance and zero-JS Islands.

$ go install github.com/salmanfaris22/nexgo/v2/cmd/nexgo@v2.2.1
What's New in v2.2.1

SEO Killer Mode + Performance + Islands + 30 Features

The most SEO-complete Go framework, plus 200k+ req/sec performance, zero-JS Islands, and all production features.

๐Ÿ”

SEO Killer Mode

HEADLINE

The most SEO-complete Go framework. Auto sitemap.xml & robots.txt, canonical URLs, 10 JSON-LD schema types, OpenGraph + Twitter Cards, article OG tags, RSS feeds, hreflang, breadcrumbs, Core Web Vitals tracking, SEO audit, redirects, HSTS, and 22+ template functions โ€” all zero config.

pkg/seo Auto Sitemap 10 JSON-LD Types RSS Feeds Core Web Vitals SEO Audit
Auto Sitemap + Robots.txt Built-in
JSON-LD Schema Types 10 types
SEO Template Functions 22+ funcs
Core Web Vitals LCP + CLS + INP
โšก

High-Performance Mode

HEADLINE

Push throughput from 50k to 200,000+ req/sec on multi-core machines. Cluster mode spawns one HTTP worker per CPU core. Async logging, response caching, atomic template reads, and route match caching โ€” all configurable.

pkg/cluster 200k+ req/sec Async Logging Response Cache Atomic Templates Route Cache
v2.1.0 (default) ~50k req/sec
v2.2.0 (cluster, 4 cores) ~200k req/sec
v2.2.0 (cluster, 8 cores) ~400k req/sec
v2.2.0 (cluster + cache) ~1M+ req/sec
๐Ÿ๏ธ

Islands Architecture

HEADLINE

Pages are static HTML by default. Only interactive components ("islands") ship JavaScript, with fine-grained control over when they hydrate. Choose from 5 strategies: client:load, client:visible, client:idle, client:media, and client:none.

pkg/islands 0KB Default 5 Strategies SSR-Only Mode Per-Component Hydration ES Modules
Static blog page 85KB โ†’ 0 KB
Blog + like button 87KB โ†’ ~1.5 KB
Dashboard (5 widgets) 120KB โ†’ ~8 KB
Time to Interactive ~1.2s โ†’ ~0.1s
๐ŸŒ

Environment Variables

Load .env files, validate required vars, set defaults, and access typed values. Supports multiple environments out of the box.

pkg/env .env Typed Access
๐Ÿ—‚๏ธ

Session Management

Cookie-backed sessions with configurable stores. Supports Flash messages, expiry, and secure defaults for production.

pkg/session Cookies Flash
๐Ÿ”‘

JWT Authentication

Sign, verify, and refresh JSON Web Tokens. Includes middleware for protected routes and role-based access control helpers.

pkg/auth JWT RBAC Middleware
๐Ÿ›ก๏ธ

CSRF Protection

Automatic token generation and validation middleware. Works with forms and AJAX requests, integrates with sessions.

pkg/csrf Token Middleware
โฑ๏ธ

Rate Limiting

IP-based and key-based rate limiting with sliding window algorithm. Returns standard rate-limit headers automatically.

pkg/ratelimit Sliding Window Headers
๐ŸŒ

i18n & RTL

Internationalization with locale files, pluralization rules, and automatic RTL layout detection. Template helpers included.

pkg/i18n Locales Plurals RTL
๐Ÿ–ผ๏ธ

Image Optimization

Resize, crop, and convert images on the fly. WebP output, lazy-load attributes, and responsive srcset generation.

pkg/image WebP Resize Srcset
๐Ÿ”Œ

WebSocket Support

Full-duplex WebSocket connections with rooms, broadcast, and per-client messaging. Built on gorilla/websocket under the hood.

pkg/websocket Rooms Broadcast
๐Ÿ’š

Health Checks

Liveness and readiness endpoints for Kubernetes and load balancers. Register custom checkers for DB, Redis, and more.

pkg/health Liveness Readiness
๐Ÿ“‹

Structured Logging

JSON and text loggers with levels, context fields, and request-scoped tracing. Drop-in replacement for the standard library.

pkg/logger JSON Levels Trace ID
๐Ÿ“Š

Prometheus Metrics

Expose request duration, status codes, and custom counters at /metrics. Grafana-ready with zero configuration.

pkg/metrics Prometheus Grafana
๐Ÿ—„๏ธ

Database & SQL Builder

Fluent query builder for Postgres, MySQL, and SQLite. Connection pooling, transactions, and named parameters built in.

pkg/db Postgres MySQL SQLite
๐Ÿ”„

Migration System

Version-controlled schema migrations with up/down support. CLI commands to create, run, rollback, and check migration status.

pkg/migrate Up/Down CLI
๐Ÿงฉ

Plugin System

Register, load, and compose plugins with lifecycle hooks. Build reusable modules that integrate cleanly into any NexGo app.

pkg/plugin Lifecycle Composable
โšก

Server Actions

Define server-side functions that can be called directly from templates. Form handling, validation, and redirect helpers included.

pkg/actions Forms Validation
๐Ÿšจ

Error Pages & Boundaries

Custom error pages for 404, 500, and any status code. Error boundaries catch panics and render fallback templates gracefully.

pkg/errorpage 404/500 Boundaries
๐Ÿงช

Testing Utilities

Test helpers for routes, middleware, and templates. Includes a mock server, request builders, and assertion helpers.

pkg/testing Mock Server Assertions
๐Ÿ”’

Per-Route Middleware & CSP

Attach middleware to individual routes or groups. Content Security Policy headers with nonce generation for inline scripts.

pkg/middleware CSP Nonce Groups
๐Ÿš€

Deployment Adapters

One-command deploy to 8 platforms: Docker, Fly.io, Railway, Render, Vercel, AWS Lambda, GCP Cloud Run, and DigitalOcean.

pkg/deploy Docker Fly.io AWS +5 more
๐Ÿ’พ

Redis Cache

Redis-backed caching with TTL, tags, and invalidation. Includes middleware for full-page caching and fragment caching helpers.

pkg/cache Redis TTL Tags
๐Ÿ“ฆ

Asset Pipeline

Bundle, minify, and fingerprint CSS and JS assets. Automatic cache-busting URLs and source map support for development.

pkg/asset Minify Fingerprint
๐Ÿ—๏ธ

ORM Layer

Lightweight ORM with model definitions, relationships (has-one, has-many, belongs-to), eager loading, and soft deletes.

pkg/orm Relations Eager Load Soft Delete
๐Ÿ–ง

Cluster Mode

Run multiple NexGo instances with shared state. Sticky sessions, distributed locks, and leader election for zero-downtime deploys.

pkg/cluster Sticky Sessions Leader Election
New in v2.2.1

Islands Architecture

Pages are static HTML by default — zero JavaScript. Only interactive components ("islands") ship JS to the browser, with fine-grained control over when they hydrate.

✓ 0 KB JS on static pages โ€” content visible instantly
✓ 5 hydration strategies โ€” load, visible, idle, media, none
✓ Per-component JS โ€” each island loads independently
✓ SSR-only islands โ€” reusable components with zero JS
✓ ~1KB runtime โ€” scans and hydrates automatically
pages/dashboard.html
<!-- Static HTML โ€” 0 KB JavaScript -->
<h1>Dashboard</h1>
<div class="stats">Revenue: $</div>

<!-- Loads immediately -->
{{ island "search" (props "endpoint" "/api/search") "client:load" }}

<!-- Loads when scrolled into view -->
{{ island "chart" (props "data" .Props.chartData) "client:visible" }}

<!-- Loads when browser is idle -->
{{ island "notifications" (props "count" .Props.unread) "client:idle" }}

<!-- Only loads on mobile -->
{{ island "mobile-filters" nil "client:media=(max-width:768px)" }}

<!-- SSR only โ€” zero JS ever -->
{{ island "activity-feed" (props "events" .Props.events) "client:none" }}
Quick Reference

All Packages at a Glance

Package Feature Key Functions
pkg/islands Islands Architecture NewRegistry(), Scan(), Render(), GetJS(), RuntimeJS()
pkg/api State, HTMX, Cache, JSON SetState(), IsHTMX(), HTMXHTML(), Cache(), JSON()
pkg/seo Meta, Sitemap, Robots DefaultMeta(), RenderSitemap(), RobotsTxt(), JSONLD()
pkg/stream Streaming SSR, SSE StreamHTML(), NewSSE(), Send(), WriteString()
pkg/isr Incremental Regeneration New(), Serve(), Revalidate(), Purge()
pkg/worker Worker Pools New(), Run(), Map(), MapErr(), ForEach()
pkg/renderer Template Caching LoadAll(), LoadParallel(), CacheInfo(), NewParallelLoader()
pkg/env Environment Variables Load(), Get(), MustGet(), GetInt(), GetBool()
pkg/session Session Management NewCookieStore(), Get(), Set(), Flash(), Destroy()
pkg/auth JWT Authentication Sign(), Verify(), Refresh(), RequireJWT(), RequireRole()
pkg/csrf CSRF Protection Generate(), Validate(), Middleware(), TemplateField()
pkg/ratelimit Rate Limiting New(), Allow(), Middleware(), ByIP(), ByKey()
pkg/i18n i18n & RTL Load(), T(), Plural(), SetLocale(), IsRTL()
pkg/image Image Optimization Resize(), Crop(), ToWebP(), Srcset(), LazyAttr()
pkg/websocket WebSocket Support Upgrade(), OnMessage(), Broadcast(), JoinRoom(), Send()
pkg/health Health Checks NewChecker(), AddCheck(), LiveHandler(), ReadyHandler()
pkg/logger Structured Logging New(), Info(), Error(), WithFields(), WithTraceID()
pkg/metrics Prometheus Metrics Handler(), Counter(), Histogram(), Middleware()
pkg/db Database & SQL Builder Connect(), Select(), Insert(), Where(), Tx()
pkg/migrate Migration System Create(), Up(), Down(), Status(), Rollback()
pkg/plugin Plugin System Register(), Load(), OnInit(), OnShutdown(), List()
pkg/actions Server Actions Handle(), Validate(), Redirect(), BindForm(), Errors()
pkg/errorpage Error Pages & Boundaries Register(), Render(), Boundary(), Fallback()
pkg/testing Testing Utilities NewServer(), Request(), AssertStatus(), AssertBody()
pkg/middleware Per-Route Middleware & CSP Use(), Group(), CSP(), Nonce(), Chain()
pkg/deploy Deployment Adapters Docker(), Fly(), Railway(), Vercel(), Lambda()
pkg/cache Redis Cache NewRedis(), Get(), Set(), Invalidate(), TaggedCache()
pkg/asset Asset Pipeline Bundle(), Minify(), Fingerprint(), URL(), SourceMap()
pkg/orm ORM Layer Model(), HasMany(), BelongsTo(), Eager(), SoftDelete()
pkg/cluster Cluster Mode Join(), Sticky(), Lock(), Elect(), Broadcast()

Ready for 200k+ req/sec?

Drop-in upgrade from v2.2.0 — no breaking changes. All optimizations are opt-in or automatic.