EchoNext
EchoNext is a type-safe wrapper around the Echo web framework that automatically generates OpenAPI specifications and provides request validation. Build robust, well-documented APIs with compile-time type safety.
Features
- 🔒 Type-Safe Handlers - Define handlers with strongly-typed request and response structs
- 📚 Automatic OpenAPI Generation - Generate OpenAPI 3.0 specs from your code
- ✅ Built-in Validation - Validate requests using struct tags
- 📖 Swagger UI - Interactive API documentation out of the box
- 🚀 Zero Boilerplate - Focus on business logic, not HTTP details
- 🔌 Echo Compatible - Use all Echo middleware and features
- 📁 File Uploads - Type-safe file uploads with OpenAPI documentation
- 🔌 WebSocket Support - Real-time communication with Hub pattern
- 📊 GraphQL Integration - Seamless gqlgen integration with context sharing
- 🛠️ CLI Tool - Code generation, hot reload, and project scaffolding
Installation
go get github.com/abdussamadbello/echonext
Agent Skills
EchoNext ships 8 Agent Skills that teach AI coding agents the
framework's conventions — handler signatures, domain layout, OpenAPI configuration, and more.
Any agent:
npx skills add abdussamadbello/echonext
Works with Claude Code, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Codex, and
40+ other clients that support the Agent Skills format.
Use -s echonext-handlers for a single skill, or --all to install everything without prompts.
Claude Code plugin:
/plugin marketplace add abdussamadbello/echonext
/plugin install echonext@echonext
| Skill | Use it for |
|---|
echonext-cli | Scaffolding projects, generating code, dev/build/test/db commands |
echonext-domain | Adding a full domain — model + service + handler + DTO |
echonext-handlers | Typed handlers, request structs, validation tags, route registration |
echonext-database | GORM models, the generic Repository[T], Atlas migrations and seeds |
echonext-openapi-security | OpenAPI metadata, Swagger UI, auth security schemes |
echonext-middleware-config | Middleware ordering, custom echo.MiddlewareFunc, YAML/env config |
echonext-integrations | WebSocket hubs, gqlgen GraphQL, multipart file uploads |
echonext-testing | The APIClient, Suite, and FixtureManager helpers |
echonext-setup | Installing EchoNext or its skills in a repo, and restoring from skills-lock.json |
The skills live in skills/ and follow the
Agent Skills specification.
Quick Start
package main
import (
"github.com/abdussamadbello/echonext"
"github.com/labstack/echo/v5"
)
// Define your request/response types
type CreateUserRequest struct {
Name string `json:"name" validate:"required,min=2"`
Email string `json:"email" validate:"required,email"`
}
type UserResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
}
func main() {
// Create new EchoNext app
app := echonext.New()
// Set API info
app.SetInfo("User API", "1.0.0", "User management service")
// Register typed routes
app.POST("/users", createUser, echonext.Route{
Summary: "Create a new user",
Description: "Creates a new user with the provided information",
Tags: []string{"Users"},
})
app.GET("/users/:id", getUser, echonext.Route{
Summary: "Get user by ID",
Tags: []string{"Users"},
})
// Serve OpenAPI spec and Swagger UI
app.ServeOpenAPISpec("/api/openapi.json")
app.ServeSwaggerUI("/api/docs", "/api/openapi.json")
// Start server
app.Start(":8080")
}
// Handlers with typed parameters
func createUser(c *echo.Context, req CreateUserRequest) (UserResponse, error) {
// Your business logic here
user := UserResponse{
ID: "123",
Name: req.Name,
Email: req.Email,
}
return user, nil
}
func getUser(c *echo.Context) (UserResponse, error) {
id := c.Param("id")
// Fetch user logic
return UserResponse{
ID: id,
Name: "John Doe",
Email: "[email protected]",
}, nil
}
Handler Signatures
EchoNext supports various handler signatures:
// No request body (GET, DELETE)
func handler(c *echo.Context) (ResponseType, error)
// With request body (POST, PUT, PATCH)
func handler(c *echo.Context, req RequestType) (ResponseType, error)
// No response body
func handler(c *echo.Context) error
Validation
Use struct tags for validation: