Skip to content

aicontentcreate2023-star/zenqo

 
 

Repository files navigation

Zenqo

A return-value-based Go web framework for building clean, scalable server-side applications.

CI Go Reference Go Report Card License

Description

Zenqo is a framework for building efficient, maintainable Go web applications. Handlers return (data, error) instead of manually writing to http.ResponseWriter — the framework handles JSON serialization, status codes, and error responses automatically.

Under the hood, Zenqo uses chi as its router, keeping Go's performance while removing the boilerplate that slows you down.

Philosophy

Go's standard library gives you full control over HTTP, but that control comes with repetition. Every handler manually sets headers, encodes JSON, picks status codes, and writes error responses. The logic that matters — your business code — gets buried.

Zenqo takes a different approach. Handlers are pure functions that return values. The framework decides how to respond. This means less boilerplate, consistent API responses, and a clear separation between what your code does and how it's delivered.

// Standard Go — you manage everything
func getUser(w http.ResponseWriter, r *http.Request) {
    user, err := svc.FindByID(id)
    if err != nil {
        w.Header().Set("Content-Type", "application/json")
        w.WriteHeader(404)
        json.NewEncoder(w).Encode(map[string]any{"code": 404, "message": "not found"})
        return
    }
    w.Header().Set("Content-Type", "application/json")
    w.WriteHeader(200)
    json.NewEncoder(w).Encode(map[string]any{"success": true, "data": user})
}

// Zenqo — you focus on logic
func getUser(r *http.Request) (any, error) {
    user, err := svc.FindByID(id)
    if err != nil {
        return nil, core.ErrNotFound("user not found")
    }
    return user, nil
}

Getting Started

Install the CLI

# with Go
go install github.com/zenqos/zenqo/cmd/zenqo@latest

# or Homebrew
brew install zenqos/tap/zenqo

Scaffold a New Project

zenqo new my-app
cd my-app && go run .

Hello World

package main

import (
    "log"
    "net/http"
    "github.com/zenqos/zenqo/core"
)

func main() {
    app := core.NewApp()

    app.GET("/", func(r *http.Request) (any, error) {
        return map[string]string{"message": "Hello, Zenqo!"}, nil
    })

    log.Fatal(app.Start(":3000"))
}
curl http://localhost:3000/
# { "success": true, "data": { "message": "Hello, Zenqo!" } }

Features

  • Return-value handlers(any, error) signature, automatic JSON & status codes
  • Controllers — group routes under a base path with BaseController
  • Bind & ValidateBind[T] decodes JSON and runs struct validation in one call
  • Guards & Interceptors — access control and lifecycle hooks at route, controller, or global level
  • Error handling — panic recovery, typed errors, customizable global error handler
  • Auto camelCase — struct fields serialize as camelCase without json tags
  • Built-in middleware — CORS, secure headers, request ID, panic recovery

Examples

  • examples/basic — Direct routing without controllers
  • examples/crud — Full CRUD API with Controller + Service pattern
  • examples/auth — JWT authentication with Guards, Interceptors, and Bind+Validation

Documentation

  • CHANGELOG — detailed feature breakdown and version history
  • pkg.go.dev — API reference (GoDoc)

Contributors

Contributing

We welcome contributions! Please read the Contributing Guide before submitting a Pull Request.

Security

If you discover a security vulnerability, do not open a public issue. Please follow the instructions in our Security Policy.

Stay in Touch

License

Zenqo is MIT licensed.

About

A return-value-based Go web framework for building clean, scalable server-side applications.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Go 100.0%