Skip to main content
Open source, MIT licensed, pre-1.0

Define the model.
Forge builds the rest.

Forge is a batteries-included web framework for Go. Describe your data once, and Forge generates typed queries, SQL migrations, a REST API and an admin panel for it.

$go install github.com/forgego/forge/cmd/forge@latest
How it fits together

One definition, four outputs

Write the model. Forge reads it to build queries, the admin and the API.

Go 1.26+
Describe fields, indexes and relations in plain Go. Everything else is generated from this.
package catalog

import "github.com/forgego/forge/schema"

type Product struct {
    schema.BaseSchema
}

func (Product) Fields() []schema.Field {
    return []schema.Field{
        schema.Int64Field("id", schema.Primary(), schema.AutoIncrement()),
        schema.StringField("name", schema.Required(), schema.MaxLength(200)),
        schema.StringField("sku", schema.Required(), schema.Unique()),
        schema.Float64Field("price", schema.Required()),
        schema.BoolField("is_active", schema.Default(true)),
        schema.TimeField("created_at", schema.AutoNowAdd()),
    }
}

func (Product) Meta() schema.Meta {
    return schema.Meta{TableName: "products", OrderBy: []string{"name"}}
}
The admin

An admin for every model you register

Search, filters, saved views, bulk actions and export. Shown here with the ecommerce example.

Forge admin showing the product list from the ecommerce exampleForge admin showing the product list from the ecommerce example
Try it

See a complete Forge app running

The ecommerce example has 57 models across 10 apps, with the admin and REST API wired up. Docker runs it with PostgreSQL.

1

Clone the repository

The example lives in examples/ecommerce.

git clone https://github.com/forgego/forge.git
2

Start it with Docker

Builds the app and the admin UI, and starts PostgreSQL.

cd forge/examples/ecommerce && docker compose up --build
3

Open the admin

Browse the generated admin for every model in the example.

http://localhost:8020/admin/

Know what you are adopting

Forge is pre-1.0. PostgreSQL is the primary tested database. The capability status page lists what is verified in CI and what is still partial.