Skip to content

jmtdev0-open-source/SaaS-Factory

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

899 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—οΈ SaaS Factory

A comprehensive platform framework that combines opinionated architecture, production-ready infrastructure, and developer-friendly tooling to deploy enterprise-grade B2B/B2C SaaS applications in minutes instead of months.

πŸš— The Vision: A Modern Automotive Factory for SaaS Development and Deployment

To understand the core of SaaS Factory, imagine a modern, high-tech automotive manufacturing plant.

When a car manufacturer launches a new model whether a compact city car (B2C) or an advanced enterprise-grade SUV they don't reinvent the wheel. Instead, they rely on a universal, modular platform. Standardized components like the chassis, battery pack, and drivetrain are seamlessly redeployed, combined, and adapted for the new vehicle variant.

SaaS Factory brings this exact level of precision and manufacturing efficiency to the software world for the .Net Ecosystem.

πŸ› οΈ Modular Architecture (The Building Blocks)

Instead of physical mechanical parts, SaaS Factory provides production-ready, foundational building blocks required by any modern SaaS application. You can configure and assemble these components to build for B2C, B2B, or Enterprise needs:

  • The Chassis: A unified, robust database schema optimized for either B2C or B2B/Enterprise setups, ensuring clean, consistent, and multi-tenant-ready data structures.
  • The Engine: Centralized, high-performance API layers, background workers, and core business logic.
  • The Safety System: Deeply integrated, solid authentication and authorization services.

πŸ“Ά "Over the Air" Updates via NuGet packages

Just as a modern electric vehicle receives continuous over the air software updates to enhance security, performance or unlock new features without a trip to the mechanic, the architecture behind SaaS Factory is dynamically updatable.

Leveraging the power of the .NET framework, all core platform components are engineered, distributed, and maintained as centralized NuGet packages.

This allows you to ship bug fixes, security patches, and structural optimizations to the foundation of all your deployed SaaS products simultaneously without rewriting boilerplate or fracturing your application-specific logic. The result is a drastically reduced Time-to-Market, minimal technical debt, and a perfectly streamlined engineering lifecycle.

βš–οΈ SaaS Factory vs. Alternatives

While there are many SaaS starter kits (boilerplates) on the market, SaaS Factory is built as a Platform Framework. Instead of cloning a snapshot of code and losing touch with future updates, the core of SaaS Factory is distributed via packages, keeping your underlying architecture maintainable over time.

Framework / Platform Ecosystem Core Update Model Architecture Philosophy Infrastructure & Deployment
SaaS Factory .NET (C#) Centralized NuGet Packages (Dynamically updatable core platform) Lightweight, pragmatic, Domain-Driven-Design (DDD), Clean Architecture and Laravel-inspired Cloud-agnostic, cost-effective (.NET Aspire + YARP)
ABP Framework .NET (C#) Centralized NuGet Packages (Updatable framework layers) Heavy Enterprise, strict Domain-Driven Design (DDD) Highly abstract, enterprise-scale, steep learning curve
Bullet Train Ruby on Rails RubyGems Packages (Updatable via core framework gems) "The Rails Way", extreme convention over configuration Monolithic, optimized for maximum developer velocity
Laravel Spark / Jetstream PHP Composer Packages (Billing & Auth decoupled as packages) Highly expressive, rapid application development Traditional or serverless PHP, optimized for single-app instances
SaaS Pegasus Python (Django) Boilerplate / Scaffolding (One-time generation, manual upgrades) Clean Django architecture, batteries included Traditional Python stack, heavy emphasis on recent AI/LLM tooling

Why Choose SaaS Factory?

πŸ› οΈ Updatable Core vs. Boilerplate Fatigue

Most SaaS starter kits are "clone-and-forget" boilerplates. Once you customize the code, pulling upstream security patches or features from the original template becomes a git-merge nightmare. SaaS Factory decouples the platform core into versioned NuGet packages, allowing you to update your underlying SaaS infrastructure seamlessly without breaking your unique business logic.

⚑ Pragmatic Clean Architecture vs. Enterprise Bloat

While alternatives like ABP Framework offer package-based architectures, they often enforce a heavy "Enterprise Tax"β€”requiring extreme boilerplate abstractions, deep layered architectures, and heavy tooling that slows down startup velocity. SaaS Factory combines the structural integrity of Clean Architecture / DDD with the pragmatic developer joy of Laravel, driven by a powerful Developer CLI to keep you moving fast.

πŸ’Έ Local Orchestration & Low-Cost Production (.NET Aspire + YARP)

Instead of forcing you into vendor lock-in with expensive cloud providers (like Azure Container Apps or Azure AKS) or managing complex infrastructure YAMLs, SaaS Factory utilizes .NET Aspire for flawless local service discovery and orchestration. Paired with YARP (Yet Another Reverse Proxy) as a native C# API Gateway, the entire stack remains lightweight and cloud-agnosticβ€”ready to be deployed cost-effectively on modern providers like Railway, Hetzner, or DigitalOcean for a fraction of traditional enterprise hosting costs and it is easy to add other cloud providers.


Database schema diagram for appblueprintdb

Explore database with Azimutt Azimutt Database Analysis

Database Schema Diagram

Visit the live demo site

πŸ”’ Project Status

CI/CD & Build Status

Azimutt Database Analysis

Publish NuGet Packages

GitHub Issues & Project Management

GitHub issues with enhancement label GitHub issues with bug label GitHub open issues

Quality & security analysis

Security Rating Reliability Rating Maintainability Rating Bugs Code Smells Vulnerabilities Technical Debt Duplicated Lines (%)

Security: CodeQL

πŸ“š Documentation

The comprehensive documentation includes:

  • πŸš€ Getting Started Guide - Quick setup and installation
  • πŸ—οΈ Architecture Overview - System design and patterns
  • πŸ“ Development Workflow - Building and deploying
  • πŸ”§ Configuration Guide - Environment setup and customization
  • πŸ“¦ Shared Modules - Reusable components and libraries
  • 🎯 Use Cases - User flows and feature guides

🎯 Project Overview

Vision

Deploy a fully functional, production-ready SaaS application in under 30 minutes using a single command via the Developer CLI, with all foundational features already in place - ready for you to add your application-specific features.

Inspired by Laravel's approach to developer experience and opinionated best practices, SaaS Factory brings the same philosophy to .NET - purpose-built for multi-tenant B2C and B2B SaaS application.

  • Some of the key features inspired by Laravel and other modern frameworks that will be included out of the box:
  • Developer CLI for scaffolding and management
  • Payment integration with Stripe
  • Full text search with PostgreSQL
  • Social authentication with OAuth providers
  • Email verification and password reset flows
  • Team management, user roles and permissions and profiles
  • Multitenancy support out of the box
  • Background job processing with workers and a dashboard for monitoring and managing jobs centrally instead of per application such as Laravel Horizon
  • Feature flag management system for gradual rollouts and A/B testing
  • Comprehensive audit logging and monitoring tools
  • GDPR compliance features like data export and deletion requests

Purpose

Provide a production-ready platform framework that eliminates months of foundational development work. This isn't just a boilerplate - it's an integrated, battle-tested system with proven security patterns, comprehensive multi-tenancy, enterprise DevOps, and deployment automation that lets you focus on building unique features that differentiate your product.

Objectives

Development Experience

  • Enjoyable and productive development workflow
  • Familiar tech stack (C# wherever possible)
  • Minimal technical debt through standardized implementations

Infrastructure & Deployment

  • Consolidated shared infrastructure across all SaaS projects
  • Fast continuous deployment (automatic deployment after passing automated QA)
  • Cloud-agnostic architecture (easily migrate to Digital Ocean, Hetzner, Linode, Render, Railway, etc.)

Architecture & Quality

  • Monorepo structure for deployment manager and SaaS application boilerplate
  • Modular, flexible structure with proper tracking of code and database migrations
  • Automated processes for testing, documentation, and deployment
  • Multiple environments: Dev, QA (automated), Staging, and Production

Operations

  • Cost-effective infrastructure management
  • Enterprise-grade security implementation
  • Disaster recovery capabilities
  • Comprehensive audit logging

Challenges & Considerations

Technical Challenges

  • Maintaining consistency across multiple deployed SaaS applications to minimize technical debt
  • Balancing high-level architectural vision with detailed low-level implementation

Strategic Decisions

  • MVP Readiness: Defining criteria for the first production SaaS Factory deployment
  • Deployment Manager: Should this be deferred to version 2.0? How to consolidate and migrate existing deployed applications?

πŸ› οΈ Prerequisites

Install prerequisites for development on Windows
  1. Open a PowerShell terminal as Administrator and run the following command to install Windows Subsystem for Linux (required for Docker):

    wsl --install

  2. Restart your computer if prompted.

  3. Install .NET, Git, Docker Desktop, Node.js, Azure CLI, and GitHub CLI using winget (available only on Windows 11):

    @(
        "Microsoft.DotNet.SDK.9",
        "Git.Git",
        "Docker.DockerDesktop",
        "OpenJS.NodeJS",
        "npm install wrangler --save-dev"
        "GitHub.cli"    	
    ) | ForEach-Object { winget install --accept-package-agreements --accept-source-agreements --id $_ }
    
    "gh extension install https://github.com/nektos/gh-act"

πŸ—‚οΈ File structure in the git repository

SaaS-Factory is a monorepo containing all application code, infrastructure, tools, libraries, documentation, etc. A monorepo is a powerful way to organize a codebase, used by Google, Facebook, Uber, Microsoft, etc.

πŸ“‹ Repository Organization: See REPOSITORY_ORGANIZATION.md for details on the recent reorganization and directory structure improvements.

β”œβ”€ .github                            # GitHub workflows, CI/CD, and Copilot instructions
β”œβ”€ build-artifacts                    # Build output, logs, and temporary files (gitignored)
β”œβ”€ Code                               # Contains the application source code
β”‚  β”œβ”€ AppBlueprint        
β”‚     β”œβ”€ AppBlueprint.AppHost         # .NET Aspire project starting app and all dependencies in Docker
β”‚     β”œβ”€ AppBlueprint.AppGateway      # YARP reverse proxy / API gateway
β”‚     β”œβ”€ AppBlueprint.Web             # Blazor Server app utilizing MudBlazor components
β”‚     β”œβ”€ AppBlueprint.ApiService      # .NET REST API
β”‚     β”œβ”€ AppBlueprint.ServiceDefaults # Shared Aspire service configuration
β”‚     β”œβ”€ AppBlueprint.DeveloperCli    # CLI tools for scaffolding and management
β”‚     β”œβ”€ AppBlueprint.Tests           # Tests for all projects
β”‚     β”œβ”€ Shared-Modules               # Clean Architecture shared modules
β”‚        β”œβ”€ AppBlueprint.Domain           # Entities, value objects, aggregates, domain logic
β”‚        β”œβ”€ AppBlueprint.Application      # Use cases, commands, queries, DTOs (CQRS)
β”‚        β”œβ”€ AppBlueprint.Infrastructure   # EF Core, repositories, external service integrations
β”‚        β”œβ”€ AppBlueprint.Presentation.ApiModule  # Minimal API endpoints and versioning
β”‚        β”œβ”€ AppBlueprint.Contracts        # Shared contracts and interfaces
β”‚        β”œβ”€ AppBlueprint.SharedKernel     # Shared kernel code across all projects
β”‚        β”œβ”€ AppBlueprint.UiKit            # Reusable UI components
β”‚        β”œβ”€ AppBlueprint.Api.Client.Sdk   # Kiota-generated API client SDK
β”‚        β”œβ”€ AppBlueprint.Tests            # Shared test utilities and integration tests
β”œβ”€ docs                               # Documentation and guides
β”‚  β”œβ”€ guides                          # Testing guides and quick references
β”œβ”€ scripts                            # Utility scripts
β”‚  β”œβ”€ powershell                      # PowerShell scripts for Windows development

About

Enterprise-grade .NET SaaS framework for rapid B2B/B2C SaaS app development. Featuring multi-tenant architecture, automated CI/CD, and AI-driven development tooling to maximize velocity.

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HTML 76.7%
  • C# 20.7%
  • CSS 1.0%
  • PLpgSQL 0.6%
  • JavaScript 0.4%
  • TypeScript 0.3%
  • Other 0.3%