Skip to main content

Forge Documentation

Welcome to Forge, a Go framework that brings Django-style rapid development to the Go ecosystem. Build database-backed web applications with type-safe queries, auto-generated admin interfaces, and REST APIs.

Getting Started​

New to Forge? Start here:

Core Guides​

Learn the fundamentals:

Database & Models​

  • Models - Define your data structure with schemas
  • ORM - Query data with type-safe expressions
  • Migrations - Manage schema changes

Build Features​

Configuration​

Set up your application:

API Reference​

Detailed technical documentation:

Advanced Topics​

Go deeper:

Resources​

What You Get​

Forge provides everything you need to build web applications:

  • Type-Safe ORM - Query with full compile-time safety
  • Admin - Register a model to manage it in the bundled admin
  • REST APIs - Serializers, auth, and pagination built-in
  • Migrations - Track and apply database changes
  • Code Generation - Generate type-safe queries and managers
  • Security - Sessions, CSRF and production secret checks by default; CORS and rate-limiting middleware to add
  • Authentication - Multiple auth backends included
  • CLI Tools - Powerful command-line interface

Quick Example​

Define a model and start querying:

package models

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

type Article struct {
schema.BaseSchema
}

func (Article) Fields() []schema.Field {
return []schema.Field{
schema.Int64Field("id", schema.Primary(), schema.AutoIncrement()),
schema.StringField("title", schema.MaxLength(200)),
schema.TextField("content"),
schema.TimeField("published_at", schema.AutoNow()),
}
}

Type-safe queries with autocomplete:

// ArticleObjects and ArticleFieldsInstance are written by `forge generate`
a := models.ArticleFieldsInstance

qs, err := models.ArticleObjects.Filter(a.Title.Contains("Go"))
if err != nil {
return err
}
articles, err := qs.OrderBy(a.PublishedAt.Desc()).Limit(10).All(ctx)

Need Help?​

Ready to build? Start with the Quick Start guide.