View on GitHub

Smart Application Framework (SAF)

Open-source, cross-platform framework for distributed applications across cloud and edge.

Smart Application Framework (SAF)

License NuGet .NET

SAF is an open-source, cross-platform framework for building distributed applications across cloud and edge. It lets you compose applications from independently deployable plug-ins that communicate exclusively through a shared messaging infrastructure — keeping plug-ins loosely coupled and independently replaceable.

What SAF Does

SAF builds on top of .NET’s Microsoft.Extensions.Hosting and adds:

Layer What it provides
Plugin System Assembly-isolated plug-in loading, independent DI containers per plug-in, typed cross-plug-in service resolution, in-process reload on configuration changes
SAF Host Opinionated host wiring: service host identity, plug-in folder discovery, optional diagnostics
Messaging Infrastructure Exchangeable pub/sub broker (In-Process, Redis, NATS, C-DEngine, or Routing)
Storage Infrastructure Exchangeable key/value store (LiteDB, SQLite, Redis, C-DEngine)
Secret Store Keep credentials out of configuration files, in an OS-level store (Windows Credential Manager or a cross-platform encrypted file store)
Toolbox Services Ready-made helpers: Heartbeat, Request/Reply client, File Transfer

Core Design Principles

Architecture Overview

graph TB
    subgraph Host Process
        H[".NET Generic Host"] --> SAF[SAF Host]
        SAF --> PS[Plugin System]
        PS --> |"loads & isolates"| PA["Plugin A\n(own DI container)"]
        PS --> |"loads & isolates"| PB["Plugin B\n(own DI container)"]

        subgraph "Shared Infrastructure (injected into every plugin)"
            MSG[IMessagingInfrastructure]
            STO[IStorageInfrastructure]
            SEC[ISecretStore]
        end

        PA --- MSG
        PA --- STO
        PA --- SEC
        PB --- MSG
        PB --- STO
        PB --- SEC
    end

    PA -->|"publish(topic, payload)"| MSG
    MSG -->|"subscribe(topic)"| PB

Package Overview

Package Purpose
SAF.Common Core interfaces: IStorageInfrastructure, IServiceHostInfo
SAF.Messaging.Contracts Core interfaces: IMessagingInfrastructure, IMessageHandler, Message
SAF.Messaging.Runtime Runtime wiring: resolves the primary IMessagingInfrastructure plug-in
SAF.Messaging.InProcess In-memory messaging (development / tests)
SAF.Messaging.Redis Redis-backed messaging and storage
SAF.Messaging.NATS NATS-backed messaging and storage
SAF.Messaging.Cde C-DEngine-backed messaging
SAF.Messaging.Routing Fan-out / routing across multiple brokers
SAF.Storage.LiteDb LiteDB-backed key/value storage
SAF.Storage.SQLite SQLite-backed key/value storage
SAF.Configuration.Secrets.Contracts Secret store contracts: ISecretStore, SecretStoreOptions, SecretReference
SAF.Configuration.Secrets Secret store providers (Windows Credential Manager, cross-platform file store), the default PkcsSecretProtector, and provider selection
SAF.Configuration.Secrets.Extensions Secret store host-builder integration (AddSecretStore, AddSecretConfigurationResolution)
SAF.PluginSystem.Hosting Plugin loading engine
SAF.PluginSystem.Hosting.Contracts Plugin contracts: IPluginManifest, IServicePlugin, IPluginAssemblyValidator, validation context/result
SAF.PluginSystem.Hosting.Extensions Plugin-system convenience extensions and built-in assembly validators
SAF.Hosting SAF-specific host wiring on top of the plugin system
SAF.Toolbox Heartbeat, RequestClient, FileTransfer helpers

Documentation