saaskit

module
v0.0.0-...-6067653 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2025 License: Apache-2.0

README

saaskit

⚠️ WARNING: This package is under active development and is NOT ready for production use. APIs may change without notice.

Ask DeepWiki GitHub tag (latest SemVer) Go Reference License

Tests CodeQL Analysis GolangCI Lint Go Report Card

About

SaasKit is a minimal, pragmatic Go framework for building SaaS applications. It's designed for solo developers who want to ship MVPs quickly without sacrificing code quality or type safety. The framework adheres to principles of explicitness, type safety, and convention, with escape hatches.

Quick Start

package main

import (
    "net/http"

    "github.com/go-chi/chi/v5"
    "github.com/dmitrymomot/saaskit/modules/auth"
    "github.com/dmitrymomot/saaskit/modules/billing"
)

func main() {
    r := chi.NewRouter()

    // Mount authentication module
    r.Mount("/auth", auth.Router(auth.Config{
        UserStore:   db,
        Sessions:    sessionStore,
        EmailSender: emailClient,
    }))

    // Mount billing module
    r.Mount("/billing", billing.Router(billing.Config{
        StripeKey: stripeSecretKey,
        UserStore: db,
    }))

    http.ListenAndServe(":8080", r)
}

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Directories

Path Synopsis
Package handler provides type-safe HTTP request handling for building SaaS applications in Go.
Package handler provides type-safe HTTP request handling for building SaaS applications in Go.
pkg
async
Package async provides simple, generic helpers for running computations asynchronously and waiting for their completion.
Package async provides simple, generic helpers for running computations asynchronously and waiting for their completion.
audit
Package audit provides a comprehensive audit logging system for SaaS applications with flexible storage backends, automatic context extraction, and high-throughput asynchronous processing capabilities.
Package audit provides a comprehensive audit logging system for SaaS applications with flexible storage backends, automatic context extraction, and high-throughput asynchronous processing capabilities.
auth
Package auth provides a comprehensive, extensible authentication system for SaaS applications with support for multiple authentication methods, secure token handling, and flexible provider integration.
Package auth provides a comprehensive, extensible authentication system for SaaS applications with support for multiple authentication methods, secure token handling, and flexible provider integration.
binder
Package binder provides type-safe HTTP request data binding for the saaskit framework.
Package binder provides type-safe HTTP request data binding for the saaskit framework.
broadcast
Package broadcast provides type-safe message broadcasting with subscriber management.
Package broadcast provides type-safe message broadcasting with subscriber management.
cache
Package cache provides a generic, thread-safe LRU (Least Recently Used) cache implementation for efficiently managing limited resources in memory.
Package cache provides a generic, thread-safe LRU (Least Recently Used) cache implementation for efficiently managing limited resources in memory.
clientip
Package clientip provides utilities for extracting the originating client's IP address from an *http.Request when your application is deployed behind one or more reverse proxies.
Package clientip provides utilities for extracting the originating client's IP address from an *http.Request when your application is deployed behind one or more reverse proxies.
config
Package config provides a type-safe, generic and cached way to load application configuration from environment variables.
Package config provides a type-safe, generic and cached way to load application configuration from environment variables.
cookie
Package cookie provides a secure and convenient HTTP cookie manager for Go applications.
Package cookie provides a secure and convenient HTTP cookie manager for Go applications.
email
Package email provides a provider-agnostic interface for sending transactional emails with built-in support for Postmark and type-safe email templates using templ.
Package email provides a provider-agnostic interface for sending transactional emails with built-in support for Postmark and type-safe email templates using templ.
email/templates/components
templ: version: v0.3.906
templ: version: v0.3.906
environment
Package environment provides simple helpers to propagate the current application environment (development, staging, production, etc.) through context.Context, HTTP requests and structured logs.
Package environment provides simple helpers to propagate the current application environment (development, staging, production, etc.) through context.Context, HTTP requests and structured logs.
feature
Package feature provides a comprehensive feature flag management system for Go applications.
Package feature provides a comprehensive feature flag management system for Go applications.
file
Package file provides a comprehensive file management system with support for local and S3 storage backends.
Package file provides a comprehensive file management system with support for local and S3 storage backends.
fingerprint
Package fingerprint provides utilities for generating and validating a deterministic device/browser fingerprint from an incoming HTTP request.
Package fingerprint provides utilities for generating and validating a deterministic device/browser fingerprint from an incoming HTTP request.
httpserver
Package httpserver provides a lightweight wrapper around net/http that adds graceful shutdown, configurable server timeouts, health-check handlers, and structured logging via slog.
Package httpserver provides a lightweight wrapper around net/http that adds graceful shutdown, configurable server timeouts, health-check handlers, and structured logging via slog.
i18n
Package i18n provides a simple yet powerful internationalisation (i18n) solution for Go applications.
Package i18n provides a simple yet powerful internationalisation (i18n) solution for Go applications.
jwt
Package jwt provides utilities for generating, parsing, and validating JSON Web Tokens (JWT) as well as HTTP middleware and context helpers for Go services.
Package jwt provides utilities for generating, parsing, and validating JSON Web Tokens (JWT) as well as HTTP middleware and context helpers for Go services.
logger
Package logger provides a context-aware wrapper around Go's slog package with zero-config defaults and framework-level consistency for SaaS applications.
Package logger provides a context-aware wrapper around Go's slog package with zero-config defaults and framework-level consistency for SaaS applications.
mongo
Package mongo provides MongoDB connection management optimized for SaaS applications deployed by solo developers.
Package mongo provides MongoDB connection management optimized for SaaS applications deployed by solo developers.
notifications
Package notifications provides a transport-agnostic notification system with pluggable storage and delivery mechanisms.
Package notifications provides a transport-agnostic notification system with pluggable storage and delivery mechanisms.
opensearch
Package opensearch provides a lightweight wrapper around the official OpenSearch Go client adding type-safe configuration, automatic cluster health checking, and standardized error values.
Package opensearch provides a lightweight wrapper around the official OpenSearch Go client adding type-safe configuration, automatic cluster health checking, and standardized error values.
pg
Package pg provides utilities for interacting with PostgreSQL using the pgx/v5 driver.
Package pg provides utilities for interacting with PostgreSQL using the pgx/v5 driver.
qrcode
Package qrcode provides simple helpers for generating QR code images either as raw PNG bytes or as a data-URI string that can be embedded directly into HTML pages.
Package qrcode provides simple helpers for generating QR code images either as raw PNG bytes or as a data-URI string that can be embedded directly into HTML pages.
queue
Package queue provides a repository-agnostic task queue with first-class support for immediate, delayed, and periodic execution.
Package queue provides a repository-agnostic task queue with first-class support for immediate, delayed, and periodic execution.
randomname
Package randomname provides easy-to-use helpers for generating memorable random names composed of human-readable words such as adjectives, colors, sizes, and nouns.
Package randomname provides easy-to-use helpers for generating memorable random names composed of human-readable words such as adjectives, colors, sizes, and nouns.
ratelimiter
Package ratelimiter provides token bucket rate limiting with memory storage and HTTP middleware.
Package ratelimiter provides token bucket rate limiting with memory storage and HTTP middleware.
rbac
Package rbac provides role-based access control for SaaS applications.
Package rbac provides role-based access control for SaaS applications.
redis
Package redis provides convenient helpers for connecting to a Redis server and working with it inside SaaSKit based applications.
Package redis provides convenient helpers for connecting to a Redis server and working with it inside SaaSKit based applications.
requestid
Package requestid provides HTTP middleware and helper utilities for working with request correlation identifiers (also known as request IDs).
Package requestid provides HTTP middleware and helper utilities for working with request correlation identifiers (also known as request IDs).
sanitizer
Package sanitizer provides a comprehensive collection of helper functions for cleaning, normalising and securing data of various kinds.
Package sanitizer provides a comprehensive collection of helper functions for cleaning, normalising and securing data of various kinds.
scopes
Package scopes provides a flexible and high-performance toolkit for working with OAuth-style scope strings used in authorization systems.
Package scopes provides a flexible and high-performance toolkit for working with OAuth-style scope strings used in authorization systems.
secrets
Package secrets provides high-level helpers for encrypting and decrypting tenant secrets in multi-tenant SaaS applications.
Package secrets provides high-level helpers for encrypting and decrypting tenant secrets in multi-tenant SaaS applications.
session
Package session provides flexible, high-performance session management for Go web applications.
Package session provides flexible, high-performance session management for Go web applications.
slug
Package slug provides URL-safe string generation for web applications.
Package slug provides URL-safe string generation for web applications.
statemachine
Package statemachine provides a flexible, type-safe implementation of the finite-state-machine (FSM) pattern for Go applications.
Package statemachine provides a flexible, type-safe implementation of the finite-state-machine (FSM) pattern for Go applications.
subscription
Package subscription provides comprehensive SaaS subscription management with resource limits, feature flags, trial periods, and billing provider integration.
Package subscription provides comprehensive SaaS subscription management with resource limits, feature flags, trial periods, and billing provider integration.
tenant
Package tenant provides multi-tenancy support for SaaS applications through flexible tenant identification and context management.
Package tenant provides multi-tenancy support for SaaS applications through flexible tenant identification and context management.
token
Package token provides compact, signed tokens for embedding JSON payloads.
Package token provides compact, signed tokens for embedding JSON payloads.
totp
Package totp provides a high-level API for generating, encrypting, validating, and managing Time-based One-Time Passwords (TOTP) and related recovery codes.
Package totp provides a high-level API for generating, encrypting, validating, and managing Time-based One-Time Passwords (TOTP) and related recovery codes.
totp/cmd command
useragent
Package useragent provides fast and memory-efficient parsing and classification of HTTP User-Agent strings.
Package useragent provides fast and memory-efficient parsing and classification of HTTP User-Agent strings.
validator
Package validator provides a composable set of generic, type-safe validation helpers and rule-building utilities for common data types such as strings, numbers, collections, financial values, dates, UUIDs, and more.
Package validator provides a composable set of generic, type-safe validation helpers and rule-building utilities for common data types such as strings, numbers, collections, financial values, dates, UUIDs, and more.
vectorizer
Package vectorizer provides text-to-vector conversion functionality with pluggable chunking strategies and multiple embedding provider backends.
Package vectorizer provides text-to-vector conversion functionality with pluggable chunking strategies and multiple embedding provider backends.
webhook
Package webhook provides reliable HTTP webhook delivery with automatic retries, exponential backoff, request signing, and circuit breaker protection.
Package webhook provides reliable HTTP webhook delivery with automatic retries, exponential backoff, request signing, and circuit breaker protection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL