Skip to content

Repository layout

server/
cdk/
bin/serverless-saas.ts CDK app entry: reads CDK_PARAM_*, creates the stacks
lib/control-plane-stack.ts SBT CognitoAuth + ControlPlane, event bus watcher
lib/bootstrap-template/ mapping table, tier API keys, source bucket, provisioning jobs
lib/tenant-template/ user pool, API + authorizer, usage plans, tiers, microservices
lib/tenant-pipeline/ CodePipeline + Step Functions + CodeBuild
src/
layers/ shared Lambda layer: logger, metrics, auth_manager, tenant_data, Cognito
TenantAuthorizer/ the Lambda authorizer
ProductService/ OrderService/ one Lambda per route
UserManagementService/ one Lambda with a Powertools router
WhoAmI/ TenantPipeline/
scripts/ CodeBuild job scripts: provision, deprovision, update tenant
tests/ pytest + moto unit tests, no AWS needed
client/
admin/ React admin console (Vite, TypeScript, Amplify)
app/ React SaaS app
docs/ this site (Astro + Starlight)
screenshots/ Playwright login + capture scripts
cdk/ CDK app: serverless-saas-client (S3 + CloudFront + optional domain)
scripts/ deploy, upload-source, deploy-client, onboard/offboard, tokens, dev helpers, cleanup
docs/ one walkthrough per step, also published under "Build it step by step"
Area Choice
Infrastructure AWS CDK v2 (TypeScript), SaaS Builder Toolkit 0.9.x
Backend Python 3.13 on ARM64 Lambda, Powertools for AWS Lambda v3, PyJWT, boto3
Data DynamoDB on-demand
Identity Amazon Cognito
APIs API Gateway REST API (tenant) and HTTP API (control plane)
Web React, Vite, TypeScript, AWS Amplify v6 Auth, on S3 and CloudFront
Docs Astro, Starlight, Playwright for screenshots
CI/CD CodePipeline, Step Functions, CodeBuild