Go Framework

Build scalable server-side
applications in Go

GoNest brings NestJS's battle-tested architecture to Go. Modules, dependency injection, guards, pipes, interceptors — all expressed idiomatically for the Go ecosystem.

func main() {
    app := gonest.Create(AppModule)
    app.UseGlobalPipes(gonest.NewValidationPipe())
    app.EnableCors()
    app.Listen(":3000")
}

Dependency Injection

Automatic constructor-based DI with singleton, request, and transient scopes. Interface bindings, token providers, and forward references.

🛡

Guards & Auth

Declarative route protection with JWT authentication, role-based access control, sessions, and rate limiting out of the box.

🔌

Modular Architecture

Self-contained modules with imports, exports, and dynamic configuration. Lazy loading, configurable module builder, and ForRoot/ForFeature patterns.

Request Pipeline

Middleware, guards, interceptors, pipes, and exception filters compose into a powerful, predictable request pipeline with lifecycle hooks.

🚀

Microservices

TCP, gRPC, NATS, Redis, Kafka, RabbitMQ, and MQTT transports. Message patterns, hybrid HTTP+microservice mode, and custom transports.

📄

Swagger & GraphQL

Auto-generated OpenAPI documentation with Swagger UI. Built-in GraphQL engine with playground and federation support.

Scheduling & Queues

Cron jobs, intervals, and timeouts. In-memory job queues with workers, retries, and configurable concurrency.

📊

Database

SQL module for Postgres, MySQL, SQLite, and SQL Server. MongoDB module. Generic repository pattern with pagination.

🔒

Sessions & CORS

Cookie-based sessions with pluggable stores. Built-in CORS support. API versioning via URI, header, or media type.

🗎

Templating & Files

Server-side HTML rendering with Go templates. File uploads with validation. Streaming file downloads. Static file serving.

🔬

Discovery & REPL

Runtime introspection of modules, providers, and dependency graphs. Interactive REPL for debugging. Serialized graph export.

🎯

Zero External Deps

The core framework uses only the Go standard library. Optional modules add external dependencies as needed.

Full-Stack in Minutes

Controllers, services, guards, pipes, modules — all wired together by the DI container.

type CatsController struct {
    service *CatsService
}

func NewCatsController(service *CatsService) *CatsController {
    return &CatsController{service: service}
}

func (c *CatsController) Register(r gonest.Router) {
    r.Prefix("/cats")
    r.UseGuards(NewRolesGuard)

    r.Get("/", c.findAll)
    r.Post("/", c.create).
        SetMetadata("roles", []string{"admin"})
    r.Get("/:id", c.findOne).
        Pipes(gonest.NewParseIntPipe("id"))
}