---
title: Go Code Gen
group: integrations
---

## Go Code Gen

The "Go Code Gen" extension allows you to generate a fully operational Go server with Protobuf integration to manage your application's data layer based on the defined data model.

In the extensions panel, click on the "Go Code Gen" extension. A modal window will appear with the configuration settings:

![Go Code Gen Configuration](/docs-images/go-code-gen-setup.webp)

- **Project Configuration**:
  - **Project Identifier**: The unique name or identifier for this generated project.
  - **Go Module Path**: The Go module path for Go packages (e.g., `github.com/username/project`).
- **Core Business Layer**:
  - **Generate Core logic & models**: Automatically enabled to generate your database entities, repositories, and validation rules.
  - **Database Type**: Select the target database engine: `MySQL` or `PostgreSQL`.
  - **Event Transport**: Optional event system broker (`Disabled` or `Apache Kafka`) to stream data change notifications.
- **Protocols & API Servers**:
  - **Protobuf Definitions**: If enabled, generates `.proto` schema definitions for your entities.
  - **gRPC Server Layer**: If enabled, generates type-safe gRPC service handlers (requires Protobuf).
  - **REST Server Layer**: If enabled, generates standard HTTP REST endpoints and OpenAPI specification files.
  - **gRPC Port**: The network port where the gRPC server will listen (defaults to `50051`).
  - **REST Port**: The network port where the REST HTTP server will listen (defaults to `8080`).
- **DevOps & Authentication**:
  - **Authentication Middleware**: Configures auth middleware for endpoints (`Disabled`, `JWT (JSON Web Token)`, or `Keycloak OpenID`).
  - **Dockerfile Containerization**: If enabled, generates a multi-stage Docker build file for containerizing the Go service.
  - **Helm Charts Deployment**: If enabled, generates Kubernetes Helm chart files in a `.helm` folder.
  - **GitHub Actions CI/CD**: If enabled, generates continuous integration configuration files for GitHub Actions.

Once configured and executed, the code generator:
1. Validates base model dependencies.
2. Generates the Go code structure, Protobuf schemas, database query managers, Docker/Helm configurations, and CI/CD pipelines.
3. Compresses the complete server project into a ZIP file.
4. Generates a download link for you to retrieve the code.

## Run via CLI

You can also run the Go Code Gen extension directly on your machine using the nuzur CLI. This writes the generated server project files directly to your local filesystem without requiring you to download a ZIP archive from the browser:

```bash
nuzur-cli go-code-gen
```

The CLI will guide you to select your project, version, configuration settings, and the output folder where the generated files will be written.

## Next steps
- [Protobuf Generator](/docs/extensions-proto-gen)
- [SQL Gen Extension](/docs/extensions-generate)
- [Data manager overview](/docs/data-manager-overview)
