DEV Community

Cover image for Getting Started with Gofr: The Developer-Friendly Go Framework You Need to Try!
Akshama Chauhan
Akshama Chauhan

Posted on

Getting Started with Gofr: The Developer-Friendly Go Framework You Need to Try!

If you're a Go developer looking for a clean, opinionated framework that simplifies the boilerplate while keeping the power in your hands β€” meet Gofr. Developed by Zopsmart, Gofr is a robust Go framework that accelerates development and keeps your codebase neat and maintainable.

In this post, I’ll walk you through:

  • What Gofr is and why you should care
  • Key features that make it awesome
  • A quick-start tutorial
  • My honest review after using it

🧠 What is Gofr?
Gofr is an open-source Golang framework built to streamline the creation of microservices. It handles the heavy lifting like configuration, logging, HTTP routing, graceful shutdowns, health checks, and more β€” letting you focus on business logic.

Think of it as the Spring Boot of the Go world, but simpler and faster.

πŸ”₯ Why Gofr?
Here’s why Gofr stood out for me:

πŸ—οΈ Built-in Project Structure: Keeps your project organized from the get-go.

πŸ§ͺ Zero-config Health Checks: Instant Kubernetes-readiness.

πŸ“¦ Powerful Dependency Injection: No clutter, clean constructor-based injection.

πŸ“œ Flexible Config System: Works with files, environment variables, or secrets managers.

🧰 Tooling for Everything: Swagger, migrations, logging, metrics, the whole toolkit.

πŸš€ Quick Start: Build Your First API with Gofr
Let’s build a basic β€œHello World” API using Gofr.

Step 1: Install Gofr

go install github.com/zopsmart/gofr@latest
Step 2: Scaffold a Project

gofr init hello-api
cd hello-api
It gives you a neat project structure like:

arduino

hello-api/
β”œβ”€β”€ config/
β”œβ”€β”€ handler/
β”œβ”€β”€ model/
β”œβ”€β”€ store/
└── main.go
Step 3: Add a Handler
Edit handler/hello.go:

package handler

import (
"net/http"
"github.com/zopsmart/gofr/pkg/gofr"
)

func Hello(ctx *gofr.Context) (interface{}, error) {
return "Hello, Gofr World! πŸš€", nil
}
Step 4: Register Route
In main.go:

package main

import (
"github.com/zopsmart/gofr/pkg/gofr"
"hello-api/handler"
)

func main() {
app := gofr.New()

app.GET("/hello", handler.Hello)

app.Start()
Enter fullscreen mode Exit fullscreen mode

}
Step 5: Run It
go run main.go
Now, visit:
πŸ‘‰ http://localhost:8000/hello
and you’ll see:

arduino

"Hello, Gofr World! πŸš€"
⭐ My Review of Gofr
After using Gofr for a few weeks, here’s my honest take:

Feature Rating
Ease of Use ⭐⭐⭐⭐⭐
Documentation β­β­β­β­β˜†
Production Readiness ⭐⭐⭐⭐⭐
Community Support β­β­β­β­β˜†
Fun Factor πŸ˜„ ⭐⭐⭐⭐⭐

βœ… Pros:

Saves time with sensible defaults

Scales well for large microservices

Works great with Docker/K8s

❌ Cons:

Smaller community (but growing fast!)

Limited integrations out-of-the-box compared to giants like Gin + plugins

🎁 How to Get Gofr Swag?
Here’s the fun part β€” contribute to Gofr (even a blog like this counts) and you might earn exclusive Gofr swag from the team!

Steps to get swag:
Write and publish your review/tutorial on Dev.to, Medium, or personal blog.

Share it on Twitter or LinkedIn tagging @Zopsmart and #GofrFramework

Fill out the swag form here or connect with the Gofr team on GitHub.

πŸ“Œ Final Thoughts
If you're into Golang, Gofr is a must-try β€” it’s minimal yet powerful. Whether you're prototyping fast or scaling services, Gofr helps you focus on the logic, not the plumbing.

Happy coding!
Feel free to fork, contribute, or even show off what you've built with Gofr. πŸ™Œ

Blog by: Akshama Chauhan
3rd Year B.Tech CSIT | IoT & Full Stack Enthusiast

Top comments (0)