SaaS-Factory.AppBlueprint.Infrastructure 1.0.0

dotnet add package SaaS-Factory.AppBlueprint.Infrastructure --version 1.0.0
                    
NuGet\Install-Package SaaS-Factory.AppBlueprint.Infrastructure -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SaaS-Factory.AppBlueprint.Infrastructure" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SaaS-Factory.AppBlueprint.Infrastructure" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SaaS-Factory.AppBlueprint.Infrastructure" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SaaS-Factory.AppBlueprint.Infrastructure --version 1.0.0
                    
#r "nuget: SaaS-Factory.AppBlueprint.Infrastructure, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SaaS-Factory.AppBlueprint.Infrastructure@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SaaS-Factory.AppBlueprint.Infrastructure&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SaaS-Factory.AppBlueprint.Infrastructure&version=1.0.0
                    
Install as a Cake Tool

AppBlueprint.Infrastructure

NuGet Version License: MIT

Overview

The AppBlueprint.Infrastructure package provides the infrastructure layer implementation for the AppBlueprint template. This package contains database repositories, external service integrations, and other infrastructure concerns following Clean Architecture and Domain-Driven Design principles.

Features

Database & Persistence

  • Entity Framework Core integration with PostgreSQL
  • Multiple Database Contexts:
    • ApplicationDBContext
    • BaselineDBContext
    • B2BDBContext
    • B2CDBContext
  • Repository implementations for domain aggregates
  • Data seeding for each database table
  • Database migrations applied to ApplicationDBContext
  • Optimistic concurrency control
  • Domain event publishing
  • Health checks for database connectivity

External Service Integrations

  • Email services via Resend
  • Payment processing via Stripe
  • Cloud storage via AWS S3/Azure Blob/Cloudflare R2
  • Authentication and authorization infrastructure
  • Identity providers integration
  • Messaging systems integration

Caching & Performance

  • Redis caching implementation
  • Distributed caching abstractions
  • Performance monitoring

Infrastructure Services

  • Reverse proxy configuration with YARP
  • Data protection and security services
  • Configuration management with user secrets support
  • GraphQL client implementations via Kiota
  • System clock abstractions

Health Monitoring

  • PostgreSQL health checks
  • Redis health checks
  • URI endpoint health checks

Installation

dotnet add package SaaS-Factory.AppBlueprint.Infrastructure

Dependencies

This package includes the following key dependencies:

  • Microsoft.EntityFrameworkCore - ORM for database operations
  • Npgsql.EntityFrameworkCore.PostgreSQL - PostgreSQL provider
  • Microsoft.AspNetCore.Authorization - Authorization framework
  • Stripe.net - Stripe payment integration
  • AWSSDK.S3 - AWS S3 storage integration
  • Resend - Email service integration
  • Yarp.ReverseProxy - Reverse proxy functionality

Usage

Database Context Registration

services.AddDbContext<ApplicationDbContext>(options =>
    options.UseNpgsql(connectionString));

Repository Pattern

public interface IRepository<T> where T : class
{
    Task<T> GetByIdAsync(int id);
    Task<IEnumerable<T>> GetAllAsync();
    Task AddAsync(T entity);
    Task UpdateAsync(T entity);
    Task DeleteAsync(int id);
}

Health Checks

services.AddHealthChecks()
    .AddNpgSql(connectionString)
    .AddRedis(redisConnectionString);

Configuration

The package supports various configuration options through appsettings.json:

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=localhost;Database=AppBlueprint;..."
  },
  "Stripe": {
    "PublishableKey": "pk_test_...",
    "SecretKey": "sk_test_..."
  },
  "AWS": {
    "Region": "us-west-2", 
    "S3BucketName": "your-bucket"
  }
}

Architecture

This infrastructure layer implements:

  • Repository Pattern for data access abstraction
  • Unit of Work Pattern for transaction management
  • Factory Pattern for service creation
  • Dependency Injection for loose coupling
  • Health Check Pattern for monitoring
  • Domain Event Pattern for cross-cutting concerns

Components

Database Contexts (EF Core code-first)

  • ApplicationDBContext
  • BaselineDBContext
  • B2BDBContext
  • B2CDBContext

External Systems Integration

  • Databases (PostgreSQL, SQL Server, NoSQL, Redis)
  • Messaging systems
  • Email providers
  • Storage services (Azure Blob storage/Cloudflare R2)
  • Identity providers
  • System clock abstractions

Entity Framework Core Features

  • DbContext configurations
  • Entity configurations
  • Repository implementations
  • Optimistic concurrency control
  • Domain event publishing

Contributing

This package is part of the SaaS Factory Labs AppBlueprint template. Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

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

Support

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SaaS-Factory.AppBlueprint.Infrastructure:

Package Downloads
SaaS-Factory.AppBlueprint.UiKit

A reusable Razor Class Library for UI components

SaaS-Factory.AppBlueprint.Presentation.ApiModule

Presentation layer with API definitions and integrations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 539 12/11/2025
0.1.0 371 12/11/2025