You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The open-source, tenancy-native identity and access foundation for SaaS apps.
SaaSKit provides the foundational infrastructure every multi-tenant SaaS application needs: authentication, organizations, and access control — done once, done well, and reusable across projects.
A credible open-source alternative to Keycloak with better developer experience.
Features (v1.0 — in progress)
Email/password authentication with Argon2id password hashing
JWT access tokens with asymmetric signing (RS256, ES256, EdDSA)
Generic token system — password resets, email verification, invites, magic links — one table
Quick Start
# Clone the repository
git clone https://github.com/medaminerjb/saas-kit.git
cd saaskit
# Copy the example env file
cp .env.example .env
# Start PostgreSQL and SaaSKit
docker compose up
# Or run locally (requires PostgreSQL)
make migrate-up
make run-direct
Configuration is loaded from environment variables (prefix SAASKIT_) with optional YAML fallback. See .env.example for all options.
Key Environment Variables
Variable
Description
Default
SAASKIT_ENV
Environment (development, production)
development
SAASKIT_PORT
HTTP server port
8080
SAASKIT_BASE_URL
Public base URL for callbacks
http://localhost:8080
SAASKIT_DATABASE_HOST
PostgreSQL host
localhost
SAASKIT_DATABASE_PORT
PostgreSQL port
5432
SAASKIT_DATABASE_USER
PostgreSQL user
saaskit
SAASKIT_DATABASE_PASSWORD
PostgreSQL password
—
SAASKIT_DATABASE_NAME
PostgreSQL database name
saaskit
SAASKIT_DATABASE_SSLMODE
SSL mode (disable, require, verify-full)
disable
SAASKIT_JWT_ALGORITHM
Signing algorithm (RS256, ES256, EdDSA)
RS256
SAASKIT_JWT_KEY_PATH
Path to signing keys
./keys
SAASKIT_SERVER_SECRET
HMAC secret for token hashing
—
SAASKIT_ENCRYPTION_MASTER_KEY
32-byte hex key for envelope encryption
—
SAASKIT_OAUTH_GOOGLE_CLIENT_ID
Google OAuth2 client ID
—
SAASKIT_OAUTH_GOOGLE_CLIENT_SECRET
Google OAuth2 client secret
—
SAASKIT_OAUTH_GITHUB_CLIENT_ID
GitHub OAuth2 client ID
—
SAASKIT_OAUTH_GITHUB_CLIENT_SECRET
GitHub OAuth2 client secret
—
Development
make help# Show all available commands
make build # Build binary
make test# Run tests
make lint # Run linter
make migrate-up # Run database migrations
make sqlc # Regenerate sqlc code
make keys # Generate development signing keys
make docker-up # Start with Docker Compose
Technology Stack
Component
Choice
Why
Language
Go 1.22+
Performance, simplicity, stdlib
HTTP
chi/v5
Lightweight, stdlib-compatible
Database
PostgreSQL 16 + pgx/v5
Gold-standard driver
Queries
sqlc
Compile-time type safety
Migrations
goose
SQL-first, simple
JWT
golang-jwt/v5
Community standard
OIDC
zitadel/oidc/v3
OIDC-certified
Password Hash
Argon2id
OWASP recommended
Config
koanf
Lightweight, no global state
Logging
slog
Zero dependency, structured
Roadmap
See the full roadmap for detailed plans through v3.0.
✅ Foundation — scaffold, DB, config, crypto, events, jobs