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