__/\\\________/\\\_______/\\\\\_______/\\\\\\\\\\\\_____/\\\________/\\\_____/\\\\\\\\\____
_\/\\\_______\/\\\_____/\\\///\\\____\/\\\////////\\\__\/\\\_____/\\\//____/\\\\\\\\\\\\\__
_\//\\\______/\\\____/\\\/__\///\\\__\/\\\______\//\\\_\/\\\__/\\\//______/\\\/////////\\\_
__\//\\\____/\\\____/\\\______\//\\\_\/\\\_______\/\\\_\/\\\\\\//\\\_____\/\\\_______\/\\\_
___\//\\\__/\\\____\/\\\_______\/\\\_\/\\\_______\/\\\_\/\\\//_\//\\\____\/\\\\\\\\\\\\\\\_
____\//\\\/\\\_____\//\\\______/\\\__\/\\\_______\/\\\_\/\\\____\//\\\___\/\\\/////////\\\_
_____\//\\\\\_______\///\\\__/\\\____\/\\\_______/\\\__\/\\\_____\//\\\__\/\\\_______\/\\\_
______\//\\\__________\///\\\\\/_____\/\\\\\\\\\\\\/___\/\\\______\//\\\_\/\\\_______\/\\\_
_______\///_____________\/////_______\////////////_____\///________\///__\///________\///__
A modern Go web framework focused on developer experience, full-stack workflow, and rapid iteration.
Vodka is a lightweight and high-performance HTTP framework for Go that combines clean routing, middleware chaining, authentication utilities, validation support, and a powerful CLI for building modern full-stack applications.
Unlike traditional Go frameworks that focus only on request handling, Vodka heavily emphasizes developer experience and fast iteration.
- Features
- Why Vodka
- Prerequisites
- Installation
- Quick Start
- Generated Backend Structure
- Minimal API Example
- Using Vodka for APIs
- Core Concepts
- Middleware
- Validation
- Authentication
- SPA Support
- Production Build
- Roadmap
- Contributing
- License
| Feature | Included |
|---|---|
| Radix Tree Routing | ✅ |
| Middleware Chaining | ✅ |
| Route Groups | ✅ |
| JSON Binding | ✅ |
| Request Validation | ✅ |
| JWT Validation Helpers | ✅ |
| Bearer Auth Middleware | ✅ |
| Vite + React Scaffolding | ✅ |
| SPA Serving | ✅ |
| Panic Recovery Middleware | ✅ |
| Logger Middleware | ✅ |
| CORS Middleware | ✅ |
| Context Storage | ✅ |
Vodka combines:
- ⚡ Fast backend iteration
- ⚛️ React + Vite integration
- 🧩 Lightweight routing
- 🔐 Authentication helpers
- ✅ Validation support
- 🚀 Developer-first workflow
without requiring heavy configuration or excessive boilerplate.
Make sure the following tools are installed before using Vodka:
- Go 1.24+
- Node.js 20.19+ or newer
- npm
Verify installation:
go version
node -v
npm -vgo install github.com/DevanshuTripathi/vodka/cmd/vodka@latestMake sure your Go bin directory is added to your system PATH.
export PATH=$PATH:$(go env GOPATH)/binAdd the following directory to Environment Variables:
%USERPROFILE%\go\bin
vodka create my-appThis generates:
- A Go backend powered by Vodka
- A React + Vite frontend
- Preconfigured development workflow
- SPA support for production deployments
my-app/
├── controllers/
├── routes/
├── frontend/
├── main.go
├── go.mod
└── vodka.config.json
After scaffolding the project, install frontend dependencies manually:
cd my-app
cd frontend
npm install
cd ..vodka run devThis starts:
- Vite frontend dev server
- Vodka backend server
- Concurrent frontend/backend workflow
Vodka organizes backend code into simple and clean layers.
backend/
├── controllers/
│ └── ping.go
├── routes/
│ └── routes.go
├── main.go
└── go.mod
Contains request handlers and business logic.
func Pong(c *vodka.Context) {
c.String(200, "Pong!")
}Registers API routes.
app.GET("/ping", controllers.Pong)Bootstraps the Vodka engine and middleware configuration.
app := vodka.DefaultRouter()
routes.Setup(app)
app.Run(":8080")package main
import (
"log"
"github.com/DevanshuTripathi/vodka"
)
func main() {
app := vodka.DefaultRouter()
app.GET("/ping", func(c *vodka.Context) {
c.JSON(200, vodka.M{
"message": "pong!",
})
})
if err := app.Run(":8080"); err != nil {
log.Fatal(err)
}
}curl http://localhost:8080/pingResponse:
{
"message": "pong!"
}mkdir backend-app
cd backend-app
go mod init app
go get github.com/DevanshuTripathi/vodkavodkaVodka automatically:
- Watches
.gofiles - Rebuilds your backend
- Restarts the server instantly
vodka.Engine is the central router and application instance.
It uses a Radix Tree-based routing architecture for fast request matching and low overhead.
app := vodka.DefaultRouter()vodka.Context wraps Go's http.Request and http.ResponseWriter into a clean and ergonomic API.
c.JSON(200, vodka.M{
"message": "hello",
})name := c.Query("name")id := c.Param("id")var user User
c.BindJSON(&user)c.Error(400, errors.New("invalid request"))Vodka middleware is simply a vodka.HandlerFunc.
func(*vodka.Context)Middlewares can:
- Modify requests
- Attach values to context
- Authenticate users
- Log requests
- Recover from panics
- Handle errors
Middlewares are registered using:
app.Use(...)or:
group.Use(...)Each incoming request is wrapped in a *vodka.Context and the framework builds a handler chain.
The chain includes:
- Group middlewares
- Route middlewares
- Final route handler
c.Next() continues execution to the next middleware or handler.
If you omit c.Next(), the request chain stops immediately.
func RequestTimer() vodka.HandlerFunc {
return func(c *vodka.Context) {
start := time.Now()
c.Next()
latency := time.Since(start)
log.Printf(
"[RequestTimer] %s %s %v",
c.Request.Method,
c.Request.URL.Path,
latency,
)
}
}
func main() {
app := vodka.DefaultRouter()
app.Use(
vodka.Logger(),
vodka.Recovery(),
vodka.ErrorHandler(),
)
app.Use(RequestTimer())
api := app.Group("/api", AdminOnly())
api.GET("/dashboard", func(c *vodka.Context) {
userRole, _ := c.Get("user_role")
c.JSON(200, vodka.M{
"role": userRole,
})
})
}Track requests across your logs using automatic request ID generation. Every request gets a unique ID that's automatically added to response headers and stored in the context.
app := vodka.DefaultRouter()
// Add request ID middleware — generates unique ID for each request
app.Use(mixers.RequestID())
app.GET("/api/users", func(c *vodka.Context) {
requestID, _ := c.Get("request-id")
log.Printf("[%v] Fetching users", requestID)
c.JSON(200, vodka.M{"users": []string{"Alice", "Bob"}})
})
// Client receives: X-Request-ID: 550e8400-e29b-41d4-a716-446655440000Use a different header name if needed (context key is always "request-id"):
app.Use(mixers.RequestIDWithHeader("X-Correlation-ID"))Vodka supports request validation using struct tags.
type User struct {
Email string `validate:"required,email"`
Password string `validate:"min=8"`
}Vodka includes built-in Bearer authentication middleware and JWT validation helpers.
You can also provide custom validation logic:
app.Use(vodka.BearerAuth(contextKey, func(token string) (any, bool) {
return validateToken(token)
}))Projects generated using vodka create come with SPA serving preconfigured.
app.ServeSPA("./frontend/dist")If a route does not match an API endpoint, Vodka automatically serves the frontend application.
This enables seamless React Router support in production.
Vodka uses a Radix Tree router optimized for:
- Fast route matching
- Low memory overhead
- Efficient middleware execution
cd frontend
npm run buildvodkaVodka is designed around a few core ideas:
- Fast development workflow
- Minimal boilerplate
- Strong developer experience
- Clean APIs
- Modern full-stack integration
- Practical defaults
- More middleware packages
- Enhanced validation system
- Improved benchmarking suite
- Expanded CLI tooling
- Testing utilities
Contributions, issues, and feature requests are welcome.
If you find bugs or have suggestions, feel free to open an issue or submit a pull request.
MIT License

