Skip to content

Golang Rest Framework (Gorf)

Go Go Reference

Django inspired Rest Framework for Golang.


Introducing Gorf, the Golang REST API framework that empowers developers to easily create and reuse modular apps. Inspired by the simplicity and flexibility of Python Django, Gorf utilizes the full MVC architecture, providing dedicated model, URL, and view files for effortless understanding. Gorf's plug and play app concept enables infinite scalability and customization, making Gorf the go-to solution for anyone looking to kickstart a new project in Golang. Join our community and contribute your ideas and innovations to build a framework that streamlines the development process for all.


  • Generic
  • Simplicity
  • Based on known architecture
  • Reusability
  • Support for apps
  • Custom database backends
  • More feature work in progress


go get
Install gorf auth app
go get

Quickstart new project using gorf-cli

Install gorf-cli for creating new projects and apps. Make sure you have configured Go install directory to your system's shell path

go install

Once cli is installed new gorf project can be initialized as follows

gorf-cli init hello

Now go tho the project directory and run the project as follows

cd hello
go run .
Now open the browser and go to http://localhost:8080/health.

new gorf apps can be created using

gorf-cli app newApp

Tutorial without cli

Firstly, Create a new main package with following code

package main

import (

func main() {
    r := BootstrapRouter()
    err := r.Run()
    if err != nil {
        log.Fatal("Unable to create the gin server")
    } // listen and serve on (for windows "localhost:8080")


Next, Create a settings.go file in the main package with the following code snippet

package main

import (

// add all the apps
var apps = []gorf.GorfApp{

func LoadSettings() {
    // jwt secret key
    gorf.Settings.SecretKey = "GOo8Rs8ht7qdxv6uUAjkQuopRGnql2zWJu08YleBx6pEv0cQ09a"
    gorf.Settings.DbConf = &gorf.SqliteBackend{
        Name: "db.sqlite",

// bootstrap server
func BootstrapRouter() *gin.Engine {
    gorf.Apps = append(apps)
    r := gin.Default()
    return r

Write your own apps

Create a new package named "hello"

add app.go file

package hello

import (

func setup() error {
    // Add setup here
    return nil

var HelloApp = gorf.GorfBaseApp{
    Name:         "Hello",
    RouteHandler: Urls,
    SetUpHandler: setup,

add urls.go file

package hello

import ""

func Urls(r *gin.Engine) {
    r.POST("/hello", Hello)

add views.go file

package hello

import (

func Hello(ctx *gin.Context) {
    ctx.JSON(http.StatusOK, gin.H{
        "message": "Hello world",

Check the Gorf project template