MCPcopy
hub / github.com/gofr-dev/gofr

github.com/gofr-dev/gofr @v1.57.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.57.0 ↗
17,415 symbols 59,880 edges 687 files 6,980 documented · 40%
README

GoFr

logo

GoFr: An Opinionated Microservice Development Framework

godoc gofr-docs Maintainability Code Coverage Go Report Card Apache 2.0 License discord

Listed in the CNCF Landscape

🎯 Goal

GoFr is designed to simplify microservice development, with a key focus on Kubernetes deployment and out-of-the-box observability. While capable of building generic applications, microservices remain at its core.


💡 Key Features

  1. Simple API Syntax
  2. REST Standards by Default
  3. Configuration Management
  4. Observability (Logs, Traces, Metrics)
  5. Inbuilt Auth Middleware & Custom Middleware Support
  6. gRPC Support
  7. HTTP Service with Circuit Breaker Support
  8. Pub/Sub
  9. Health Check for All Datasources
  10. Database Migration
  11. Cron Jobs
  12. Support for Changing Log Level Without Restarting
  13. Swagger Rendering
  14. Abstracted File Systems
  15. Websockets

🚀 Getting Started

Prerequisites

  • GoFr requires Go version 1.24 or above.

Installation

To get started with GoFr, add the following import to your code and use Go’s module support to automatically fetch dependencies:

import "gofr.dev/pkg/gofr"

Alternatively, use the command:

go get -u gofr.dev/pkg/gofr

🏃 Running GoFr

Here's a simple example to get a GoFr application up and running:

package main

import "gofr.dev/pkg/gofr"

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

    app.GET("/greet", func(ctx *gofr.Context) (any, error) {
        return "Hello World!", nil
    })

    app.Run() // listens and serves on localhost:8000
}

To run this code:

$ go run main.go

Visit localhost:8000/greet to see the result.


📂 More Examples

Explore a variety of ready-to-run examples in the GoFr examples directory.


👩‍💻 Documentation


👍 Contribute

Join Us in Making GoFr Better

Share your experience: If you’ve found GoFr helpful, consider writing a review or tutorial on platforms like Medium, Dev.to, or your personal blog. Your insights could help others get started faster!

Contribute to the project: Want to get involved? Check out our CONTRIBUTING.md guide to learn how you can contribute code, suggest improvements, or report issues.


🔒 Secure Cloning

To securely clone the GoFr repository, you can use HTTPS or SSH:

Cloning with HTTPS

git clone https://github.com/gofr-dev/gofr.git

Cloning with SSH

git clone git@github.com:gofr-dev/gofr.git

🎁 Get a GoFr T-Shirt & Stickers!

If your PR is merged, or if you contribute by writing articles or promoting GoFr, we invite you to fill out this form to claim your GoFr merchandise as a token of our appreciation!

Partners

JetBrains logo

Extension points exported contracts — how you extend this code

Request (Interface)
Request is an interface which is written because it allows us to create applications without being aware of the transpor [11 …
pkg/gofr/request.go
HelloServerWithGofr (Interface)
HelloServerWithGofr is the interface for the server implementation [11 implementers]
examples/grpc/grpc-unary-server/server/hello_gofr.go
SQLConnector (Interface)
SQLConnector is implemented by pluggable SQL datasource providers (for example GCP Cloud SQL with IAM auth, in module go [87 …
pkg/gofr/external_db.go
ChatServiceServerWithGofr (Interface)
ChatServiceServerWithGofr is the interface for the server implementation [7 implementers]
examples/grpc/grpc-streaming-server/server/chatservice_gofr.go
Cassandra (Interface)
Cassandra is an interface representing a cassandra database Deprecated: Cassandra interface is deprecated and will be re [8 …
pkg/gofr/container/datasources.go
HelloGoFrClient (Interface)
(no doc) [11 implementers]
examples/grpc/grpc-unary-client/client/hello_client.go
Elasticsearch (Interface)
Elasticsearch defines all the operations GoFr users need. [8 implementers]
pkg/gofr/container/datasources.go
ChatServiceGoFrClient (Interface)
(no doc) [7 implementers]
examples/grpc/grpc-streaming-client/client/chatservice_client.go

Core symbols most depended-on inside this repo

x
called by 1603
pkg/gofr/static/swagger-ui-bundle.js
u
called by 1413
pkg/gofr/static/swagger-ui-bundle.js
append
called by 1148
pkg/gofr/static/swagger-ui-bundle.js
get
called by 940
pkg/gofr/static/swagger-ui-bundle.js
push
called by 932
pkg/gofr/static/swagger-ui-bundle.js
Errorf
called by 802
pkg/gofr/migration/logger.go
Error
called by 791
pkg/gofr/migration/logger.go
Run
called by 693
pkg/gofr/datasource/couchbase/interfaces.go

Shape

Method 8,708
Function 6,381
Class 1,034
Struct 992
Interface 259
TypeAlias 28
FuncType 13

Languages

Go70%
TypeScript30%

Modules by API surface

pkg/gofr/static/swagger-ui-bundle.js3,958 symbols
pkg/gofr/container/mock_datasources.go2,102 symbols
pkg/gofr/static/swagger-ui.js899 symbols
pkg/gofr/static/swagger-ui-standalone-preset.js373 symbols
pkg/gofr/datasource/arangodb/mock_interfaces.go272 symbols
pkg/gofr/migration/mock_interface.go228 symbols
pkg/gofr/datasource/pubsub/nats/mock_jetstream.go204 symbols
pkg/gofr/container/datasources.go185 symbols
pkg/gofr/datasource/file/mock_interface.go164 symbols
pkg/gofr/datasource/arangodb/mock_collection.go106 symbols
pkg/gofr/datasource/arangodb/mock_graph.go102 symbols
pkg/gofr/datasource/arangodb/mock_database.go102 symbols

Dependencies from manifests, versioned

cel.dev/exprv0.25.1 · 1×
cloud.google.com/gov0.123.0 · 1×
cloud.google.com/go/authv0.20.0 · 1×
cloud.google.com/go/auth/oauth2adaptv0.2.8 · 1×
cloud.google.com/go/cloudsqlconnv1.17.2 · 1×
cloud.google.com/go/compute/metadatav0.9.0 · 1×
cloud.google.com/go/longrunningv0.9.0 · 1×
cloud.google.com/go/monitoringv1.24.3 · 1×
cloud.google.com/go/pubsubv1.50.2 · 1×
cloud.google.com/go/pubsub/v2v2.4.0 · 1×
cloud.google.com/go/storagev1.62.2 · 1×

Datastores touched

(mysql)Database · 1 repos
postgresDatabase · 1 repos
(mongodb)Database · 1 repos
mydbDatabase · 1 repos
mydbDatabase · 1 repos

For agents

$ claude mcp add gofr \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact