# tiagotakahashi/solucaoproblemas architecture

> Architecture diagram of the GitHub repository tiagotakahashi/solucaoproblemas, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tiagotakahashi/solucaoproblemas
- Repository: https://github.com/tiagotakahashi/solucaoproblemas

## Overview

##### Project type and purpose
- The repository contains two separate C# solutions for coding practice:
– “01Livraria”: A full-stack ASP.NET MVC web application (bookstore)
– “02RockPaperScissors”: A backend library implementing game logic plus a test project

##### File structure
A. 01Livraria (ASP.NET MVC)
- Presentation Layer
– Controllers (Autor, Categoria, Editora, Livro, Home)
– Views (Razor .cshtml under Views folder)
– Static assets (Content/css, fonts; Scripts/js)
– App_Start (routing, filters, bundles)
– Configuration (Web.config, ApplicationInsights.config, environment transforms)
- Data Layer
– Models (Autor, Categoria, Editora, Livro, Db Context)
– Entity Framework Migrations (database creation scripts)
B. 02RockPaperScissors (Class Library + Tests)
- Application Layer
– Services (Game, Tournament)
– Model (Player)
– Common (IValidator, IValidateResult, Validator implementations)
– Exceptions (WrongNumberOfPlayersError, NoSuchStrategyError)
- Test Layer
– RockPaperScissors.Application.Test (unit tests for Game and Tournament)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Livraria MVC Application
    subgraph "Livraria Web MVC"
        direction TB
        subgraph "Presentation Layer"
            direction TB
            Browser["Web Browser"]:::external
            Controllers["Controllers"]:::service
            Views["Razor Views"]:::frontend
            StaticAssets["Static Assets (CSS/JS/Fonts)"]:::frontend
            AppStart["App_Start"]:::config
            ConfigFiles["Configuration Files"]:::config
        end
        subgraph "Data Layer"
            direction TB
            Models["EF Models & DbContext"]:::data
            Migrations["EF Migrations"]:::data
            SQLDB["SQL Database"]:::database
        end
        AI["Application Insights"]:::external
    end

    %% RockPaperScissors Library
    subgraph "RockPaperScissors Library"
        direction TB
        ClientApp["Client Application"]:::external
        subgraph "Core Application"
            direction TB
            GameService["Game Service"]:::service
            TournamentService["Tournament Service"]:::service
            subgraph "Validation"
                direction TB
                IValidator["IValidator"]:::common
                IValidateResult["IValidateResult"]:::common
                ValidatorImpl["Validator Implementations"]:::common
            end
            PlayerModel["Player Model"]:::domain
            ExceptionsSub["Exceptions"]:::domain
        end
        TestHarness["Unit Test Harness"]:::test
    end

    %% Connections Livraria
    Browser -->|"HTTP Request"| Controllers
    Controllers -->|"renders"| Views
    Controllers -->|"serves"| StaticAssets
    Controllers -->|"uses"| Models
    Controllers -->|"invokes migrations"| Migrations
    Models -->|"reads/writes"| SQLDB
    Migrations -->|"manage schema"| SQLDB
    Controllers -->|"logs"| AI

    %% Connections Library
    ClientApp -->|"calls"| GameService
    ClientApp -->|"calls"| TournamentService
    GameService -->|"validates via"| IValidator
    TournamentService -->|"validates via"| IValidator
    IValidator -->|"returns"| IValidateResult
    GameService -->|"uses"| PlayerModel
    TournamentService -->|"uses"| PlayerModel
    GameService -->|"throws"| ExceptionsSub
    TournamentService -->|"throws"| ExceptionsSub
    TestHarness -->|"tests"| GameService
    TestHarness -->|"tests"| TournamentService

    %% Click Events Livraria
    click 01Livraria "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/01Livraria.sln"
    click RouteConfig "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/App_Start/RouteConfig.cs"
    click FilterConfig "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/App_Start/FilterConfig.cs"
    click BundleConfig "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/App_Start/BundleConfig.cs"
    click AutorController "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Controllers/AutorController.cs"
    click CategoriaController "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Controllers/CategoriaController.cs"
    click EditoraController "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Controllers/EditoraController.cs"
    click LivroController "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Controllers/LivroController.cs"
    click HomeController "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Controllers/HomeController.cs"
    click Views "https://github.com/tiagotakahashi/solucaoproblemas/tree/master/01Livraria/Livraria.Presentation.MVC/Views/"
    click StaticAssets "https://github.com/tiagotakahashi/solucaoproblemas/tree/master/01Livraria/Livraria.Presentation.MVC/Content/"
    click Fonts "https://github.com/tiagotakahashi/solucaoproblemas/tree/master/01Livraria/Livraria.Presentation.MVC/fonts/"
    click Scripts "https://github.com/tiagotakahashi/solucaoproblemas/tree/master/01Livraria/Livraria.Presentation.MVC/Scripts/"
    click WebConfig "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Web.config"
    click WebDebug "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Web.Debug.config"
    click WebRelease "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Web.Release.config"
    click AppInsightsConfig "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/ApplicationInsights.config"
    click GlobalAsax "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Global.asax"
    click Contexto "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Models/Contexto.cs"
    click AutorModel "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Models/Autor.cs"
    click CategoriaModel "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Models/Categoria.cs"
    click EditoraModel "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Models/Editora.cs"
    click LivroModel "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Models/Livro.cs"
    click MigrationConfig "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Migrations/Configuration.cs"
    click Migration201704 "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Migrations/201704301639369_CriacaoBanco.cs"
    click MigrationDesigner "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Migrations/201704301639369_CriacaoBanco.Designer.cs"
    click MigrationResx "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/01Livraria/Livraria.Presentation.MVC/Migrations/201704301639369_CriacaoBanco.resx"

    %% Click Events RockPaperScissors
    click GameService "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Services/Game.cs"
    click TournamentService "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Services/Tournament.cs"
    click PlayerModel "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Model/Player.cs"
    click IValidator "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Common/Interfaces/IValidator.cs"
    click IValidateResult "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Common/Interfaces/IValidateResult.cs"
    click ValidatorImpl "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Common/Validator.cs"
    click NoSuchStrategyValidateResult "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Common/NoSuchStrategyValidateResult.cs"
    click WrongNumberOfPlayersValidateResult "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Common/WrongNumberOfPlayersValidateResult.cs"
    click NoSuchStrategyError "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Exceptions/NoSuchStrategyError.cs"
    click WrongNumberOfPlayersError "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/Exceptions/WrongNumberOfPlayersError.cs"
    click LibraryProj "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application/RockPaperScissors.Application.csproj"
    click TestProj "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application.Test/RockPaperScissors.Application.Test.csproj"
    click GameTests "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application.Test/GameTests.cs"
    click TournamentTests "https://github.com/tiagotakahashi/solucaoproblemas/blob/master/02RockPaperScissors/RockPaperScissors.Application.Test/TournamentTests.cs"

    %% Styles
    classDef frontend fill:#AED6F1,stroke:#21618C,color:#000
    classDef service fill:#F9E79F,stroke:#B7950B,color:#000
    classDef data fill:#ABEBC6,stroke:#239B56,color:#000
    classDef database fill:#58D68D,stroke:#1D8348,color:#000
    classDef external fill:#E5E7E9,stroke:#7F8C8D,color:#000
    classDef config fill:#F5B7B1,stroke:#C0392B,color:#000
    classDef common fill:#D2B4DE,stroke:#884EA0,color:#000
    classDef domain fill:#FADBD8,stroke:#C0392B,color:#000
    classDef test fill:#D5F5E3,stroke:#27AE60,color:#000
```
