🌐 US-Proxy
dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo">
Skip to content

SystemForge

Batteries-included Go platform module for multi-tenant SaaS applications.

SystemForge provides reusable identity, session, RBAC, and OAuth 2.0 functionality that you can integrate into your Go applications. Think of it as Django/Laravel for Goβ€”pre-built components for the things every SaaS needs.

Features

  • Identity Management: Users, organizations, memberships with role-based access
  • OAuth 2.0 Server: Full RFC-compliant implementation using Fosite
  • API Key Authentication: Secure server-to-server access
  • Service Accounts: JWT Bearer authentication for automation
  • Multi-Tenant Ready: Organization-scoped resources with RLS support
  • Ent ORM: Type-safe database schemas with migrations

Quick Example

package main

import (
    "github.com/grokify/systemforge/identity/ent"
    "github.com/grokify/systemforge/identity/oauth"
)

func main() {
    // Connect to database
    client, _ := ent.Open("postgres", "postgres://...")

    // Create OAuth provider
    cfg := oauth.DefaultConfig("https://api.example.com", []byte("secret"))
    provider, _ := oauth.NewProvider(client, cfg)

    // Create OAuth API (Huma/Chi)
    api, _ := oauth.NewAPI(provider)

    // Mount the API router
    http.Handle("/", api.Router())
    http.ListenAndServe(":8080", nil)
}

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Your Application                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                        SystemForge                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Identity β”‚  β”‚  OAuth   β”‚  β”‚   RBAC   β”‚  β”‚ Feature  β”‚  β”‚
β”‚  β”‚  Module  β”‚  β”‚  Server  β”‚  β”‚  Module  β”‚  β”‚  Flags   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                      Ent ORM Layer                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                      PostgreSQL                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Module Status

Module Status Description
Identity βœ… Ready User, Org, Membership, OAuthAccount
OAuth 2.0 βœ… Ready Authorization Code, Client Credentials, Refresh Token
API Keys βœ… Ready Server-to-server authentication
Service Accounts βœ… Ready JWT Bearer authentication
RBAC 🚧 Planned Role-based access control
Feature Flags 🚧 Planned Feature flag engine
RLS Helpers 🚧 Planned PostgreSQL Row-Level Security

Why SystemForge?

Building a SaaS application means implementing the same foundational features over and over:

  • User authentication and registration
  • Organization/team management
  • OAuth 2.0 for third-party integrations
  • API key management for developers
  • Role-based permissions

SystemForge provides battle-tested implementations of these features so you can focus on your application's unique value.

Getting Started

License

Apache 2.0