Blueprint for deploying any type of B2B/B2B SaaS to massively accelerate development speed and time to market of a new SaaS web application by reducing the to create boilerplate code and infrastructure.
Deploying a new SaaS app project working with one command via the Developer Cli and then adding features specific to the application, while all the fundamental is in place already in under 30 minutes
- Fun to work with and develop
- Consolidated shared infrastructure
- Fast continuous deployment of code to infrastructure (deploy automatically after passing automated QA environment testing processes)
- Cost-effective
- Secure
- Fast development on new or existing software-as-a-service projects
- familiar tech stack (C# as much as possible)
- Minimal technical debt (standardized implementations, code clean up, modular flexible structure, tracking, and maintenance of code and database migration drift)
- Mono repo for SaaS deployment manager system and boilerplate code for deploying SaaS web app project in a separate repo
- Automated processes
- Disaster recovery implementation
- Automated documentation
- Dev, QA (automated), staging, and production environment
- Cloudagnostic (can easiliy be migrated to another cloud provider such as Digital Ocean/Hetzner/Linode/Render.com/Railway.com
- Maintaining and keeping multiple deployed SaaS web applications up to date to mitigate technical debt
- Adhering to a high-level perspective and focus while being able to deepdive into low level programming and troubleshooting
- MVP status - When and how can the first SaaS Factory App be deployed?
- Should Deployment Manager be added in version 2 of SaaS Factory and how can existing deployed SaaS web apps be consolidated and migrated?
Note
Useful information that users should know, even when skimming content.
Tip
Helpful advice for doing things better or more easily.
Important
Key information users need to know to achieve their goal.
Warning
Urgent info that needs immediate user attention to avoid problems.
Caution
Advises about risks or negative outcomes of certain actions.
- Entity
- DTO
- Request
- Response
- Interfaces
- Services
- Repositories
- Database
- Migrations
- Contexts
Install prerequisites for development on Windows
-
Open a PowerShell terminal as Administrator and run the following command to install Windows Subsystem for Linux (required for Docker):
wsl --install
-
Restart your computer if prompted.
-
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"
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.
ββ .github # Separate GitHub workflows for deploying Infrastructure and app
ββ Code # Contains the application source code
β ββ AppBlueprint
β ββ Appblueprint.AppHost # .NET Aspire project starting app and all dependencies in Docker
β ββ Appblueprint.Gateway # Blazor Server app utilizing Mudblazor components
β ββ Appblueprint.Web # Blazor Server app utilizing Mudblazor components
β ββ Appblueprint.ApiService # .Net Rest/GraphQL API
β ββ Appblueprint.Workers # Background workers for long-running tasks and event processing
β ββ Appblueprint.SharedKernel # Shared code between all projects
β ββ Appblueprint.UiKit # Shared UI components
β ββ Appblueprint.Tests # Tests for all projectsβ β
-
User management
- Register a new user account
- Login with existing user account
- Logout from user account
- Manage user profile
- Manage user account settings
- File management
- Upload a file
- Download a file
- Delete a file
- Share a file
- Manage files
- Search and filter for a file
- Export user data
- Notification management
- View notifcations
- Check off notifications as read
- Data export
- Export user data
-
Role and Permission management
- Customer admin should be able to manage roles and permisions
- Customer admin should be able to create a team
- Customer admin should be able to assign members to a team
- Customer admin should be able to create API keys
-
Tenant management
- Automatically provision a new tenant for a customer that signs up
-
Subscription management
- Create a new subscription for a customer that signs up to a paid plan
- Cancel existing subscription
-
Payment management
- Create a payment intent for a customer that signs up to a paid subscription plan
- Create a payment intent for a customer that that purchases a perperual license
- Create a payment intent for a customer that that purchases credits
-
Admin Management (My own access to manage my customers and their subscriptions across deployed SaaS app products)
- Manage all users
- Manage all tenants
- Manage all subscriptions
- Manage all payment intents
- Manage all payment transactions
- Manage all roles and permissions
- Manage all customers
-
Invoice management
- Create a new invoice for a customer that signs up to a paid plan
- Send invoice to customer
- Manage invoices
-
Audit log
- User activity
- User audit log
-
Settings
-
Dashboard
-
Reporting
-
Onboarding flow for new customers
- Set user details such as name, age and so on
- Set business details such as company name, VAT and so on
-
Shared API vs. Separate API for each SaaS app project [Seperate API: APPROVED]
-
Purpose
- Shared API for all deployed SaaS apps
- Shared API for Deployment Manager
- Shared API for App Blueprint
-
Disadvantages of shared API:
- Higher complexity
- Single point of failure for all projects
- Risk of calling database from API Controller that does not belong to the correct SaaS app and possible data leakage
- Higher complexity
-
Advantages of shared API:
- Lower technical debt as there is no code drift between Appblueprint and the app projects' code
- No duplicated API code
- Easier to maintain and update
-
-
Deployment Manager
- Purpose
- Command center to control deployment, monitoring and management of deployed SaaS apps
- Shared Infrastructure with deployed SaaS apps
- Integration application landscape
- Manage customers and track growth metrics
- Purpose
-
App Blueprint
- Purpose
- Template for deploying a SaaS App
- Purpose
-
Deployed SaaS App
- Purpose
- Personal or commercial App (B2C or B2B or Developer first)
- Purpose
- Domain Driven Design
- Clean Architecture
- Low technical debt
- Reliability
-
DeploymentManager.Web
- Command center portal
-
DeploymentManager.Api
- Rest API
- GraphQL API
-
DeploymentManager.Codeflow
- Dependency Tracker
-
DeploymentManager.Shared
- Shared DTOs
- Shared Enums
- Shared Entities
-
Shared Infrastructure
-
App-Blueprint template
-
FileDiscovery.Web
- Customer management portal
- Partner portal
- Admin portal
-
FileDiscovery.Api
- Rest API
- GraphQL API
- Blazor
- Dotnet familiarity
- Performant
- Can run everywhere as Web Assembly or hosted server web app
- Strong integration with dotnet backend technologies
- Mudblazor framework for fast user interface development
- 3rd party mudextensions
- Dotnet
- Familiarity => High productivity
- Performant
- YARP Proxy
- Authentication solution eg. Supertokens
- Railway
- PostgreSQL databases
- Cloudflare R2 blob storage
- Redis Cloud
- Algolia
- Grafana Cloud
- Cloudflare
- Stripe
- Resend
- Azure Key Vault
- Logsnag
- Cookiebot
- Microsoft Clarity
- Google Recaptcha
- Google Analytics
- Google Tag Manager
- Open Telemetry
- Github Actions
- Pulumi Automation API
- Cloudcostify API
- Sonarcloud
- NSubstitute
- xUnit
- Bogus
- Architecture testing
- Function testing
- Integration testing
- Performance test (Grafana K6)
- Smoke test
- Load test
- Deployment Manager dependency tracking map
- Dive (docker image analysis)
- Github Copilot automatic documentation
- Automatic swagger Rest API documentation
- Automatic GraphQL schema documentation
- Open Telemetry dependencies map
- Standards
- Naming convention
- Sonarcloud Gate
- Technical debt under 1 hour
- Project file structure
- CORS
- CSRF
- HSTS
- CSP
- Zero trust & no credentials
- IP whitelisting
- Monitoring
- Pentesting
- Cloudflare DDOS protection
- Microsoft SQL Studio
- Visual Studio 2022
- Github Copilot (Chat & Voice)
- VS Code
- Docker Desktop
- Postman