static void Main() { Workspace workspace = new Workspace("Corporate Branding", "This is a model of my software system."); Model model = workspace.Model; Person user = model.AddPerson("User", "A user of my software system."); SoftwareSystem softwareSystem = model.AddSoftwareSystem("Software System", "My software system."); user.Uses(softwareSystem, "Uses"); ViewSet views = workspace.Views; SystemContextView contextView = views.CreateSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram."); contextView.AddAllSoftwareSystems(); contextView.AddAllPeople(); Styles styles = views.Configuration.Styles; styles.Add(new ElementStyle(Tags.Person) { Shape = Shape.Person }); StructurizrDocumentationTemplate template = new StructurizrDocumentationTemplate(workspace); template.AddContextSection(softwareSystem, Format.Markdown, "Here is some context about the software system...\n\n![](embed:SystemContext)"); Branding branding = views.Configuration.Branding; branding.Logo = ImageUtils.GetImageAsDataUri(new FileInfo("structurizr-logo.png")); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
static void Main() { Workspace workspace = new Workspace("Getting Started", "This is a model of my software system."); Model model = workspace.Model; Person user = model.AddPerson("User", "A user of my software system."); SoftwareSystem softwareSystem = model.AddSoftwareSystem("Software System", "My software system."); user.Uses(softwareSystem, "Uses"); ViewSet viewSet = workspace.Views; SystemContextView contextView = viewSet.CreateSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram."); contextView.AddAllSoftwareSystems(); contextView.AddAllPeople(); Styles styles = viewSet.Configuration.Styles; styles.Add(new ElementStyle(Tags.SoftwareSystem) { Background = "#1168bd", Color = "#ffffff" }); styles.Add(new ElementStyle(Tags.Person) { Background = "#08427b", Color = "#ffffff", Shape = Shape.Person }); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
static void Main() { Workspace workspace = new Workspace("Client-side encrypted workspace", "This is a client-side encrypted workspace. The passphrase is 'password'."); Model model = workspace.Model; Person user = model.AddPerson("User", "A user of my software system."); SoftwareSystem softwareSystem = model.AddSoftwareSystem("Software System", "My software system."); user.Uses(softwareSystem, "Uses"); ViewSet viewSet = workspace.Views; SystemContextView contextView = viewSet.CreateSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram."); contextView.AddAllSoftwareSystems(); contextView.AddAllPeople(); Styles styles = viewSet.Configuration.Styles; styles.Add(new ElementStyle(Tags.SoftwareSystem) { Background = "#d34407", Color = "#ffffff" }); styles.Add(new ElementStyle(Tags.Person) { Background = "#f86628", Color = "#ffffff", Shape = Shape.Person }); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.EncryptionStrategy = new AesEncryptionStrategy("password"); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
static void Main() { Workspace workspace = new Workspace("Documentation - Structurizr", "An empty software architecture document using the Structurizr template."); Model model = workspace.Model; ViewSet views = workspace.Views; Person user = model.AddPerson("User", "A user of my software system."); SoftwareSystem softwareSystem = model.AddSoftwareSystem("Software System", "My software system."); user.Uses(softwareSystem, "Uses"); SystemContextView contextView = views.CreateSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram."); contextView.AddAllSoftwareSystems(); contextView.AddAllPeople(); Styles styles = views.Configuration.Styles; styles.Add(new ElementStyle(Tags.Person) { Shape = Shape.Person }); StructurizrDocumentationTemplate template = new StructurizrDocumentationTemplate(workspace); // this is the Markdown version DirectoryInfo documentationRoot = new DirectoryInfo("Documentation" + Path.DirectorySeparatorChar + "structurizr" + Path.DirectorySeparatorChar + "markdown"); template.AddContextSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "01-context.md"))); template.AddFunctionalOverviewSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "02-functional-overview.md"))); template.AddQualityAttributesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "03-quality-attributes.md"))); template.AddConstraintsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "04-constraints.md"))); template.AddPrinciplesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "05-principles.md"))); template.AddSoftwareArchitectureSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "06-software-architecture.md"))); template.AddDataSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "07-data.md"))); template.AddInfrastructureArchitectureSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "08-infrastructure-architecture.md"))); template.AddDeploymentSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "09-deployment.md"))); template.AddDevelopmentEnvironmentSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "10-development-environment.md"))); template.AddOperationAndSupportSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "11-operation-and-support.md"))); template.AddDecisionLogSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "12-decision-log.md"))); // this is the AsciiDoc version // DirectoryInfo documentationRoot = new DirectoryInfo("Documentation" + Path.DirectorySeparatorChar + "structurizr" + Path.DirectorySeparatorChar + "asciidoc"); // template.AddContextSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "01-context.adoc"))); // template.AddFunctionalOverviewSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "02-functional-overview.adoc"))); // template.AddQualityAttributesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "03-quality-attributes.adoc"))); // template.AddConstraintsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "04-constraints.adoc"))); // template.AddPrinciplesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "05-principles.adoc"))); // template.AddSoftwareArchitectureSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "06-software-architecture.adoc"))); // template.AddDataSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "07-data.adoc"))); // template.AddInfrastructureArchitectureSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "08-infrastructure-architecture.adoc"))); // template.AddDeploymentSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "09-deployment.adoc"))); // template.AddDevelopmentEnvironmentSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "10-development-environment.adoc"))); // template.AddOperationAndSupportSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "11-operation-and-support.adoc"))); // template.AddDecisionLogSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "12-decision-log.adoc"))); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
static void Main() { Workspace workspace = new Workspace("Documentation - arc42", "An empty software architecture document using the arc42 template."); Model model = workspace.Model; ViewSet views = workspace.Views; Person user = model.AddPerson("User", "A user of my software system."); SoftwareSystem softwareSystem = model.AddSoftwareSystem("Software System", "My software system."); user.Uses(softwareSystem, "Uses"); SystemContextView contextView = views.CreateSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram."); contextView.AddAllSoftwareSystems(); contextView.AddAllPeople(); Styles styles = views.Configuration.Styles; styles.Add(new ElementStyle(Tags.Person) { Shape = Shape.Person }); Arc42DocumentationTemplate template = new Arc42DocumentationTemplate(workspace); // this is the Markdown version DirectoryInfo documentationRoot = new DirectoryInfo("Documentation" + Path.DirectorySeparatorChar + "arc42" + Path.DirectorySeparatorChar + "markdown"); template.AddIntroductionAndGoalsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "01-introduction-and-goals.md"))); template.AddConstraintsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "02-architecture-constraints.md"))); template.AddContextAndScopeSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "03-system-scope-and-context.md"))); template.AddSolutionStrategySection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "04-solution-strategy.md"))); template.AddBuildingBlockViewSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "05-building-block-view.md"))); template.AddRuntimeViewSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "06-runtime-view.md"))); template.AddDeploymentViewSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "07-deployment-view.md"))); template.AddCrosscuttingConceptsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "08-crosscutting-concepts.md"))); template.AddArchitecturalDecisionsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "09-architecture-decisions.md"))); template.AddRisksAndTechnicalDebtSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "10-quality-requirements.md"))); template.AddQualityRequirementsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "11-risks-and-technical-debt.md"))); template.AddGlossarySection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "12-glossary.md"))); // this is the AsciiDoc version // DirectoryInfo documentationRoot = new DirectoryInfo("Documentation" + Path.DirectorySeparatorChar + "arc42" + Path.DirectorySeparatorChar + "asciidoc"); // template.AddIntroductionAndGoalsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "01-introduction-and-goals.adoc"))); // template.AddConstraintsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "02-architecture-constraints.adoc"))); // template.AddContextAndScopeSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "03-system-scope-and-context.adoc"))); // template.AddSolutionStrategySection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "04-solution-strategy.adoc"))); // template.AddBuildingBlockViewSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "05-building-block-view.adoc"))); // template.AddRuntimeViewSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "06-runtime-view.adoc"))); // template.AddDeploymentViewSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "07-deployment-view.adoc"))); // template.AddCrosscuttingConceptsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "08-crosscutting-concepts.adoc"))); // template.AddArchitecturalDecisionsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "09-architecture-decisions.adoc"))); // template.AddRisksAndTechnicalDebtSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "10-quality-requirements.adoc"))); // template.AddQualityRequirementsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "11-risks-and-technical-debt.adoc"))); // template.AddGlossarySection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "12-glossary.adoc"))); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
static void Main() { Workspace workspace = new Workspace("Styling Relationships", "This is a model of my software system."); Model model = workspace.Model; Person user = model.AddPerson("User", "A user of my software system."); SoftwareSystem softwareSystem = model.AddSoftwareSystem("Software System", "My software system."); Container webApplication = softwareSystem.AddContainer("Web Application", "My web application.", "Java and Spring MVC"); Container database = softwareSystem.AddContainer("Database", "My database.", "Relational database schema"); user.Uses(webApplication, "Uses", "HTTPS"); webApplication.Uses(database, "Reads from and writes to", "JDBC"); ViewSet views = workspace.Views; ContainerView containerView = views.CreateContainerView(softwareSystem, "containers", "An example of a container diagram."); containerView.AddAllElements(); Styles styles = workspace.Views.Configuration.Styles; // example 1 // styles.Add(new RelationshipStyle(Tags.Relationship) { Color = "#ff0000" }); // example 2 // model.Relationships.Where(r => "HTTPS".Equals(r.Technology)).ToList().ForEach(r => r.AddTags("HTTPS")); // model.Relationships.Where(r => "JDBC".Equals(r.Technology)).ToList().ForEach(r => r.AddTags("JDBC")); // styles.Add(new RelationshipStyle("HTTPS") { Color = "#ff0000" }); // styles.Add(new RelationshipStyle("JDBC") { Color = "#0000ff" }); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
public void Test_PutWorkspace_ThrowsAnException_WhenANullWorkspaceIsSpecified() { try { _structurizrClient = new StructurizrClient("key", "secret"); _structurizrClient.PutWorkspaceAsync(1234, null).Wait(); throw new TestFailedException(); } catch (AggregateException iae) { Assert.Equal("The workspace must not be null.", iae.InnerException.Message); } }
public void Test_PutWorkspace_ThrowsAnException_WhenTheWorkspaceIdIsNotValid() { try { _structurizrClient = new StructurizrClient("key", "secret"); _structurizrClient.PutWorkspaceAsync(0, new Workspace("Name", "Description")).Wait(); throw new TestFailedException(); } catch (AggregateException iae) { Assert.Equal("The workspace ID must be a positive integer.", iae.InnerException.Message); } }
static void Main() { Workspace workspace = new Workspace("HTTP-based health checks example", "An example of how to use the HTTP-based health checks feature"); Model model = workspace.Model; ViewSet views = workspace.Views; SoftwareSystem structurizr = model.AddSoftwareSystem("Structurizr", "A publishing platform for software architecture diagrams and documentation based upon the C4 model."); Container webApplication = structurizr.AddContainer("structurizr.com", "Provides all of the server-side functionality of Structurizr, serving static and dynamic content to users.", "Java and Spring MVC"); Container database = structurizr.AddContainer("Database", "Stores information about users, workspaces, etc.", "Relational Database Schema"); database.AddTags(DatabaseTag); webApplication.Uses(database, "Reads from and writes to", "JDBC"); DeploymentNode amazonWebServices = model.AddDeploymentNode("Amazon Web Services", "", "us-east-1"); DeploymentNode pivotalWebServices = amazonWebServices.AddDeploymentNode("Pivotal Web Services", "Platform as a Service provider.", "Cloud Foundry"); ContainerInstance liveWebApplication = pivotalWebServices.AddDeploymentNode("www.structurizr.com", "An open source Java EE web server.", "Apache Tomcat") .Add(webApplication); ContainerInstance liveDatabaseInstance = amazonWebServices.AddDeploymentNode("Amazon RDS", "Database as a Service provider.", "MySQL") .Add(database); // add health checks to the container instances, which return a simple HTTP 200 to say everything is okay liveWebApplication.AddHealthCheck("Web Application is running", "https://www.structurizr.com/health"); liveDatabaseInstance.AddHealthCheck("Database is accessible from Web Application", "https://www.structurizr.com/health/database"); // the pass/fail status from the health checks is used to supplement any deployment views that include the container instances that have health checks defined DeploymentView deploymentView = views.CreateDeploymentView(structurizr, "Deployment", "A deployment diagram showing the live environment."); deploymentView.Environment = "Live"; deploymentView.AddAllDeploymentNodes(); views.Configuration.Styles.Add(new ElementStyle(Tags.Element) { Color = "#ffffff" }); views.Configuration.Styles.Add(new ElementStyle(DatabaseTag) { Shape = Shape.Cylinder }); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); WorkspaceUtils.PrintWorkspaceAsJson(workspace); Console.ReadKey(); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
static void Main() { Workspace workspace = new Workspace("Filtered Views", "An example of using filtered views."); Model model = workspace.Model; Person user = model.AddPerson("User", "A description of the user."); SoftwareSystem softwareSystemA = model.AddSoftwareSystem("Software System A", "A description of software system A."); SoftwareSystem softwareSystemB = model.AddSoftwareSystem("Software System B", "A description of software system B."); softwareSystemB.AddTags(FutureState); user.Uses(softwareSystemA, "Uses for tasks 1 and 2").AddTags(CurrentState); user.Uses(softwareSystemA, "Uses for task 1").AddTags(FutureState); user.Uses(softwareSystemB, "Uses for task 2").AddTags(FutureState); ViewSet views = workspace.Views; SystemLandscapeView systemLandscapeView = views.CreateSystemLandscapeView("EnterpriseContext", "An example Enterprise Context diagram."); systemLandscapeView.AddAllElements(); views.CreateFilteredView(systemLandscapeView, "CurrentState", "The current context.", FilterMode.Exclude, FutureState); views.CreateFilteredView(systemLandscapeView, "FutureState", "The future state context after Software System B is live.", FilterMode.Exclude, CurrentState); Styles styles = views.Configuration.Styles; styles.Add(new ElementStyle(Tags.Element) { Color = "#ffffff" }); styles.Add(new ElementStyle(Tags.SoftwareSystem) { Background = "#91a437", Shape = Shape.RoundedBox }); styles.Add(new ElementStyle(Tags.Person) { Background = "#6a7b15", Shape = Shape.Person }); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
static void Main() { Workspace workspace = new Workspace("Styling Elements", "This is a model of my software system."); Model model = workspace.Model; Person user = model.AddPerson("User", "A user of my software system."); SoftwareSystem softwareSystem = model.AddSoftwareSystem("Software System", "My software system."); Container webApplication = softwareSystem.AddContainer("Web Application", "My web application.", "Java and Spring MVC"); Container database = softwareSystem.AddContainer("Database", "My database.", "Relational database schema"); user.Uses(webApplication, "Uses", "HTTPS"); webApplication.Uses(database, "Reads from and writes to", "JDBC"); ViewSet views = workspace.Views; ContainerView containerView = views.CreateContainerView(softwareSystem, "containers", "An example of a container diagram."); containerView.AddAllElements(); Styles styles = workspace.Views.Configuration.Styles; // example 1 // styles.Add(new ElementStyle(Tags.Element) { Background = "#438dd5", Color = "#ffffff" }); // example 2 // styles.Add(new ElementStyle(Tags.Element) { Color = "#ffffff" }); // styles.Add(new ElementStyle(Tags.Person) { Background = "#08427b" }); // styles.Add(new ElementStyle(Tags.Container) { Background = "#438dd5" }); // example 3 // styles.Add(new ElementStyle(Tags.Element) { Color = "#ffffff" }); // styles.Add(new ElementStyle(Tags.Person) { Background = "#08427b" , Shape = Shape.Person }); // styles.Add(new ElementStyle(Tags.Container) { Background = "#438dd5" }); // database.AddTags("Database"); // styles.Add(new ElementStyle("Database") { Shape = Shape.Cylinder }); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
static void Main() { Workspace workspace = new Workspace("Theme", "This is a model of my software system."); Model model = workspace.Model; Person user = model.AddPerson("User", "A user of my software system."); SoftwareSystem softwareSystem = model.AddSoftwareSystem("Software System", "My software system."); user.Uses(softwareSystem, "Uses"); ViewSet viewSet = workspace.Views; SystemContextView contextView = viewSet.CreateSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram."); contextView.AddAllSoftwareSystems(); contextView.AddAllPeople(); // add a theme viewSet.Configuration.Theme = "https://raw.githubusercontent.com/structurizr/dotnet/master/Structurizr.Examples/Theme/theme.json"; StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }
static void Main() { StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, Create()).Wait(); }
static void Main() { Workspace workspace = new Workspace("Financial Risk System", "This is a simple (incomplete) example C4 model based upon the financial risk system architecture kata, which can be found at http://bit.ly/sa4d-risksystem"); Model model = workspace.Model; SoftwareSystem financialRiskSystem = model.AddSoftwareSystem("Financial Risk System", "Calculates the bank's exposure to risk for product X."); Person businessUser = model.AddPerson("Business User", "A regular business user."); businessUser.Uses(financialRiskSystem, "Views reports using"); Person configurationUser = model.AddPerson("Configuration User", "A regular business user who can also configure the parameters used in the risk calculations."); configurationUser.Uses(financialRiskSystem, "Configures parameters using"); SoftwareSystem tradeDataSystem = model.AddSoftwareSystem("Trade Data System", "The system of record for trades of type X."); financialRiskSystem.Uses(tradeDataSystem, "Gets trade data from"); SoftwareSystem referenceDataSystem = model.AddSoftwareSystem("Reference Data System", "Manages reference data for all counterparties the bank interacts with."); financialRiskSystem.Uses(referenceDataSystem, "Gets counterparty data from"); SoftwareSystem referenceDataSystemV2 = model.AddSoftwareSystem("Reference Data System v2.0", "Manages reference data for all counterparties the bank interacts with."); referenceDataSystemV2.AddTags("Future State"); financialRiskSystem.Uses(referenceDataSystemV2, "Gets counterparty data from").AddTags("Future State"); SoftwareSystem emailSystem = model.AddSoftwareSystem("E-mail system", "The bank's Microsoft Exchange system."); financialRiskSystem.Uses(emailSystem, "Sends a notification that a report is ready to"); emailSystem.Delivers(businessUser, "Sends a notification that a report is ready to", "E-mail message", InteractionStyle.Asynchronous); SoftwareSystem centralMonitoringService = model.AddSoftwareSystem("Central Monitoring Service", "The bank's central monitoring and alerting dashboard."); financialRiskSystem.Uses(centralMonitoringService, "Sends critical failure alerts to", "SNMP", InteractionStyle.Asynchronous).AddTags(AlertTag); SoftwareSystem activeDirectory = model.AddSoftwareSystem("Active Directory", "The bank's authentication and authorisation system."); financialRiskSystem.Uses(activeDirectory, "Uses for user authentication and authorisation"); ViewSet views = workspace.Views; SystemContextView contextView = views.CreateSystemContextView(financialRiskSystem, "Context", "An example System Context diagram for the Financial Risk System architecture kata."); contextView.AddAllSoftwareSystems(); contextView.AddAllPeople(); Styles styles = views.Configuration.Styles; financialRiskSystem.AddTags("Risk System"); styles.Add(new ElementStyle(Tags.Element) { Color = "#ffffff", FontSize = 34 }); styles.Add(new ElementStyle("Risk System") { Background = "#550000", Color = "#ffffff" }); styles.Add(new ElementStyle(Tags.SoftwareSystem) { Width = 650, Height = 400, Background = "#801515", Shape = Shape.RoundedBox }); styles.Add(new ElementStyle(Tags.Person) { Width = 550, Background = "#d46a6a", Shape = Shape.Person }); styles.Add(new RelationshipStyle(Tags.Relationship) { Thickness = 4, Dashed = false, FontSize = 32, Width = 400 }); styles.Add(new RelationshipStyle(Tags.Synchronous) { Dashed = false }); styles.Add(new RelationshipStyle(Tags.Asynchronous) { Dashed = true }); styles.Add(new RelationshipStyle(AlertTag) { Color = "#ff0000" }); styles.Add(new ElementStyle("Future State") { Opacity = 30, Border = Border.Dashed }); styles.Add(new RelationshipStyle("Future State") { Opacity = 30, Dashed = true }); StructurizrDocumentationTemplate template = new StructurizrDocumentationTemplate(workspace); DirectoryInfo documentationRoot = new DirectoryInfo("FinancialRiskSystem"); template.AddContextSection(financialRiskSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "context.adoc"))); template.AddFunctionalOverviewSection(financialRiskSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "functional-overview.md"))); template.AddQualityAttributesSection(financialRiskSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "quality-attributes.md"))); template.AddImages(documentationRoot); StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret); structurizrClient.PutWorkspaceAsync(WorkspaceId, workspace).Wait(); }