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:
- Introduction - What is Forge and why use it?
- Quick Start - Get running in 5 minutes
- Installation - Detailed installation guide
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
- Admin Interface - Auto-generated admin panel
- REST APIs - Build APIs with serializers
- Authentication - User auth and permissions
Configuration
Set up your application:
- Configuration Overview - App and server settings
- Database Config - Database connection setup
- Logging - Logging configuration
- Security - Security settings
API Reference
Detailed technical documentation:
- Schema API - Schema definitions
- Fields - Field types and options
- Relations - Foreign keys and many-to-many
- QuerySet - Query API reference
- Manager - Manager methods
- Hooks - Lifecycle hooks
Advanced Topics
Go deeper:
- Filters - Advanced query filtering
- Identity System - User and permission management
- Server - HTTP server and middleware
- Validation - Input validation
Resources
- Support contract - What is supported, tested and excluded
- Deployment - Run one production instance
- Features - Feature list
- Changelog - Version history
- Security - Security policy
- Community - Get help and contribute
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?
- Documentation - You're here! Browse the sidebar
- GitHub Issues - Report bugs or request features
- Examples - Sample projects
Ready to build? Start with the Quick Start guide.