A gRPC-Gateway-powered framework with Prisma, Kubernetes, and Go for scalable microservices.
- ✔️ gRPC + REST (gRPC-Gateway) – Automatically expose RESTful APIs from gRPC services.
- ✔️ Prisma Integration – Efficient database management and migrations.
- ✔️ Kubernetes Ready – Easily deploy and scale with Kubernetes.
- ✔️ TLS Security – Secure gRPC communications with TLS.
- ✔️ Structured Logging – Built-in
zap
logging. - ✔️ Rate Limiting & Authentication – Pre-configured middleware.
- ✔️ Modular & Extensible – Easily extend Thunder for custom use cases.
- ✔️ Thunder CLI - Generate, deploy, and create new projects effortlessly.
Thunder is designed for scalable microservices and high-performance API development, particularly suited for:
- gRPC-first APIs with RESTful interfaces via gRPC-Gateway.
- Critical performance and low latency applications.
- Strongly-typed APIs with protobufs.
- Efficient inter-service communication.
- Kubernetes deployments with built-in service discovery and scaling.
- Type-safe queries and easy database migrations.
- Support for multiple databases (PostgreSQL, MySQL, SQLite).
- A minimalist and powerful alternative to traditional frameworks like Gin or Echo.
- Fast, simple, and modular backend without unnecessary overhead.
- Containerized environments using Docker.
- Automatic service scaling and load balancing.
- If you need a traditional REST-only API (use Gin, Fiber, or Echo instead).
- If you require a feature-heavy web framework with extensive middleware.
- If you're not deploying on Kubernetes or prefer a monolithic backend.
git clone https://github.com/Raezil/Thunder.git
cd Thunder
chmod +x install-thunder.sh
./install-thunder.sh
Create a new Thunder application:
thunder new myapp
cd myapp
go mod tidy
Create a .proto
file (e.g., example.proto
):
syntax = "proto3";
package example;
import "google/api/annotations.proto";
service Example {
rpc SayHello(HelloRequest) returns (HelloResponse) {
option (google.api.http) = {
post: "/v1/example/sayhello"
body: "*"
};
};
}
message HelloRequest {
string name = 1;
}
message HelloResponse {
string message = 1;
}
Add your service entry in routes/route.go
:
package routes
var Services = []Service{
{
ServiceName: "Example",
ServiceStruct: "ExampleServiceServer",
ServiceRegister: "RegisterExampleServer",
HandlerRegister: "RegisterExampleHandler",
},
}
Define your schema in schema.prisma
:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @default(cuid()) @id
name String
email String @unique
}
Generate the service implementation:
thunder generate --proto=example.proto
Start the server:
go run ./server/main.go
Server accessible via HTTP at localhost:8080
and gRPC at localhost:50051
.
cd backend
mockgen -source=yourservice_grpc.pb.go -destination=yourservice_mock.go
go test ./backend/... ./db/...
mkdir certs
openssl req -x509 -newkey rsa:4096 -keyout certs/server.key -out certs/server.crt -days 365 -nodes \
-subj "/CN=localhost" \
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1"
kubectl create secret generic app-secret --from-literal=DATABASE_URL="postgres://postgres:postgres@pgbouncer-service:6432/thunder?sslmode=disable" --from-literal=JWT_SECRET="secret"
kubectl create secret generic postgres-secret --from-literal=POSTGRES_USER=postgres --from-literal=POSTGRES_PASSWORD=postgres --from-literal=POSTGRES_DB=thunder
thunder docker
thunder deploy
Check pod status:
kubectl get pods -n default
kubectl describe pod $NAME -n default
curl -k --http2 -X POST https://localhost:8080/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "password123",
"name": "John",
"surname": "Doe",
"age": 30
}'
curl -k --http2 -X POST https://localhost:8080/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "password123"
}'
- Fork the repository.
- Create a feature branch:
git checkout -b feature-new
- Commit changes:
git commit -m "Added feature"
- Push to your branch:
git push origin feature-new
- Submit a pull request.
⭐ Star the repository if you find it useful!
📧 For support, use GitHub Issues.
Thunder is released under the MIT License.