<a href="https://goa.design">
<img alt="Goa" src="https://goa.design/img/social/goa-banner.png">
</a>
<a href="https://github.com/goadesign/goa/releases/latest"><img alt="Release" src="https://img.shields.io/github/release/goadesign/goa.svg?style=for-the-badge"></a>
<a href="https://pkg.go.dev/goa.design/goa/v3@v3.28.0/dsl?tab=doc"><img alt="Go Doc" src="https://img.shields.io/badge/godoc-reference-blue.svg?style=for-the-badge"></a>
<a href="https://github.com/goadesign/goa/actions/workflows/ci.yml"><img alt="GitHub Action: Test" src="https://img.shields.io/github/actions/workflow/status/goadesign/goa/test.yml?branch=v3&style=for-the-badge"></a>
<a href="https://goreportcard.com/report/github.com/goadesign/goa"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/goadesign/goa?style=for-the-badge"></a>
<a href="https://github.com/goadesign/goa/raw/v3.28.0/LICENSE"><img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=for-the-badge"></a>
<a href="https://gurubase.io/g/goa"><img alt="Gurubase" src="https://img.shields.io/badge/Gurubase-Ask%20Goa%20Guru-006BFF?style=for-the-badge"></a>
<a href="https://chat.openai.com/g/g-mLuQDGyro-goa-design-wizard"><img alt="Goa Design Wizard" src="https://img.shields.io/badge/Goa%20Design%20Wizard-ChatGPT-00A67D?logo=openai&logoColor=white&style=for-the-badge"></a>
<a href="https://goadesign.substack.com"><img alt="Substack: Design First" src="https://img.shields.io/badge/Design%20First-Substack-FF6719?logo=substack&logoColor=white&style=for-the-badge"></a>
<a href="https://gophers.slack.com/messages/goa"><img alt="Slack: Goa" src="https://img.shields.io/badge/Goa-Slack-4A154B?logo=slack&logoColor=white&style=for-the-badge"></a>
<a href="https://bsky.app/profile/goadesign.bsky.social"><img alt="Bluesky: Goa Design" src="https://img.shields.io/badge/Goa%20Design-Bluesky-0285FF?logo=bluesky&logoColor=white&style=for-the-badge"></a>
Goa transforms how you build APIs and microservices in Go with its powerful design-first approach. Instead of writing boilerplate code, you express your API's intent through a clear, expressive DSL. Goa then automatically generates production-ready code, comprehensive documentation, and client libraries—all perfectly aligned with your design.
The result? Dramatically reduced development time, consistent APIs, and the elimination of the documentation-code drift that plagues traditional development.
incident.io: Bounce back stronger after every incidentUse our platform to empower your team to run incidents end-to-end. Rapidly fix and learn from incidents, so you can build more resilient products. Learn more |
Speakeasy: Enterprise DevEx for your APIOur platform makes it easy to create feature-rich production ready SDKs. Speed up integrations and reduce errors by giving your API the DevEx it deserves. Integrate with Goa |
Traditional API development suffers from: - Inconsistency: Manually maintained docs that quickly fall out of sync with code - Wasted effort: Writing repetitive boilerplate and transport-layer code - Painful integrations: Client packages that need constant updates - Design afterthoughts: Documentation added after implementation, missing key details
Goa solves these problems by: - Generating 30-50% of your codebase directly from your design - Ensuring perfect alignment between design, code, and documentation - Supporting multiple transports (HTTP, gRPC, and JSON-RPC) from a single design - Maintaining a clean separation between business logic and transport details
┌─────────────┐ ┌──────────────┐ ┌─────────────────────┐
│ Design API │────>│ Generate Code│────>│ Implement Business │
│ using DSL │ │ & Docs │ │ Logic │
└─────────────┘ └──────────────┘ └─────────────────────┘
goa gen to create server interfaces, client code, and documentation# Install Goa
go install goa.design/goa/v3/cmd/goa@latest
# Create a new module
mkdir hello && cd hello
go mod init hello
# Define a service in design/design.go
mkdir design
cat > design/design.go << EOF
package design
import . "goa.design/goa/v3/dsl"
var _ = Service("hello", func() {
Method("say_hello", func() {
Payload(func() {
Field(1, "name", String)
Required("name")
})
Result(String)
HTTP(func() {
GET("/hello/{name}")
})
})
})
EOF
# Generate the code
goa gen hello/design
goa example hello/design
# Build and run
go mod tidy
go run cmd/hello/*.go --http-port 8000
# In another terminal
curl http://localhost:8000/hello/world
The example above: 1. Defines a simple "hello" service with one method 2. Generates server and client code 3. Starts a server that logs requests server-side (without displaying any client output)
For a JSON-RPC service, simply add a JSONRPC expression to the service and
method:
var _ = Service("hello" , func() {
JSONRPC(func() {
Path("/jsonrpc")
})
Method("say_hello", func() {
Payload(func() {
Field(1, "name", String)
Required("name")
})
Result(String)
JSONRPC(func() {})
})
}
Then test with:
curl -X POST http://localhost:8000/jsonrpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"hello.say_hello","params":{"name":"world"},"id":"1"}'
Our documentation site at goa.design provides comprehensive guides and references:
Using a coding agent with Goa? See skills/ for reusable Agent Skills that help agents follow Goa's design-first workflow in application repositories.
The examples repository contains complete, working examples demonstrating:
MIT License - see LICENSE for details.