Lightning is a modular, production-ready collection of Go libraries that helps backend developers build reliable applications faster. It reduces boilerplate by offering reusable components for key tasks such as:
- HTTP routing with authentication guards and middleware
- gRPC server and client setup with service registration
- Internationalization (i18n) support
- Kafka integration
- Redis integration
- Structured, context-aware logging
- Configuration management with environment overrides
Designed to be simple, extensible, and easy to adopt, Lit lets teams focus on business logic instead of infrastructure scaffolding.
| Name | Status |
|---|---|
| Pipeline | |
| Coverage | |
| Code Quality | |
| Go Report | |
| Go Reference | |
| Release Version | |
| Tag Version | |
| License |
Lightning (Lit) includes comprehensive instructions for AI coding assistants to help you develop faster:
- GitHub Copilot & Cursor - Complete framework reference for inline suggestions
- Claude AI - Detailed architectural guide with common pitfalls and best practices
- Generic AI Assistants - Quick-start guide for all AI coding tools
These files provide guidance on:
- Core architectural patterns (functional options, context propagation)
- Testing requirements and best practices
- Common development workflows
- Security and performance considerations
See .github/AI-INSTRUCTIONS-README.md for details on which file to use.
Detailed documentation is available in the docs/ directory:
- Getting Started - Installation and hello world
- HTTP Services - Building HTTP APIs
- gRPC Services - gRPC server and client setup
- Authentication & Authorization - JWT and Casbin integration
- Monitoring - Logging, tracing, and error reporting
- Kafka Messaging - Message broker integration
- Redis Caching - Caching layer
- Testing - Testing utilities and patterns
Install Lightning:
go get github.com/viebiz/lit@latestCreate a simple HTTP server:
package main
import (
"context"
"net/http"
"github.com/viebiz/lit"
)
func main() {
r := lit.NewRouter(context.Background())
r.Get("/", func(c lit.Context) error {
return c.String(http.StatusOK, "Hello, World!")
})
srv := lit.NewHttpServer(":8080", r.Handler())
if err := srv.Run(); err != nil {
panic(err)
}
}We welcome contributions! Please see CONTRIBUTING.md for guidelines on:
- Code style and formatting
- Testing requirements
- Development workflow
- Pull request process
Lightning is licensed under the Apache-2.0 License. See LICENSE for details.