Skip to content

saas-factory-labs/Saas-Factory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

695 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ—οΈ 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.

Database schema diagram for appblueprintdb

Explore database with Azimutt Azimutt Database Analysis

Database Schema Diagram

View 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.TodoAppKernel   # Todo feature module
β”‚     β”œβ”€ 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

πŸ‘₯ Maintainers

SaaS Factory is actively developed and maintained by:

Casper Rubæk Mølvadgaard
Casper Rubæk Mølvadgaard

Lead Architect & Primary Maintainer
hornvieh3u
hornvieh3u

Contributor

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.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors