Пример #1
0
        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.PutWorkspace(WorkspaceId, workspace);
        }
        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();
        }
Пример #3
0
        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.PutWorkspace(WorkspaceId, workspace);
        }
Пример #4
0
        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();
        }
Пример #5
0
        static void Main(string[] args)
        {
            Workspace workspace = new Workspace("RegAndElig", "Registration and Eligibility Model.");
            var       model     = workspace.Model;

            Person         user           = model.AddPerson("Service Provider", "A user of my software system.");
            SoftwareSystem softwareSystem = model.AddSoftwareSystem("Ess Web", "Web Front end.");

            user.Uses(softwareSystem, "Uses");

            ViewSet           viewSet = workspace.Views;
            SystemContextView contextView
                = viewSet.CreateSystemContextView(
                      softwareSystem, "context", "A simple 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"
            });

            StructurizrClient structurizrClient = new StructurizrClient("key", "secret");

            structurizrClient.PutWorkspace(1234, workspace);
        }
Пример #6
0
        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();
        }
Пример #7
0
        static void Main(string[] args)
        {
            Workspace workspace = new Workspace("Music Sample Manager architecture", "This is a model of the architecture of the Music Sample Manager project.");
            Model     model     = workspace.Model;

            Person musician      = model.AddPerson("Musician", "A person who wants to write/record some music.");
            Person libraryAuthor = model.AddPerson("Author", "A person who authors samples to be used by musicians.");

            SoftwareSystem consoleApp = model.AddSoftwareSystem("msm.exe", "A console application that lets users perform MSM operations.");

            musician.Uses(consoleApp, "Uses");

            SoftwareSystem desktopGUIApp = model.AddSoftwareSystem("Desktop GUI App", "A desktop application that lets uers perform MSM operations.");

            musician.Uses(desktopGUIApp, "Uses");

            SoftwareSystem dawClient = model.AddSoftwareSystem("DAW Client", "Functionality built into DAWs that allows users to perform MSM operations.");

            musician.Uses(dawClient, "Uses");

            SoftwareSystem website = model.AddSoftwareSystem("Website", "Website that allows musicians to browse packages, and authors to publish/manage packages.");

            musician.Uses(website, "Uses packages from");
            libraryAuthor.Uses(website, "Publishes to");


            SoftwareSystem serverSoftware = model.AddSoftwareSystem("Server software", "Handles submissions to the database, authentication, serving requests for packages, etc.");

            consoleApp.Uses(serverSoftware, "Communicates with");
            dawClient.Uses(serverSoftware, "Interfaces with");

            SoftwareSystem localPackageCache = model.AddSoftwareSystem("Local package cache", "Cache of downloaded packages, to be used by DAW projects.");

            consoleApp.Uses(localPackageCache, "Interfaces with");
            dawClient.Uses(localPackageCache, "Works with");



            ViewSet           viewSet     = workspace.Views;
            SystemContextView contextView = viewSet.CreateSystemContextView(consoleApp, "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
            });

            PublishWorkspace(workspace);
        }
Пример #8
0
        static void Main()
        {
            Workspace workspace = new Workspace("Getting Started", "This is a model of my software system.");
            Model     model     = workspace.Model;

            model.Enterprise = new Enterprise("Some Enterprise");

            Person         user                   = model.AddPerson("User", "A user of my software system.");
            SoftwareSystem softwareSystem         = model.AddSoftwareSystem("Software System", "My software system.");
            var            userUsesSystemRelation = user.Uses(softwareSystem, "Uses");
            // a direction could be added to relation (active in all views)
            // userUsesSystemRelation.SetDirection(DirectionValues.Right);

            ViewSet           views       = workspace.Views;
            SystemContextView contextView = views.CreateSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram.");

            contextView.AddAllSoftwareSystems();
            contextView.AddAllPeople();

            // C4PlantUMLWriter support view specific directions too, e.g. "User" should be left of "Software System" only in this view
            contextView.Relationships
            .First(rv => rv.Relationship.SourceId == user.Id && rv.Relationship.DestinationId == softwareSystem.Id)
            .SetDirection(DirectionValues.Right);

            using (var stringWriter = new StringWriter())
            {
                var plantUmlWriter = new C4PlantUmlWriter();
                plantUmlWriter.Write(workspace, stringWriter);
                Console.WriteLine(stringWriter.ToString());
            }


            Container webApplication = softwareSystem.AddContainer("Web Application", "Delivers content", "Java and spring MVC");
            Container database       = softwareSystem.AddContainer("Database", "Stores information", "Relational Database Schema");

            // Additional mark it as database
            database.SetIsDatabase(true);
            user.Uses(webApplication, "uses", "HTTP");
            webApplication.Uses(database, "Reads from and writes to", "JDBC").SetDirection(DirectionValues.Right);

            var containerView = views.CreateContainerView(softwareSystem, "containers", "");

            containerView.AddAllElements();

            using (var stringWriter = new StringWriter())
            {
                var plantUmlWriter = new C4PlantUmlWriter();
                plantUmlWriter.Write(containerView, stringWriter);
                Console.WriteLine(stringWriter.ToString());
            }
        }
Пример #9
0
        static void Main()
        {
            Workspace workspace = new Workspace("Documentation - Viewpoints and Perspectives", "An empty software architecture document using the Viewpoints and Perspectives 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
            });

            ViewpointsAndPerspectivesDocumentation template = new ViewpointsAndPerspectivesDocumentation(workspace);

            // this is the Markdown version
            DirectoryInfo documentationRoot = new DirectoryInfo("Documentation" + Path.DirectorySeparatorChar + "viewpointsandperspectives" + Path.DirectorySeparatorChar + "markdown");

            template.AddIntroductionSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "01-introduction.md")));
            template.AddGlossarySection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "02-glossary.md")));
            template.AddSystemStakeholdersAndRequirementsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "03-system-stakeholders-and-requirements.md")));
            template.AddArchitecturalForcesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "04-architectural-forces.md")));
            template.AddArchitecturalViewsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "05-architectural-views")));
            template.AddSystemQualitiesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "06-system-qualities.md")));
            template.AddAppendicesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "07-appendices.md")));

            // this is the AsciiDoc version
//            DirectoryInfo documentationRoot = new DirectoryInfo("Documentation" + Path.DirectorySeparatorChar + "viewpointsandperspectives" + Path.DirectorySeparatorChar + "asciidoc");
//            template.AddIntroductionSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "01-introduction.adoc")));
//            template.AddGlossarySection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "02-glossary.adoc")));
//            template.AddSystemStakeholdersAndRequirementsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "03-system-stakeholders-and-requirements.adoc")));
//            template.AddArchitecturalForcesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "04-architectural-forces.adoc")));
//            template.AddArchitecturalViewsSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "05-architectural-views")));
//            template.AddSystemQualitiesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "06-system-qualities.adoc")));
//            template.AddAppendicesSection(softwareSystem, new FileInfo(Path.Combine(documentationRoot.FullName, "07-appendices.adoc")));

            StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret);

            structurizrClient.PutWorkspace(WorkspaceId, workspace);
        }
Пример #10
0
        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)");
            template.AddQualityAttributesSection(softwareSystem, Format.Markdown, "Here is some information about the quality attributes...");
            template.AddSoftwareArchitectureSection(softwareSystem, Format.Markdown, "Here is some information about the software architecture...");
            template.AddOperationAndSupportSection(softwareSystem, Format.Markdown, "Here is some information about how to operate and support the software...");
            template.AddDecisionLogSection(softwareSystem, Format.Markdown, "Here is some information about the decisions made...");

            Branding branding = views.Configuration.Branding;

            branding.Color1 = new ColorPair("#02172c", "#ffffff");
            branding.Color2 = new ColorPair("#08427b", "#ffffff");
            branding.Color3 = new ColorPair("#1168bd", "#ffffff");
            branding.Color4 = new ColorPair("#438dd5", "#ffffff");
            branding.Color5 = new ColorPair("#85bbf0", "#ffffff");
            branding.Logo   = ImageUtils.GetImageAsDataUri(new FileInfo("structurizr-logo.png"));

            StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret);

            structurizrClient.PutWorkspace(WorkspaceId, workspace);
        }
        static void Main(string[] args)
        {
            // a Structurizr workspace is the wrapper for a software architecture model, views and documentation
            Workspace workspace = new Workspace("Getting Started", "This is a model of my software system.");
            Model     model     = workspace.Model;

            // add some elements to your software architecture 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");

            // define some views (the diagrams you would like to see)
            ViewSet           views       = workspace.Views;
            SystemContextView contextView = views.CreateSystemContextView(softwareSystem, "SystemContext",
                                                                          "An example of a System Context diagram.");

            contextView.PaperSize = PaperSize.A5_Landscape;
            contextView.AddAllSoftwareSystems();
            contextView.AddAllPeople();

            // add some documentation
            StructurizrDocumentationTemplate template = new StructurizrDocumentationTemplate(workspace);

            template.AddContextSection(softwareSystem, Format.Markdown,
                                       "Here is some context about the software system...\n" +
                                       "\n" +
                                       "![](embed:SystemContext)");

            // add some styling
            Styles styles = views.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
            });

            UploadWorkspaceToStructurizr(workspace);
        }
Пример #12
0
        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           views       = workspace.Views;
            SystemContextView contextView = views.CreateSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram.");

            contextView.AddAllSoftwareSystems();
            contextView.AddAllPeople();

            StringWriter   stringWriter   = new StringWriter();
            PlantUMLWriter plantUMLWriter = new PlantUMLWriter();

            plantUMLWriter.Write(workspace, stringWriter);
            Console.WriteLine(stringWriter.ToString());
        }
Пример #13
0
        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();
        }
Пример #14
0
        static void Banking()
        {
            const long   workspaceId = 65772;
            const string apiKey      = "60814d99-843f-4209-aaf8-5543b56f7d22";
            const string apiSecret   = "3ee20c69-c531-4ae7-80ec-fdf71168069c";

            StructurizrClient structurizrClient = new StructurizrClient(apiKey, apiSecret);
            Workspace         workspace         = new Workspace("Ezlabor", "Ezlabor - C4 Model");
            Model             model             = workspace.Model;

            SoftwareSystem EzLaborystem = model.AddSoftwareSystem("Ezlabor System", "Ofrece el contenido estático y la aplicación desde una página de red de freelancers y empleadores");
            SoftwareSystem gmailSystem  = model.AddSoftwareSystem("Gmail System", "Sistema de correos electrónicos interno de google");
            SoftwareSystem stripeSystem = model.AddSoftwareSystem("Stripe System", "Sistema de pagos por internet ");
            SoftwareSystem TwilioSystem = model.AddSoftwareSystem("Twilio System", "Sistema de verificiación de cuenta mediante SMS ");
            //SoftwareSystem googleMapsApi = model.AddSoftwareSystem("Google Maps API", "Permite a los clientes consultar información de sus cuentas y realizar operaciones.");

            Person Empresa    = model.AddPerson("Empresa", "Compañia que busca los servicios de un freelancer");
            Person Freelancer = model.AddPerson("Freelancer", "Personas especializadas en ciertos rubros que buscan trabajar de manera independiente");
            Person Empleador  = model.AddPerson("Empleador", "Persona con una microempresa o emprendimiento que necesita del servico de un freelancer");

            EzLaborystem.AddTags("Main System");
            gmailSystem.AddTags("Gmail API");
            //googleMapsApi.AddTags("Google Maps API");

            Empresa.Uses(EzLaborystem, "Visita el sitio usando", "[HTTPS]");
            Freelancer.Uses(EzLaborystem, "Visita el sitio usando", "[HTTPS]");
            Empleador.Uses(EzLaborystem, "Visita el sitio usando", "[HTTPS]");

            EzLaborystem.Uses(gmailSystem, "Enviar mensajes de correos electrónicos interno de google");
            EzLaborystem.Uses(stripeSystem, "Realiza peticiones a la API");
            EzLaborystem.Uses(TwilioSystem, "Realiza peticiones a la API");
            gmailSystem.Delivers(Empresa, "Envia mensajes de correo electrónico");
            gmailSystem.Delivers(Freelancer, "Envia mensajes de correo electrónico");
            gmailSystem.Delivers(Empleador, "Envia mensajes de correo electrónico");


            ViewSet viewSet = workspace.Views;

            // 1. Diagrama de Contexto
            SystemContextView contextView = viewSet.CreateSystemContextView(EzLaborystem, "Contexto", "Diagrama de contexto - Ezlabor");

            contextView.PaperSize = PaperSize.A4_Landscape;
            contextView.AddAllSoftwareSystems();
            contextView.AddAllPeople();

            Styles styles = viewSet.Configuration.Styles;

            styles.Add(new ElementStyle(Tags.Person)
            {
                Background = "#0a60ff", Color = "#ffffff", Shape = Shape.Person
            });
            styles.Add(new ElementStyle("Gmail API")
            {
                Background = "#90714c", Color = "#ffffff", Shape = Shape.RoundedBox
            });
            styles.Add(new ElementStyle("Google Maps API")
            {
                Background = "#a5cdff", Color = "#ffffff", Shape = Shape.RoundedBox
            });

            // 2. Diagrama de Contenedores
            Container webApplication = EzLaborystem.AddContainer("Aplicación Web Responsive", "Permite alos usuarios administrar el perfil, ver los mensajes, ver ofertas laboraler, etc", "Angular, nginx port 80");
            Container restApi        = EzLaborystem.AddContainer("RESTful API", "Proporciona funcionalidad de red entre freelancers de perros y dueños", "SpringBoot, nginx port 5000");
            Container database       = EzLaborystem.AddContainer("Base de Datos", "Repositorio de información de los usuarios", "Mysql");
            Container LandingPage    = EzLaborystem.AddContainer("Landing Page", "Página con información de la StartUp", "Html, CSS y JS");

            webApplication.AddTags("WebApp");
            restApi.AddTags("API");
            database.AddTags("Database");
            LandingPage.AddTags("LandingPage");

            Empresa.Uses(webApplication, "Usa", "https 443");
            Empresa.Uses(LandingPage, "Usa", "https 443");
            Freelancer.Uses(webApplication, "Usa", "https 443");
            Freelancer.Uses(LandingPage, "Usa", "https 443");
            Empleador.Uses(webApplication, "Usa", "https 443");
            Empleador.Uses(LandingPage, "Usa", "https 443");
            webApplication.Uses(restApi, "Usa", "https 443");
            webApplication.Uses(stripeSystem, "https 443");
            webApplication.Uses(gmailSystem, "https 443");
            webApplication.Uses(TwilioSystem, "https 443");
            restApi.Uses(database, "Persistencia de datos");
            LandingPage.Uses(webApplication, "Redirige");

            styles.Add(new ElementStyle("WebApp")
            {
                Background = "#9d33d6", Color = "#ffffff", Shape = Shape.WebBrowser, Icon = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjM1MyIgaGVpZ2h0PSIyNTAwIiB2aWV3Qm94PSIwIDAgMjU2IDI3MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZD0iTS4xIDQ1LjUyMkwxMjUuOTA4LjY5N2wxMjkuMTk2IDQ0LjAyOC0yMC45MTkgMTY2LjQ1LTEwOC4yNzcgNTkuOTY2LTEwNi41ODMtNTkuMTY5TC4xIDQ1LjUyMnoiIGZpbGw9IiNFMjMyMzciLz48cGF0aCBkPSJNMjU1LjEwNCA0NC43MjVMMTI1LjkwOC42OTd2MjcwLjQ0NGwxMDguMjc3LTU5Ljg2NiAyMC45MTktMTY2LjU1eiIgZmlsbD0iI0I1MkUzMSIvPjxwYXRoIGQ9Ik0xMjYuMTA3IDMyLjI3NEw0Ny43MTQgMjA2LjY5M2wyOS4yODUtLjQ5OCAxNS43MzktMzkuMzQ3aDcwLjMyNWwxNy4yMzMgMzkuODQ1IDI3Ljk5LjQ5OC04Mi4xNzktMTc0LjkxN3ptLjIgNTUuODgybDI2LjQ5NiA1NS4zODNoLTQ5LjgwNmwyMy4zMS01NS4zODN6IiBmaWxsPSIjRkZGIi8+PC9zdmc+"
            });
            styles.Add(new ElementStyle("API")
            {
                Background = "#929000", Color = "#ffffff", Shape = Shape.RoundedBox, Icon = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgNzY3LjggNzY4IiB3aWR0aD0iMjQ5OSIgaGVpZ2h0PSIyNTAwIj48c3R5bGU+LnN0MHtmaWxsOiM3N2JjMWZ9PC9zdHlsZT48cGF0aCBjbGFzcz0ic3QwIiBkPSJNNjk4LjMgNDBjLTEwLjggMjUuOC0yNC41IDUwLjMtNDEgNzIuOEM1ODUuMSA0MC42IDQ4Ny4xIDAgMzg1IDAgMTczLjggMCAwIDE3NCAwIDM4NS41IDAgNDkxIDQzLjIgNTkyIDExOS42IDY2NC44bDE0LjIgMTIuNmM2OS40IDU4LjUgMTU3LjMgOTAuNyAyNDggOTAuNyAyMDAuOCAwIDM2OS42LTE1Ny40IDM4My45LTM1OCAxMC41LTk4LjItMTguMy0yMjIuNC02Ny40LTM3MC4xem0tNTI0IDYyN2MtNi4yIDcuNy0xNS43IDEyLjItMjUuNiAxMi4yLTE4LjEgMC0zMi45LTE0LjktMzIuOS0zM3MxNC45LTMzIDMyLjktMzNjNy41IDAgMTQuOSAyLjYgMjAuNyA3LjQgMTQuMSAxMS40IDE2LjMgMzIuMyA0LjkgNDYuNHptNTIyLjQtMTE1LjRjLTk1IDEyNi43LTI5Ny45IDg0LTQyOCA5MC4xIDAgMC0yMy4xIDEuNC00Ni4zIDUuMiAwIDAgOC43LTMuNyAyMC04IDkxLjMtMzEuOCAxMzQuNS0zOCAxOTAtNjYuNSAxMDQuNS01My4yIDIwNy44LTE2OS42IDIyOS4zLTI5MC43QzYyMS45IDM5OC4yIDUwMS4zIDQ5OC4zIDM5MS40IDUzOWMtNzUuMyAyNy44LTIxMS4zIDU0LjgtMjExLjMgNTQuOGwtNS41LTIuOUM4MiA1NDUuOCA3OS4yIDM0NS4xIDI0Ny41IDI4MC4zYzczLjctMjguNCAxNDQuMi0xMi44IDIyMy44LTMxLjggODUtMjAuMiAxODMuMy04NCAyMjMuMy0xNjcuMiA0NC44IDEzMy4xIDk4LjcgMzQxLjUgMi4xIDQ3MC4zeiIvPjwvc3ZnPg=="
            });
            styles.Add(new ElementStyle("Database")
            {
                Background = "#ff0000", Color = "#ffffff", Shape = Shape.Cylinder
            });
            styles.Add(new ElementStyle("LandingPage")
            {
                Background = "#d1c07b", Color = "#ffffff", Shape = Shape.WebBrowser
            });
            ContainerView containerView = viewSet.CreateContainerView(EzLaborystem, "Contenedor", "Diagrama de contenedores - EzLabor");

            contextView.PaperSize = PaperSize.A4_Landscape;
            containerView.AddAllElements();

            // 3. Diagrama de Componentes

            //Controllers
            Component signinController            = restApi.AddComponent("Sign in Controller", "Permite a los usuarios ingresar al sistema de Ezlabor", "SpringBoot REST Controller");
            Component notificaionSystemController = restApi.AddComponent("Notification System Controller", "Permite al usuario recibir notificaciones", "SpringBoot REST Controller");
            Component subscriptionController      = restApi.AddComponent("Subscription System Controller", "Permite al usuario recibir notificaciones", "SpringBoot REST Controller");
            Component MessageSystemController     = restApi.AddComponent("Message System Controller", "Permite a los usuarios comunicarse mediante mensajes det texto", "SpringBoot REST Controller");
            Component LocationsController         = restApi.AddComponent("Location System Controller", "Permite a los usuarios ver los distintos tipos de localidades", "SpringBoot REST Controller");
            Component UserProfileController       = restApi.AddComponent("User profile System Controller", "Permite a los usuarios editar su perfil", "SpringBoot REST Controller");
            Component HiringController            = restApi.AddComponent("Hiring System Controller", "Permite usar los servicios de contratación y reunión que estan disponibles", "SpringBoot REST Controller");

            //Services
            Component signinService            = restApi.AddComponent("Sign in Service", "Permite usar los servicios de sign in que se encuentra en la API");
            Component notificaionSystemService = restApi.AddComponent("Notification System Service", "Permite usar el servicio de notificación de la API");
            Component subscriptionService      = restApi.AddComponent("Subscription System Service", "Permite usar los servicios de subscripción de la API");
            Component MessageSystemService     = restApi.AddComponent("Message System Service", "Permite usar el servicio de mensajería de la API");
            Component LocationsService         = restApi.AddComponent("Locations System Service", "Permite usar el servicio de localización de la API");
            Component UserProfileService       = restApi.AddComponent("User profile System Service", "Permite usar el servicio de perfil de usuario de la API");
            Component HiringService            = restApi.AddComponent("Hiring System Service", "Permite usar el servicio de contratación  de la API");

            //Repositories
            Component signinRepository            = restApi.AddComponent("Sign in Repository", "Permite la comunicación entre el servicio de sign in  y la base de datos");
            Component notificaionSystemRepository = restApi.AddComponent("Notification System Repository", "Permite la comunicación entre el servicio de notificación y la base de datos");
            Component subscriptionRepository      = restApi.AddComponent("Subscription System Repository", "Permite la comunicación entre el servicio de subscripción y la base de datos");
            Component MessageSystemRepository     = restApi.AddComponent("Message  System Repository", "Permite la comunicación entre el servicio de mensajería  y la base de datos");
            Component LocationsRepository         = restApi.AddComponent("Location System Repository", "Permite la comunicación entre el servicio localización y la base de datos");
            Component UserProfileRepository       = restApi.AddComponent("User profile System Repository", "Permite la comunicación entre el servicio de perfil de usuario y la base de datos");
            Component HiringRepository            = restApi.AddComponent("Hiring System Repository", "Permite la comunicación entre el servicio de contratación  y la base de datos");

            // Uses
            restApi.Components.Where(c => "SpringBoot REST Controller".Equals(c.Technology)).ToList().ForEach(c => webApplication.Uses(c, "Uses", "HTTPS"));

            signinController.Uses(signinService, "Uses");
            notificaionSystemController.Uses(notificaionSystemService, "Uses");
            subscriptionController.Uses(subscriptionService, "Uses");
            MessageSystemController.Uses(MessageSystemService, "Uses");
            LocationsController.Uses(LocationsService, "Uses");
            UserProfileController.Uses(UserProfileService, "Uses");
            HiringController.Uses(HiringService, "Uses");


            signinService.Uses(signinRepository, "Uses");
            notificaionSystemService.Uses(notificaionSystemRepository, "Uses");
            subscriptionService.Uses(subscriptionRepository, "Uses");
            MessageSystemService.Uses(MessageSystemRepository, "Uses");
            LocationsService.Uses(LocationsRepository, "Uses");
            UserProfileService.Uses(UserProfileRepository, "Uses");
            HiringService.Uses(HiringRepository, "Uses");


            signinRepository.Uses(database, "Lee y escribes datos");
            notificaionSystemRepository.Uses(database, "Lee y escribes datos");
            subscriptionRepository.Uses(database, "Lee y escribes datos");
            MessageSystemRepository.Uses(database, "Lee y escribes datos");
            LocationsRepository.Uses(database, "Lee y escribes datos");
            UserProfileRepository.Uses(database, "Lee y escribes datos");
            HiringRepository.Uses(database, "Lee y escribes datos");



            ComponentView componentViewForRestApi = viewSet.CreateComponentView(restApi, "Components", "The components diagram for the REST API");

            componentViewForRestApi.PaperSize = PaperSize.A4_Landscape;
            componentViewForRestApi.AddAllContainers();
            componentViewForRestApi.AddAllComponents();
            componentViewForRestApi.Add(Empleador);
            componentViewForRestApi.Add(Empresa);
            componentViewForRestApi.Add(Freelancer);

            structurizrClient.UnlockWorkspace(workspaceId);
            structurizrClient.PutWorkspace(workspaceId, workspace);
        }
        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.PutWorkspace(WorkspaceId, workspace);
        }
Пример #16
0
        static void Main(string[] args)
        {
            Workspace workspace = new Workspace("Architectural Kata: Make the Grade",
                                                "This is a model of the solution to the architectural kata \"Make the Grade\", found at http://nealford.com/katas/list.html.");

            #region Models

            Model model = workspace.Model;

            Person student = model.AddPerson("Student", "A student undertaking a test.");
            Person grader  = model.AddPerson("Grader", "A grader assessing the sudents' test answers.");
            Person admin   = model.AddPerson("Administrator", "A representative of the state authority in education.");

            SoftwareSystem resultsRepoSubSystem = model.AddSoftwareSystem("Results Repository", "Single location representing all of the test scores across the state.");
            admin.Uses(resultsRepoSubSystem, "Extracts grading reports.");

            SoftwareSystem testsCatalogueSubSystem = model.AddSoftwareSystem("Tests Catalogue", "Authoritative source for tests and grading rules.");
            admin.Uses(testsCatalogueSubSystem, "Administers tests.");

            SoftwareSystem localTestUnitSubSystem = model.AddSoftwareSystem("Local Testing Unit", "On-premises testing subsystem deployed in each testing center.");
            student.Uses(localTestUnitSubSystem, "Undertakes tests");
            grader.Uses(localTestUnitSubSystem, "Grades students");

            localTestUnitSubSystem.Uses(resultsRepoSubSystem, "Push results (batch)");
            localTestUnitSubSystem.Uses(testsCatalogueSubSystem, "Pull tests");

            Container resultsRepo = resultsRepoSubSystem.AddContainer("Results Database",
                                                                      "Single location representing all of the test scores across the state.", "Microsoft Azure SQL Database");
            resultsRepo.AddTags("Database");
            Container reportingService = resultsRepoSubSystem.AddContainer("Reporting Service",
                                                                           "A reporting system to know which students have taken the tests and what score they received.", "ASP.NET single page app");
            reportingService.Uses(resultsRepo, "Reads from");

            Container testsCatalogueService = testsCatalogueSubSystem.AddContainer("Catalogue Service",
                                                                                   "Web API provider of latest test and grading rules.", "ASP.NET Web API microservice");
            Container testsCatalogueFrontEnd = testsCatalogueSubSystem.AddContainer("Catalogue Front End",
                                                                                    "Front end application for administrators managing tests.", "ASP.NET MVC web app");
            Container testsRepo = testsCatalogueSubSystem.AddContainer("Tests Repository",
                                                                       "Stores test questions, answers and grading rules.", "NoSQL DBMS");
            testsRepo.AddTags("Database");
            testsCatalogueFrontEnd.Uses(testsRepo, "Reads from and writes to");
            testsCatalogueService.Uses(testsRepo, "Reads from");

            Container locatTestResultsStorage = localTestUnitSubSystem.AddContainer("Local Tests Storage",
                                                                                    "Stores test answers and grades for students from local testing unit.", "MySQL database");
            locatTestResultsStorage.AddTags("Database");
            Container testingApp = localTestUnitSubSystem.AddContainer("Testing application",
                                                                       "Allows students to undertake tests and graders to assess them.", "AngularJS web app");
            Container testResultQueue = localTestUnitSubSystem.AddContainer("Test results queue",
                                                                            "Asynchronous queue on which an event is placed when a student finishes a test, so that a grader can be notified.", "RabbitMQ");
            testResultQueue.AddTags("Queue");
            Container evaluator = localTestUnitSubSystem.AddContainer("Evaluator",
                                                                      "Retrieves a finished test, grades the multiple choice answers and gives manual control to graders", "");
            Container synchronizer = localTestUnitSubSystem.AddContainer("Synchronizer",
                                                                         "Uploads local test results to central repository", "WCF service");
            synchronizer.Uses(resultsRepoSubSystem, "Push results (batch)");
            synchronizer.Uses(locatTestResultsStorage, "Read from");

            testingApp.Uses(testResultQueue, "Undertake test");
            testingApp.Uses(testsCatalogueSubSystem, "Pull tests");
            testResultQueue.Uses(evaluator, "Notify grader");
            evaluator.Uses(locatTestResultsStorage, "Store and read results");
            evaluator.Uses(testsCatalogueSubSystem, "Pull tests");

            #endregion

            #region Views

            var layoutWorkspace = WorkspaceUtils.LoadWorkspaceFromJson(new FileInfo("layout.json"));

            ViewSet           viewSet     = workspace.Views;
            SystemContextView contextView = viewSet.CreateSystemContextView(testsCatalogueSubSystem, "SystemContext", "A system used for standardized testing across all public school systems grades 3-12.");
            contextView.AddAllSoftwareSystems();
            contextView.AddAllPeople();
            contextView.AddNearestNeighbours(testsCatalogueSubSystem);
            contextView.CopyLayoutInformationFrom(layoutWorkspace.Views.SystemContextViews.FirstOrDefault(x => x.Key == "SystemContext"));

            ContainerView resultsContainerView = viewSet.CreateContainerView(resultsRepoSubSystem, "ResultsContainer", "The container diagram for the Results Repository Subsystem.");
            admin.Uses(reportingService, "Extracts reports");
            resultsContainerView.Add(admin);
            resultsContainerView.AddAllContainers();
            resultsContainerView.CopyLayoutInformationFrom(layoutWorkspace.Views.ContainerViews.FirstOrDefault(x => x.Key == "ResultsContainer"));

            ContainerView testsContainerView = viewSet.CreateContainerView(testsCatalogueSubSystem, "TestsContainers", "The container diagram for the Tests Catalogue Subsystem.");
            admin.Uses(testsCatalogueFrontEnd, "Administers tests");
            testsContainerView.Add(admin);
            testsContainerView.AddAllContainers();
            testsContainerView.CopyLayoutInformationFrom(layoutWorkspace.Views.ContainerViews.FirstOrDefault(x => x.Key == "TestsContainers"));

            ContainerView testUnitContainerView = viewSet.CreateContainerView(localTestUnitSubSystem, "TestUnitsContainers", "The container diagram for the Local Testing Unit Subsystem.");
            student.Uses(testingApp, "Undertake test");
            grader.Uses(evaluator, "Grade test answers");
            testUnitContainerView.Add(student);
            testUnitContainerView.Add(grader);
            testUnitContainerView.AddAllContainers();
            testUnitContainerView.Add(resultsRepoSubSystem);
            testUnitContainerView.Add(testsCatalogueSubSystem);
            testUnitContainerView.CopyLayoutInformationFrom(layoutWorkspace.Views.ContainerViews.FirstOrDefault(x => x.Key == "TestUnitsContainers"));

            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
            });
            styles.Add(new ElementStyle("Database")
            {
                Shape = Shape.Cylinder
            });
            styles.Add(new ElementStyle("Queue")
            {
                Shape = Shape.Ellipse
            });

            #endregion

            PushWorkspace(workspace);
        }
Пример #17
0
 public void test_AddAllPeople_DoesNothing_WhenThereAreNoPeople()
 {
     Assert.AreEqual(1, view.Elements.Count);
     view.AddAllPeople();
     Assert.AreEqual(1, view.Elements.Count);
 }
Пример #18
0
        static void Banking()
        {
            const long   workspaceId = 54351;
            const string apiKey      = "c289e1d0-d703-4114-bd20-0c57e2e3c18f";
            const string apiSecret   = "5795af71-0e72-4b66-a286-ac801015b755";

            StructurizrClient structurizrClient = new StructurizrClient(apiKey, apiSecret);
            Workspace         workspace         = new Workspace("Inventory", "Inventory - C4 Model");
            Model             model             = workspace.Model;

            SoftwareSystem internetBankingSystem = model.AddSoftwareSystem("Inventory", "Permite a los clientes consultar información de sus inventarios.");

            Person cliente = model.AddPerson("Cliente", "Cliente de Inventory.");

            cliente.Uses(internetBankingSystem, "Realiza consultas sobre sus inventarios.");

            ViewSet viewSet = workspace.Views;

            // 1. Diagrama de Contexto
            SystemContextView contextView = viewSet.CreateSystemContextView(internetBankingSystem, "Contexto", "Diagrama de contexto - Banking");

            contextView.PaperSize = PaperSize.A4_Landscape;
            contextView.AddAllSoftwareSystems();
            contextView.AddAllPeople();
            //contextView.EnableAutomaticLayout();

            Styles styles = viewSet.Configuration.Styles;

            styles.Add(new ElementStyle(Tags.Person)
            {
                Background = "#0a60ff", Color = "#ffffff", Shape = Shape.Person
            });
            styles.Add(new ElementStyle("Mobile App")
            {
                Background = "#29c732", Color = "#ffffff", Shape = Shape.MobileDevicePortrait
            });
            styles.Add(new ElementStyle("Mainframe")
            {
                Background = "#90714c", Color = "#ffffff", Shape = Shape.RoundedBox
            });
            styles.Add(new ElementStyle("SendGrid")
            {
                Background = "#a5cdff", Color = "#ffffff", Shape = Shape.RoundedBox
            });

            // 2. Diagrama de Contenedores
            Container webApplication        = internetBankingSystem.AddContainer("Aplicación Web React", "Permite a los clientes consultar información de sus inventarios", "ReactJS, nginx port 80");
            Container webApplicationVue     = internetBankingSystem.AddContainer("Aplicación Web Vue", "Permite a los clientes consultar información de sus inventarios", "Vue, nginx port 80");
            Container webApplicationAngular = internetBankingSystem.AddContainer("Aplicación Web Angular", "Permite a los clientes consultar información de sus inventarios", "Angular, nginx port 80");
            Container restApi    = internetBankingSystem.AddContainer("RESTful API", "Permite a los clientes consultar información de sus inventarios", "Nest, nginx port 80");
            Container root       = internetBankingSystem.AddContainer("ROOT", "Permite integrar los micro-frontends", "Single SPA, nginx port 80");
            Container database   = internetBankingSystem.AddContainer("Base de Datos", "Repositorio de información de inventarios.", "Postgres port 5432");
            Container hearthbeat = internetBankingSystem.AddContainer("HearthBeat", "Verifica cada 10 segundos que el API se este ejecutando", "Nodejs, ngix");

            webApplication.AddTags("WebAppReact");
            webApplicationVue.AddTags("WebAppVue");
            webApplicationAngular.AddTags("WebAppAngular");
            restApi.AddTags("API");
            database.AddTags("Database");
            root.AddTags("Root");
            hearthbeat.AddTags("HearthBeat");

            cliente.Uses(root, "Usa", "https 443");
            root.Uses(webApplicationVue, "Usa", "https 443");
            root.Uses(webApplicationAngular, "Usa", "https 443");
            root.Uses(webApplication, "Usa", "https 443");
            webApplication.Uses(restApi, "Usa", "https 443");
            webApplicationVue.Uses(restApi, "Usa", "https 443");
            webApplicationAngular.Uses(restApi, "Usa", "https 443");
            restApi.Uses(database, "Usa", "typeorm 5432");
            hearthbeat.Uses(restApi, "Petición", "https 443");

            styles.Add(new ElementStyle("WebAppReact")
            {
                Background = "#9d33d6", Color = "#ffffff", Shape = Shape.WebBrowser, Icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQsAAAC9CAMAAACTb6i8AAAAV1BMVEX///9h2vtU2PtT2Pv3/f/7/v9p3Pvw+/+x6/30/P9v3fuQ5Pxi2vvi+P7b9v6E4fzE8P2o6f2J4vx33/u97v3T9P7I8f3p+f6a5vyf5/zV9P7e9v637f08lRSdAAANJklEQVR4nO1d53qjOhANooMxHVzy/s95DWjUUMvGDuh+On+yG4ODRpp+JL6+PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PN6POP7N3emc5u96kkORDmWCXijK7PoPdze3YrkbBX02v//h/hRz+RoGxmtE5fiTm/Pvgt4doLBzWhrfdCh4QEGbWt577dDu7u+PPu1HUYqDWVdHaTO9j15ybxDeP/7MH4JMFKs4SpMpfEolsdzqqDB2CsIMKdPdmJeh+s7prx7/nZgZoxmGiFd+lKit6MBficKgSJi7oz8cw7tQw2Buj9fj59dv3haGpTzmSDn1QEk7rgpV3UL4uj8dxVtQ4SGhB/lV3LDjRMFDclvDXoFuFf1khC+0dUTnQYmfnNeFijUFe68QM+YWBRmvDtN2K2o/++DvR4QHtVvRc0elgXp+jquEEUW70yEs3uSDj/0R4LUuW9BXVlMe+3s2ayK5EVtjJNOtM6PbxlRKP2S8LeNd72TBqLxM7aaSSK0FQVpThwtaRH8VqlwFXjjFJx74c4DlrMzV6dJA9XJRXtC1ogw9Urxy3Mrgp21ktfoKxk4W+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hlZay4PdlhtaM7/+lLFiakk2NxmFZWNh7WiO2iKCctJ29jR9ZwHDkkTm0jl30qbaHFHO8XjPhKj9qV8RvgJNrE+1EbEarGcQbnIzBcW6mt4bpvvVq8KpO5ma4DK6tWD+oBGjLMdSyjTJDWeSUuJonkHnT28C83At1mowEq96J2FkWAM6y0sjlzJsyF6uSMlso1BY3sVGk06HQP/XI2IgtB2EYxMpDgPDmOrfCC+gVKTQ7ohxuRN91x5xDVMhztNbNXhHwn2VREbBzAoG4zL5u9ybTLpyluvX6ERot75c7y34UvMaT0tOQxB9j5+Rcnx3I4GJp68m8hju4iFYyYrcdXARpQP/JrUhrATR+EtbQjWygiTqJHrDbE1HQMnEo7FVxrFO0guzSxoF4/OA5bYrav8C07zOsEeRwaKdeeodBukEoKO/3suePL0a1Mtfkt3cvlJy67gkd4fgjCP8Fkq111Bbosra0U9/p2HtkCaSU6HWqTUH0VUqYXaB5ydWpEUvZ8gjZHN08yaVh8Y7Vs2K/Ml6+wbIoNdY7Zpf23e2nB38+9HIq8g9unlvujR0ocI3AJ6LpCS+tbH48rdV3BwS3rnHUVLCIq3Fqxuqfk8t8fj4rd+2Eh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHhwv4D6lPd+BMG60pAAAAAElFTkSuQmCC"
            });
            styles.Add(new ElementStyle("WebAppVue")
            {
                Background = "#9d33d6", Color = "#ffffff", Shape = Shape.WebBrowser, Icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPEAAADRCAMAAAAquaQNAAAAyVBMVEX///9BuIM0SV5CvYUzQFw0Rl0zQlxCvoU9t4Eqs3k0R145tn80RF0zPls0tX08t4D3/Po1UWA9nXnp9vBAsoGe17w/p33x+vbi8+s1VGG44c3W7uI2YGXE5tZlw5iv3sc6gG9bwJI7iHI3Z2eM0LBPvYtzyKA2XGQ+o3u949E4cmqJz648knU9mXg5eW0/rX8lPVWUo6hugYoZNlDEzs88kHXP2NhLYm85dWuvvL4hQVWImJ7k6uqksLR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hQxMKkL7U4wcqCj0JJYQMLgBpSaHHdUBFoSWPUo+XKSwA6RgUGSaT465FQqXS4zoMEirTZHLQApCCXJPJARVFNaY9ejG4Efs3OaUe1wELQJULzjeZLoibUGn1uA6qKERS63EdUFFIJNfjOiImVH6lHj9QUZSTkYSQwYqijGZ69GIQKaHyLPX4ibLgTPS4jigFoNwkhAxUFD6ykxAyuIvCs8UtSSZH7YSatCWZHHUVRcM9ejGoqSjalEyOWgWgzEs9fmolVO6lHj+74QmVrYSQqaEo8pUQMsGKIkM9riNUUZgdFGhPYELlLSFkghKqJaUeP0EFoHYmkyNAomcvIWQCEqqtyeTABaA2SAiRKfxvSa0q9fiBfX7tkBAySFG0OpkcKKHanUwOINFbIyFkZurb9SCHHr0YqBOq9cl0gfrelXqi0VAWgNolIWRUiqJlEkJGpSjaJiFkFIqidRJCZlp5u26hhJCpLAC1UULIVPT5tVJCyFQkVJeSySEmVEslhIyYUG0v9fgRFEVrJYRMuUTPskcvBqUJ1b1kcpQoik6UevyUFIC6Uerx41UUnUwmh1dRtOfvTUPwFIC6U+rx4pPoHU0mx0KfXxckhMwVRdHhZHJcSaguJ5Pjf4qi5Xpcx7yi6IyEkJlLqI4n0wVzV3XqqTTERZ9fF0s9fs4TatAlCSFzXgDqloSQOVMUHZMQMqf/LekfSSbHn4TqbqnHTzH4V5LJsf37n0kmR7Knrf8AbQ77fX5h1q4AAAAASUVORK5CYII="
            });
            styles.Add(new ElementStyle("WebAppAngular")
            {
                Background = "#9d33d6", Color = "#ffffff", Shape = Shape.WebBrowser, Icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAzFBMVEX////DAC/dADHQADDBACXcACfCACvCACjdAC3dAC/AABrBACDcACW+AADDACTocoLXcoHbABvcACHbABXgMUzIMUrtxsy/ABH13eHbAA7cAB/78fPmrLTdj5q/AAjbABftmqTptr3wq7TNSl7GFjrfIELkWWzvo6z419vaAAD75unjS2DqhJHpeYjytLz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eY+ryFdwSsvUvHkGnaudS0pyEd/XgF+AsicQeBj9beSGmfejo89XlPRQjMfPb5V8B0b2/TJ1pJ/g38gR8EIs+DElgUlpv8cRjQu+ozaGRQ6Hf/7OrBT6tz+o0i6QprPzmugJRxWqLeHZqqsF7byQc0we2Y5jg0hcUR3F3LzvCY9HWkKCw3f+zn+aQky7FXGBjM/h72+HBibTm2Cv3ah/0+lnRZtbQcS4X1HQyEadx2rCzHSmGxuQeDgQyv+xY357FQGBhMVg9ev5yaW46xQn90luHTZIXlGGo0VLh3g4Es82aWY6awXuS94sKOScvEckwUHnXhFsxMGH6b61uOvsJy81VWBgMxsBxdhRkbDOThpKOnUU+h373L2mAgmpajpfBlGAxkMtC4pF9D4YsxGMjwW/oqJ1XhizIYSLrlpDXCoy/sp6+ZmX1SW4767Fr3jnNfyq5YPVpeqZCr+dyXkOyKi5b87IXiiqER90VAu2QhtRyZwuLo80s2GMj9jcRycIX+6O9LNxiIxHIwhX739SEYDAS1HERhLXcoBgO5aIBVDlBYrx2SwUAW24PVlsJi8+NhGQxk23I2FAYGs58Se7fMNiryhMLAYHZ1lmzfJC3nSaF/yAYDOS21N+9fevAGA4kr8sJ6BcN/XVrm3B+HFwIIheXmP2EwkPCsXGGXp+GzZ3U+Luz2NHz2nBb2f5bM4XA4HA6Hw+FwOBwOx7/A/0fFGxADXZ4GAAAAAElFTkSuQmCC"
            });
            styles.Add(new ElementStyle("API")
            {
                Background = "#929000", Color = "#ffffff", Shape = Shape.RoundedBox, Icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT4AAACfCAMAAABX0UX9AAAA21BMVEUXGhzrKEXTHlruKUMAGRngI0/hJE7nJknaIVTlJUvcIlLYIFYAGRjjJUzeIlHVH1jpJ0cRGhvzKUcMGhsAGhbZHlz1KkUTGhvnKET5KUiXIjPbJ0KpIzfjKETPJj8iGx4rGx8zGyAbGh1QHSVsHyrDJT0+HCHXJUWBIC/HJT2QITKdIjU/GyeQHELFHlXNHlh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ay8RpxLSvtDJiI19BYElP4quW+5eBN8GUNKCfjB9AQv4sd5R5LOwLwJFpWSbaBx0XZ/PEvgVaFi7uMLzlgvTQzDNWsd+5TKm5Kx0vCxQ5oWcS4+S4DbYDN4OPvWjDaEpC3mHQl+JSzSCNtaOnTwWA4dUSPNOu4jNSrxJcMUrXapIh7cTcM6Oxjj4DcT4pPU65i8GlFRwazE6rVH9XQkpUxFTlWYZJDHJ22pCX5e9Bs9Ez4c4Ac+er3L3wksaGf1m1yZZb1Az89doOJNCBnk6uOqa9GQbGWm3iyP/AlvXQgZLGjEo7X+9jBCy7VPVfIo9SVm0up5/tRELkOPVW1B8TTxHlc/lPWG4Be0xMPyTaMO8g1loFHrfjCo1HrY9OTwUoSQVfEarcrlhdFPBJodbM/0q6Hj81m47qTX3oUgd4fNJrN0SAuXqVgkO4/s0619oDYuX9XflXd5uVCxIBFC6b4Zgx3SKNQKBQKhUKhUCgUCoVCoVAoFAqFQqFQqGrof00XLPDtIJowAAAAAElFTkSuQmCC"
            });
            styles.Add(new ElementStyle("Root")
            {
                Background = "#929000", Color = "#ffffff", Shape = Shape.RoundedBox, Icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAA+VBMVEUAEf////8AAP8FFaXOzs7Ly8sFFaIFFZ8AAJ8ADP8FFaEAAKIAAJ3r7P/Q0NB4fP91ef/m5//r6+uVmP/v8P8BEffLzf+usP/z9P+Ul/9tcf+bnv/c3v/29/8AEfyHiv/Q0v+2uP+kpv9ITf/Bw//GyP8FFapkaP8DE9BbYP/i4/+7vf/W1/9TWP9CSP+Pkv81PP8EFLwAAMECEustNP9/gv9dYv8cJf+Kjf+oq//T1eyhpNY7Qf/CxOQEFMAnL/8DE9p7f8eprOlvdMIsNa1mar4eKKpaX7qNkMxPVba9v+Hg4OBARrGwstqFiNwAD+1YXtGVmdHX18i+kY62AAAM4klEQVR4nO2de1vbuBKHE6UkMYUQruGWcA/XcCtQoBTo9r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PVGOPp6Ixx9vRGOvt4IR19vhKOv/wGRCRiDhCWn+gAAAABJRU5ErkJggg=="
            });
            styles.Add(new ElementStyle("Database")
            {
                Background = "#ff0000", Color = "#ffffff", Shape = Shape.Cylinder
            });

            ContainerView containerView = viewSet.CreateContainerView(internetBankingSystem, "Contenedor", "Diagrama de contenedores - Banking");

            contextView.PaperSize = PaperSize.A4_Landscape;
            containerView.AddAllElements();
            //containerView.EnableAutomaticLayout();

            // 3. Diagrama de Componentes
            Component transactionController     = restApi.AddComponent("Products Controller", "Permite a los usuarios manejar sus productos.", "Nest REST Controller");
            Component signinController          = restApi.AddComponent("Auth Controller", "Permite a los usuarios iniciar sesión en Inventory.", "Nest REST Controller");
            Component accountsSummaryController = restApi.AddComponent("Customers Controller", "Proporciona a los clientes un resumen de sus cuentas.", "Nest REST Controller");
            Component qualityController         = restApi.AddComponent("Quality Controller", "Permite diagnosticar el estado del sistema.", "Nest REST Controller ");

            restApi.Components.Where(c => "Nest REST Controller".Equals(c.Technology)).ToList().ForEach(c => webApplication.Uses(c, "Uses", "HTTPS"));
            restApi.Components.Where(c => "Nest REST Controller".Equals(c.Technology)).ToList().ForEach(c => webApplicationVue.Uses(c, "Uses", "HTTPS"));
            restApi.Components.Where(c => "Nest REST Controller".Equals(c.Technology)).ToList().ForEach(c => webApplicationAngular.Uses(c, "Uses", "HTTPS"));
            // accountsSummaryController.Uses(mainframeBankingSystemFacade, "Uses");
            transactionController.Uses(database, "Lee y escribe en", "Typeorm");
            signinController.Uses(database, "Lee y escribe en", "Typeorm");
            accountsSummaryController.Uses(database, "Lee y escribe en", "Typeorm");
            hearthbeat.Uses(qualityController, "Usa", "https");

            ComponentView componentViewForRestApi = viewSet.CreateComponentView(restApi, "Components", "The components diagram for the REST API");

            componentViewForRestApi.PaperSize = PaperSize.A4_Landscape;
            componentViewForRestApi.AddAllContainers();
            componentViewForRestApi.AddAllComponents();
            componentViewForRestApi.Add(cliente);
            //componentViewForRestApi.EnableAutomaticLayout();

            structurizrClient.UnlockWorkspace(workspaceId);
            structurizrClient.PutWorkspace(workspaceId, workspace);
        }
Пример #19
0
        static void Main(string[] args)
        {
            Workspace workspace = new Workspace("Financial Risk System", "A simple example C4 model based upon the financial risk system architecture kata, created using Structurizr for .NET");
            Model     model     = workspace.Model;

            // create the basic model
            SoftwareSystem financialRiskSystem = model.AddSoftwareSystem(Location.Internal, "Financial Risk System", "Calculates the bank's exposure to risk for product X");

            Person businessUser = model.AddPerson(Location.Internal, "Business User", "A regular business user");

            businessUser.Uses(financialRiskSystem, "Views reports using");

            Person configurationUser = model.AddPerson(Location.Internal, "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(Location.Internal, "Trade Data System", "The system of record for trades of type X");

            financialRiskSystem.Uses(tradeDataSystem, "Gets trade data from");

            SoftwareSystem referenceDataSystem = model.AddSoftwareSystem(Location.Internal, "Reference Data System", "Manages reference data for all counterparties the bank interacts with");

            financialRiskSystem.Uses(referenceDataSystem, "Gets counterparty data from");

            SoftwareSystem emailSystem = model.AddSoftwareSystem(Location.Internal, "E-mail system", "Microsoft Exchange");

            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(Location.Internal, "Central Monitoring Service", "The bank-wide monitoring and alerting dashboard");

            financialRiskSystem.Uses(centralMonitoringService, "Sends critical failure alerts to", "SNMP", InteractionStyle.Asynchronous).AddTags(AlertTag);

            SoftwareSystem activeDirectory = model.AddSoftwareSystem(Location.Internal, "Active Directory", "Manages users and security roles across the bank");

            financialRiskSystem.Uses(activeDirectory, "Uses for authentication and authorisation");

            Container webApplication = financialRiskSystem.AddContainer("Web Application", "Allows users to view reports and modify risk calculation parameters", "ASP.NET MVC");

            businessUser.Uses(webApplication, "Views reports using");
            configurationUser.Uses(webApplication, "Modifies risk calculation parameters using");
            webApplication.Uses(activeDirectory, "Uses for authentication and authorisation");

            Container batchProcess = financialRiskSystem.AddContainer("Batch Process", "Calculates the risk", "Windows Service");

            batchProcess.Uses(emailSystem, "Sends a notification that a report is ready to");
            batchProcess.Uses(tradeDataSystem, "Gets trade data from");
            batchProcess.Uses(referenceDataSystem, "Gets counterparty data from");
            batchProcess.Uses(centralMonitoringService, "Sends critical failure alerts to", "SNMP", InteractionStyle.Asynchronous).AddTags(AlertTag);

            Container fileSystem = financialRiskSystem.AddContainer("File System", "Stores risk reports", "Network File Share");

            webApplication.Uses(fileSystem, "Consumes risk reports from");
            batchProcess.Uses(fileSystem, "Publishes risk reports to");

            Component scheduler             = batchProcess.AddComponent("Scheduler", "Starts the risk calculation process at 5pm New York time", "Quartz.NET");
            Component orchestrator          = batchProcess.AddComponent("Orchestrator", "Orchestrates the risk calculation process", "C#");
            Component tradeDataImporter     = batchProcess.AddComponent("Trade data importer", "Imports data from the Trade Data System", "C#");
            Component referenceDataImporter = batchProcess.AddComponent("Reference data importer", "Imports data from the Reference Data System", "C#");
            Component riskCalculator        = batchProcess.AddComponent("Risk calculator", "Calculates risk", "C#");
            Component reportGenerator       = batchProcess.AddComponent("Report generator", "Generates a Microsoft Excel compatible risk report", "C# and Microsoft.Office.Interop.Excel");
            Component reportPublisher       = batchProcess.AddComponent("Report distributor", "Publishes the report to the web application", "C#");
            Component emailComponent        = batchProcess.AddComponent("E-mail component", "Sends e-mails", "C#");
            Component reportChecker         = batchProcess.AddComponent("Report checker", "Checks that the report has been generated by 9am singapore time", "C#");
            Component alertComponent        = batchProcess.AddComponent("Alert component", "Sends SNMP alerts", "C# and #SNMP Library");

            scheduler.Uses(orchestrator, "Starts");
            scheduler.Uses(reportChecker, "Starts");
            orchestrator.Uses(tradeDataImporter, "Imports data using");
            tradeDataImporter.Uses(tradeDataSystem, "Imports data from");
            orchestrator.Uses(referenceDataImporter, "Imports data using");
            referenceDataImporter.Uses(referenceDataSystem, "Imports data from");
            orchestrator.Uses(riskCalculator, "Calculates the risk using");
            orchestrator.Uses(reportGenerator, "Generates the risk report using");
            orchestrator.Uses(reportPublisher, "Publishes the risk report using");
            reportPublisher.Uses(fileSystem, "Publishes the risk report to");
            orchestrator.Uses(emailComponent, "Sends e-mail using");
            emailComponent.Uses(emailSystem, "Sends a notification that a report is ready to");
            reportChecker.Uses(alertComponent, "Sends alerts using");
            alertComponent.Uses(centralMonitoringService, "Sends alerts using", "SNMP", InteractionStyle.Asynchronous).AddTags(AlertTag);

            // create some views
            ViewSet           viewSet     = workspace.Views;
            SystemContextView contextView = viewSet.CreateSystemContextView(financialRiskSystem, "Context", "");

            contextView.PaperSize = PaperSize.A4_Landscape;
            contextView.AddAllSoftwareSystems();
            contextView.AddAllPeople();

            ContainerView containerView = viewSet.CreateContainerView(financialRiskSystem, "Containers", "");

            contextView.PaperSize = PaperSize.A4_Landscape;
            containerView.AddAllElements();

            ComponentView componentViewForBatchProcess = viewSet.CreateComponentView(batchProcess, "Components", "");

            contextView.PaperSize = PaperSize.A3_Landscape;
            componentViewForBatchProcess.AddAllElements();
            componentViewForBatchProcess.Remove(configurationUser);
            componentViewForBatchProcess.Remove(webApplication);
            componentViewForBatchProcess.Remove(activeDirectory);

            // tag and style some elements
            Styles styles = viewSet.Configuration.Styles;

            financialRiskSystem.AddTags("Risk System");

            styles.Add(new ElementStyle(Tags.Element)
            {
                Color = "#ffffff", FontSize = 34
            });
            styles.Add(new ElementStyle("Risk System")
            {
                Background = "#8a458a"
            });
            styles.Add(new ElementStyle(Tags.SoftwareSystem)
            {
                Width = 650, Height = 400, Background = "#510d51", Shape = Shape.Box
            });
            styles.Add(new ElementStyle(Tags.Person)
            {
                Width = 550, Background = "#62256e", Shape = Shape.Person
            });
            styles.Add(new ElementStyle(Tags.Container)
            {
                Width = 650, Height = 400, Background = "#a46ba4", Shape = Shape.Box
            });
            styles.Add(new ElementStyle(Tags.Component)
            {
                Width = 550, Background = "#c9a1c9", Shape = Shape.Box
            });

            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"
            });

            Documentation documentation     = workspace.Documentation;
            FileInfo      documentationRoot = new FileInfo(@"..\..\FinancialRiskSystem");

            documentation.Add(financialRiskSystem, SectionType.Context, DocumentationFormat.Markdown, new FileInfo(Path.Combine(documentationRoot.FullName, "context.md")));
            documentation.Add(financialRiskSystem, SectionType.FunctionalOverview, DocumentationFormat.Markdown, new FileInfo(Path.Combine(documentationRoot.FullName, "functional-overview.md")));
            documentation.Add(financialRiskSystem, SectionType.QualityAttributes, DocumentationFormat.Markdown, new FileInfo(Path.Combine(documentationRoot.FullName, "quality-attributes.md")));
            documentation.AddImages(documentationRoot);

            // add some example corporate branding
            Branding branding = viewSet.Configuration.Branding;

            branding.Font   = new Font("Trebuchet MS");
            branding.Color1 = new ColorPair("#510d51", "#ffffff");
            branding.Color2 = new ColorPair("#62256e", "#ffffff");
            branding.Color3 = new ColorPair("#a46ba4", "#ffffff");
            branding.Color4 = new ColorPair("#c9a1c9", "#ffffff");
            branding.Color5 = new ColorPair("#c9a1c9", "#ffffff");
            branding.Logo   = ImageUtils.GetImageAsDataUri(new FileInfo(Path.Combine(documentationRoot.FullName, "codingthearchitecture.png")));

            // and upload the model to structurizr.com
            StructurizrClient structurizrClient = new StructurizrClient("key", "secret");

            structurizrClient.PutWorkspace(9481, workspace);
        }
Пример #20
0
        static void Banking()
        {
            const long   workspaceId = 0;
            const string apiKey      = "";
            const string apiSecret   = "";

            StructurizrClient structurizrClient = new StructurizrClient(apiKey, apiSecret);
            Workspace         workspace         = new Workspace("C4 Model Microservices - Sistema de Monitoreo", "Sistema de Monitoreo del Traslado Aéreo de Vacunas SARS-CoV-2");
            Model             model             = workspace.Model;
            ViewSet           viewSet           = workspace.Views;

            // 1. Diagrama de Contexto
            SoftwareSystem monitoringSystem = model.AddSoftwareSystem("Monitoreo del Traslado Aéreo de Vacunas SARS-CoV-2", "Permite el seguimiento y monitoreo del traslado aéreo a nuestro país de las vacunas para la COVID-19.");
            SoftwareSystem googleMaps       = model.AddSoftwareSystem("Google Maps", "Plataforma que ofrece una REST API de información geo referencial.");
            SoftwareSystem aircraftSystem   = model.AddSoftwareSystem("Aircraft System", "Permite transmitir información en tiempo real por el avión del vuelo a nuestro sistema");

            Person ciudadano  = model.AddPerson("Ciudadano", "Ciudadano peruano.");
            Person periodista = model.AddPerson("Periodista", "Periodista de los diferentes medios de prensa.");
            Person developer  = model.AddPerson("Developer", "Developer - Open Data.");

            ciudadano.Uses(monitoringSystem, "Realiza consultas para mantenerse al tanto de la planificación de los vuelos hasta la llegada del lote de vacunas al Perú");
            periodista.Uses(monitoringSystem, "Realiza consultas para mantenerse al tanto de la planificación de los vuelos hasta la llegada del lote de vacunas al Perú");
            developer.Uses(monitoringSystem, "Realiza consultas a la REST API para mantenerse al tanto de la planificación de los vuelos hasta la llegada del lote de vacunas al Perú");
            monitoringSystem.Uses(aircraftSystem, "Consulta información en tiempo real por el avión del vuelo");
            monitoringSystem.Uses(googleMaps, "Usa");

            SystemContextView contextView = viewSet.CreateSystemContextView(monitoringSystem, "Contexto", "Diagrama de contexto");

            contextView.PaperSize = PaperSize.A4_Landscape;
            contextView.AddAllSoftwareSystems();
            contextView.AddAllPeople();

            // Tags
            monitoringSystem.AddTags("SistemaMonitoreo");
            googleMaps.AddTags("GoogleMaps");
            aircraftSystem.AddTags("AircraftSystem");
            ciudadano.AddTags("Ciudadano");
            periodista.AddTags("Periodista");
            developer.AddTags("Developer");

            Styles styles = viewSet.Configuration.Styles;

            styles.Add(new ElementStyle("Ciudadano")
            {
                Background = "#0a60ff", Color = "#ffffff", Shape = Shape.Person
            });
            styles.Add(new ElementStyle("Periodista")
            {
                Background = "#08427b", Color = "#ffffff", Shape = Shape.Person
            });
            styles.Add(new ElementStyle("Developer")
            {
                Background = "#facc2e", Shape = Shape.Robot
            });
            styles.Add(new ElementStyle("SistemaMonitoreo")
            {
                Background = "#008f39", Color = "#ffffff", Shape = Shape.RoundedBox
            });
            styles.Add(new ElementStyle("GoogleMaps")
            {
                Background = "#90714c", Color = "#ffffff", Shape = Shape.RoundedBox
            });
            styles.Add(new ElementStyle("AircraftSystem")
            {
                Background = "#2f95c7", Color = "#ffffff", Shape = Shape.RoundedBox
            });

            // 2. Diagrama de Contenedores
            Container mobileApplication        = monitoringSystem.AddContainer("Mobile App", "Permite a los usuarios visualizar un dashboard con el resumen de toda la información del traslado de los lotes de vacunas.", "Flutter");
            Container webApplication           = monitoringSystem.AddContainer("Web App", "Permite a los usuarios visualizar un dashboard con el resumen de toda la información del traslado de los lotes de vacunas.", "Flutter Web");
            Container landingPage              = monitoringSystem.AddContainer("Landing Page", "", "Flutter Web");
            Container apiGateway               = monitoringSystem.AddContainer("API Gateway", "API Gateway", "Spring Boot port 8080");
            Container flightPlanningContext    = monitoringSystem.AddContainer("Flight Planning Context", "Bounded Context del Microservicio de Planificación de Vuelos", "Spring Boot port 8081");
            Container airportContext           = monitoringSystem.AddContainer("Airport Context", "Bounded Context del Microservicio de información de Aeropuertos", "Spring Boot port 8082");
            Container aircraftInventoryContext = monitoringSystem.AddContainer("Aircraft Inventory Context", "Bounded Context del Microservicio de Inventario de Aviones", "Spring Boot port 8083");
            Container vaccinesInventoryContext = monitoringSystem.AddContainer("Vaccines Inventory Context", "Bounded Context del Microservicio de Inventario de Vacunas", "Spring Boot port 8084");
            Container monitoringContext        = monitoringSystem.AddContainer("Monitoring Context", "Bounded Context del Microservicio de Monitoreo en tiempo real del status y ubicación del vuelo que transporta las vacunas", "Spring Boot port 8085");
            Container messageBus               =
                monitoringSystem.AddContainer("Bus de Mensajes en Cluster de Alta Disponibilidad", "Transporte de eventos del dominio.", "RabbitMQ");
            Container flightPlanningContextDatabase     = monitoringSystem.AddContainer("Flight Planning Context DB", "", "Oracle");
            Container airportContextDatabase            = monitoringSystem.AddContainer("Airport Context DB", "", "Oracle");
            Container aircraftInventoryContextDatabase  = monitoringSystem.AddContainer("Aircraft Inventory Context DB", "", "Oracle");
            Container vaccinesInventoryContextDatabase  = monitoringSystem.AddContainer("Vaccines Inventory Context DB", "", "Oracle");
            Container monitoringContextDatabase         = monitoringSystem.AddContainer("Monitoring Context DB", "", "Oracle");
            Container monitoringContextReplicaDatabase  = monitoringSystem.AddContainer("Monitoring Context DB Replica", "", "Oracle");
            Container monitoringContextReactiveDatabase = monitoringSystem.AddContainer("Monitoring Context Reactive DB", "", "Firebase Cloud Firestore");

            ciudadano.Uses(mobileApplication, "Consulta");
            ciudadano.Uses(webApplication, "Consulta");
            ciudadano.Uses(landingPage, "Consulta");
            periodista.Uses(mobileApplication, "Consulta");
            periodista.Uses(webApplication, "Consulta");
            periodista.Uses(landingPage, "Consulta");
            mobileApplication.Uses(apiGateway, "API Request", "JSON/HTTPS");
            webApplication.Uses(apiGateway, "API Request", "JSON/HTTPS");
            developer.Uses(apiGateway, "API Request", "JSON/HTTPS");
            apiGateway.Uses(flightPlanningContext, "API Request", "JSON/HTTPS");
            apiGateway.Uses(airportContext, "API Request", "JSON/HTTPS");
            apiGateway.Uses(aircraftInventoryContext, "API Request", "JSON/HTTPS");
            apiGateway.Uses(vaccinesInventoryContext, "API Request", "JSON/HTTPS");
            apiGateway.Uses(monitoringContext, "API Request", "JSON/HTTPS");
            flightPlanningContext.Uses(messageBus, "Publica y consume eventos del dominio");
            flightPlanningContext.Uses(flightPlanningContextDatabase, "", "JDBC");
            airportContext.Uses(messageBus, "Publica y consume eventos del dominio");
            airportContext.Uses(airportContextDatabase, "", "JDBC");
            aircraftInventoryContext.Uses(messageBus, "Publica y consume eventos del dominio");
            aircraftInventoryContext.Uses(aircraftInventoryContextDatabase, "", "JDBC");
            vaccinesInventoryContext.Uses(messageBus, "Publica y consume eventos del dominio");
            vaccinesInventoryContext.Uses(vaccinesInventoryContextDatabase, "", "JDBC");
            monitoringContext.Uses(messageBus, "Publica y consume eventos del dominio");
            monitoringContext.Uses(monitoringContextDatabase, "", "JDBC");
            monitoringContext.Uses(monitoringContextReplicaDatabase, "", "JDBC");
            monitoringContext.Uses(monitoringContextReactiveDatabase, "", "");
            monitoringContextDatabase.Uses(monitoringContextReplicaDatabase, "Replica");
            monitoringContext.Uses(googleMaps, "API Request", "JSON/HTTPS");
            monitoringContext.Uses(aircraftSystem, "API Request", "JSON/HTTPS");

            // Tags
            mobileApplication.AddTags("MobileApp");
            webApplication.AddTags("WebApp");
            landingPage.AddTags("LandingPage");
            apiGateway.AddTags("APIGateway");
            flightPlanningContext.AddTags("FlightPlanningContext");
            flightPlanningContextDatabase.AddTags("FlightPlanningContextDatabase");
            airportContext.AddTags("AirportContext");
            airportContextDatabase.AddTags("AirportContextDatabase");
            aircraftInventoryContext.AddTags("AircraftInventoryContext");
            aircraftInventoryContextDatabase.AddTags("AircraftInventoryContextDatabase");
            vaccinesInventoryContext.AddTags("VaccinesInventoryContext");
            vaccinesInventoryContextDatabase.AddTags("VaccinesInventoryContextDatabase");
            monitoringContext.AddTags("MonitoringContext");
            monitoringContextDatabase.AddTags("MonitoringContextDatabase");
            monitoringContextReplicaDatabase.AddTags("MonitoringContextReplicaDatabase");
            monitoringContextReactiveDatabase.AddTags("MonitoringContextReactiveDatabase");
            messageBus.AddTags("MessageBus");

            styles.Add(new ElementStyle("MobileApp")
            {
                Background = "#9d33d6", Color = "#ffffff", Shape = Shape.MobileDevicePortrait, Icon = ""
            });
            styles.Add(new ElementStyle("WebApp")
            {
                Background = "#9d33d6", Color = "#ffffff", Shape = Shape.WebBrowser, Icon = ""
            });
            styles.Add(new ElementStyle("LandingPage")
            {
                Background = "#929000", Color = "#ffffff", Shape = Shape.WebBrowser, Icon = ""
            });
            styles.Add(new ElementStyle("APIGateway")
            {
                Shape = Shape.RoundedBox, Background = "#0000ff", Color = "#ffffff", Icon = ""
            });
            styles.Add(new ElementStyle("FlightPlanningContext")
            {
                Shape = Shape.Hexagon, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("FlightPlanningContextDatabase")
            {
                Shape = Shape.Cylinder, Background = "#ff0000", Color = "#ffffff", Icon = ""
            });
            styles.Add(new ElementStyle("AirportContext")
            {
                Shape = Shape.Hexagon, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("AirportContextDatabase")
            {
                Shape = Shape.Cylinder, Background = "#ff0000", Color = "#ffffff", Icon = ""
            });
            styles.Add(new ElementStyle("AircraftInventoryContext")
            {
                Shape = Shape.Hexagon, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("AircraftInventoryContextDatabase")
            {
                Shape = Shape.Cylinder, Background = "#ff0000", Color = "#ffffff", Icon = ""
            });
            styles.Add(new ElementStyle("VaccinesInventoryContext")
            {
                Shape = Shape.Hexagon, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("VaccinesInventoryContextDatabase")
            {
                Shape = Shape.Cylinder, Background = "#ff0000", Color = "#ffffff", Icon = ""
            });
            styles.Add(new ElementStyle("MonitoringContext")
            {
                Shape = Shape.Hexagon, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("MonitoringContextDatabase")
            {
                Shape = Shape.Cylinder, Background = "#ff0000", Color = "#ffffff", Icon = ""
            });
            styles.Add(new ElementStyle("MonitoringContextReplicaDatabase")
            {
                Shape = Shape.Cylinder, Background = "#ff0000", Color = "#ffffff", Icon = ""
            });
            styles.Add(new ElementStyle("MonitoringContextReactiveDatabase")
            {
                Shape = Shape.Cylinder, Background = "#ff0000", Color = "#ffffff", Icon = ""
            });
            styles.Add(new ElementStyle("MessageBus")
            {
                Width = 850, Background = "#fd8208", Color = "#ffffff", Shape = Shape.Pipe, Icon = ""
            });

            ContainerView containerView = viewSet.CreateContainerView(monitoringSystem, "Contenedor", "Diagrama de contenedores");

            contextView.PaperSize = PaperSize.A4_Landscape;
            containerView.AddAllElements();

            // 3. Diagrama de Componentes
            Component domainLayer                  = monitoringContext.AddComponent("Domain Layer", "", "Spring Boot");
            Component monitoringController         = monitoringContext.AddComponent("Monitoring Controller", "REST API endpoints de monitoreo.", "Spring Boot REST Controller");
            Component monitoringApplicationService = monitoringContext.AddComponent("Monitoring Application Service", "Provee métodos para el monitoreo, pertenece a la capa Application de DDD", "Spring Component");
            Component flightRepository             = monitoringContext.AddComponent("Flight Repository", "Información del vuelo", "Spring Component");
            Component vaccineLoteRepository        = monitoringContext.AddComponent("VaccineLote Repository", "Información de lote de vacunas", "Spring Component");
            Component locationRepository           = monitoringContext.AddComponent("Location Repository", "Ubicación del vuelo", "Spring Component");
            Component aircraftSystemFacade         = monitoringContext.AddComponent("Aircraft System Facade", "", "Spring Component");

            apiGateway.Uses(monitoringController, "", "JSON/HTTPS");
            monitoringController.Uses(monitoringApplicationService, "Invoca métodos de monitoreo");
            monitoringController.Uses(aircraftSystemFacade, "Usa");
            monitoringApplicationService.Uses(domainLayer, "Usa", "");
            monitoringApplicationService.Uses(flightRepository, "", "JDBC");
            monitoringApplicationService.Uses(vaccineLoteRepository, "", "JDBC");
            monitoringApplicationService.Uses(locationRepository, "", "JDBC");
            flightRepository.Uses(monitoringContextDatabase, "", "JDBC");
            vaccineLoteRepository.Uses(monitoringContextDatabase, "", "JDBC");
            locationRepository.Uses(monitoringContextDatabase, "", "JDBC");
            locationRepository.Uses(monitoringContextReactiveDatabase, "", "");
            locationRepository.Uses(googleMaps, "", "JSON/HTTPS");
            aircraftSystemFacade.Uses(aircraftSystem, "JSON/HTTPS");

            // Tags
            domainLayer.AddTags("DomainLayer");
            monitoringController.AddTags("MonitoringController");
            monitoringApplicationService.AddTags("MonitoringApplicationService");
            flightRepository.AddTags("FlightRepository");
            vaccineLoteRepository.AddTags("VaccineLoteRepository");
            locationRepository.AddTags("LocationRepository");
            aircraftSystemFacade.AddTags("AircraftSystemFacade");

            styles.Add(new ElementStyle("DomainLayer")
            {
                Shape = Shape.Component, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("MonitoringController")
            {
                Shape = Shape.Component, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("MonitoringApplicationService")
            {
                Shape = Shape.Component, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("MonitoringDomainModel")
            {
                Shape = Shape.Component, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("FlightStatus")
            {
                Shape = Shape.Component, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("FlightRepository")
            {
                Shape = Shape.Component, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("VaccineLoteRepository")
            {
                Shape = Shape.Component, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("LocationRepository")
            {
                Shape = Shape.Component, Background = "#facc2e", Icon = ""
            });
            styles.Add(new ElementStyle("AircraftSystemFacade")
            {
                Shape = Shape.Component, Background = "#facc2e", Icon = ""
            });

            ComponentView componentView = viewSet.CreateComponentView(monitoringContext, "Components", "Component Diagram");

            componentView.PaperSize = PaperSize.A4_Landscape;
            componentView.Add(mobileApplication);
            componentView.Add(webApplication);
            componentView.Add(apiGateway);
            componentView.Add(monitoringContextDatabase);
            componentView.Add(monitoringContextReactiveDatabase);
            componentView.Add(aircraftSystem);
            componentView.Add(googleMaps);
            componentView.AddAllComponents();

            structurizrClient.UnlockWorkspace(workspaceId);
            structurizrClient.PutWorkspace(workspaceId, workspace);
        }
Пример #21
0
        static void Banking()
        {
            const long   workspaceId = 0;
            const string apiKey      = "";
            const string apiSecret   = "";

            StructurizrClient structurizrClient = new StructurizrClient(apiKey, apiSecret);
            Workspace         workspace         = new Workspace("Banking", "Banking - C4 Model");
            Model             model             = workspace.Model;

            SoftwareSystem internetBankingSystem  = model.AddSoftwareSystem("Internet Banking", "Permite a los clientes consultar información de sus cuentas y realizar operaciones.");
            SoftwareSystem mainframeBankingSystem = model.AddSoftwareSystem("Mainframe Banking", "Almacena información del core bancario.");
            SoftwareSystem mobileAppSystem        = model.AddSoftwareSystem("Mobile App", "Permite a los clientes consultar información de sus cuentas y realizar operaciones.");
            SoftwareSystem emailSystem            = model.AddSoftwareSystem("SendGrid", "Servicio de envío de notificaciones por email.");

            Person cliente = model.AddPerson("Cliente", "Cliente del banco.");
            Person cajero  = model.AddPerson("Cajero", "Empleado del banco.");

            mainframeBankingSystem.AddTags("Mainframe");
            mobileAppSystem.AddTags("Mobile App");
            emailSystem.AddTags("SendGrid");

            cliente.Uses(internetBankingSystem, "Realiza consultas y operaciones bancarias.");
            cliente.Uses(mobileAppSystem, "Realiza consultas y operaciones bancarias.");
            cajero.Uses(mainframeBankingSystem, "Usa");

            internetBankingSystem.Uses(mainframeBankingSystem, "Usa");
            internetBankingSystem.Uses(emailSystem, "Envía notificaciones de email");
            mobileAppSystem.Uses(internetBankingSystem, "Usa");

            emailSystem.Delivers(cliente, "Envía notificaciones de email", "SendGrid");

            ViewSet viewSet = workspace.Views;

            // 1. Diagrama de Contexto
            SystemContextView contextView = viewSet.CreateSystemContextView(internetBankingSystem, "Contexto", "Diagrama de contexto - Banking");

            contextView.PaperSize = PaperSize.A4_Landscape;
            contextView.AddAllSoftwareSystems();
            contextView.AddAllPeople();
            //contextView.EnableAutomaticLayout();

            Styles styles = viewSet.Configuration.Styles;

            styles.Add(new ElementStyle(Tags.Person)
            {
                Background = "#0a60ff", Color = "#ffffff", Shape = Shape.Person
            });
            styles.Add(new ElementStyle("Mobile App")
            {
                Background = "#29c732", Color = "#ffffff", Shape = Shape.MobileDevicePortrait
            });
            styles.Add(new ElementStyle("Mainframe")
            {
                Background = "#90714c", Color = "#ffffff", Shape = Shape.RoundedBox
            });
            styles.Add(new ElementStyle("SendGrid")
            {
                Background = "#a5cdff", Color = "#ffffff", Shape = Shape.RoundedBox
            });

            // 2. Diagrama de Contenedores
            Container webApplication = internetBankingSystem.AddContainer("Aplicación Web", "Permite a los clientes consultar información de sus cuentas y realizar operaciones.", "ReactJS, nginx port 80");
            Container restApi        = internetBankingSystem.AddContainer("RESTful API", "Permite a los clientes consultar información de sus cuentas y realizar operaciones.", "Net Core, nginx port 80");
            Container worker         = internetBankingSystem.AddContainer("Worker", "Manejador del bus de mensajes.", "Net Core");
            Container database       = internetBankingSystem.AddContainer("Base de Datos", "Repositorio de información bancaria.", "Oracle 12c port 1521");
            Container messageBus     = internetBankingSystem.AddContainer("Bus de Mensajes", "Transporte de eventos del dominio.", "RabbitMQ");

            webApplication.AddTags("WebApp");
            restApi.AddTags("API");
            worker.AddTags("Worker");
            database.AddTags("Database");
            messageBus.AddTags("MessageBus");

            cliente.Uses(webApplication, "Usa", "https 443");
            webApplication.Uses(restApi, "Usa", "https 443");
            worker.Uses(restApi, "Usa", "https 443");
            worker.Uses(messageBus, "Usa");
            worker.Uses(mainframeBankingSystem, "Usa");
            restApi.Uses(database, "Usa", "jdbc 1521");
            restApi.Uses(messageBus, "Usa");
            restApi.Uses(emailSystem, "Usa", "https 443");
            mobileAppSystem.Uses(restApi, "Usa");

            styles.Add(new ElementStyle("WebApp")
            {
                Background = "#9d33d6", Color = "#ffffff", Shape = Shape.WebBrowser, Icon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0xMS41IC0xMC4yMzE3NCAyMyAyMC40NjM0OCI+CiAgPHRpdGxlPlJlYWN0IExvZ288L3RpdGxlPgogIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIyLjA1IiBmaWxsPSIjNjFkYWZiIi8+CiAgPGcgc3Ryb2tlPSIjNjFkYWZiIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIi8+CiAgICA8ZWxsaXBzZSByeD0iMTEiIHJ5PSI0LjIiIHRyYW5zZm9ybT0icm90YXRlKDYwKSIvPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIiB0cmFuc2Zvcm09InJvdGF0ZSgxMjApIi8+CiAgPC9nPgo8L3N2Zz4K"
            });
            styles.Add(new ElementStyle("API")
            {
                Background = "#929000", Color = "#ffffff", Shape = Shape.RoundedBox, Icon = "https://dotnet.microsoft.com/static/images/redesign/downloads-dot-net-core.svg?v=U_8I9gzFF2Cqi5zUNx-kHJuou_BWNurkhN_kSm3mCmo"
            });
            styles.Add(new ElementStyle("Worker")
            {
                Icon = "https://dotnet.microsoft.com/static/images/redesign/downloads-dot-net-core.svg?v=U_8I9gzFF2Cqi5zUNx-kHJuou_BWNurkhN_kSm3mCmo"
            });
            styles.Add(new ElementStyle("Database")
            {
                Background = "#ff0000", Color = "#ffffff", Shape = Shape.Cylinder, Icon = "https://4.bp.blogspot.com/-5JVtZBLlouA/V2LhWdrafHI/AAAAAAAADeU/_3bo_QH1WGApGAl-U8RkrFzHjdH6ryMoQCLcB/s200/12cdb.png"
            });
            styles.Add(new ElementStyle("MessageBus")
            {
                Width = 850, Background = "#fd8208", Color = "#ffffff", Shape = Shape.Pipe, Icon = "https://www.rabbitmq.com/img/RabbitMQ-logo.svg"
            });

            ContainerView containerView = viewSet.CreateContainerView(internetBankingSystem, "Contenedor", "Diagrama de contenedores - Banking");

            contextView.PaperSize = PaperSize.A4_Landscape;
            containerView.AddAllElements();
            //containerView.EnableAutomaticLayout();

            // 3. Diagrama de Componentes
            Component transactionController        = restApi.AddComponent("Transactions Controller", "Allows users to perform transactions.", "Spring Boot REST Controller");
            Component signinController             = restApi.AddComponent("SignIn Controller", "Allows users to sign in to the Internet Banking System.", "Spring Boot REST Controller");
            Component accountsSummaryController    = restApi.AddComponent("Accounts Controller", "Provides customers with an summary of their bank accounts.", "Spring Boot REST Controller");
            Component securityComponent            = restApi.AddComponent("Security Component", "Provides functionality related to signing in, changing passwords, etc.", "Spring Bean");
            Component mainframeBankingSystemFacade = restApi.AddComponent("Mainframe Banking System Facade", "A facade onto the mainframe banking system.", "Spring Bean");

            restApi.Components.Where(c => "Spring Boot REST Controller".Equals(c.Technology)).ToList().ForEach(c => webApplication.Uses(c, "Uses", "HTTPS"));
            signinController.Uses(securityComponent, "Uses");
            accountsSummaryController.Uses(mainframeBankingSystemFacade, "Uses");
            securityComponent.Uses(database, "Reads from and writes to", "JDBC");
            mainframeBankingSystemFacade.Uses(mainframeBankingSystem, "Uses", "XML/HTTPS");

            ComponentView componentViewForRestApi = viewSet.CreateComponentView(restApi, "Components", "The components diagram for the REST API");

            componentViewForRestApi.PaperSize = PaperSize.A4_Landscape;
            componentViewForRestApi.AddAllContainers();
            componentViewForRestApi.AddAllComponents();
            componentViewForRestApi.Add(cliente);
            componentViewForRestApi.Add(mainframeBankingSystem);
            //componentViewForRestApi.EnableAutomaticLayout();

            structurizrClient.UnlockWorkspace(workspaceId);
            structurizrClient.PutWorkspace(workspaceId, workspace);
        }
Пример #22
0
 public void AddAllPeople()
 {
     systemContextView.AddAllPeople();
 }