# codeurjc-students/2025-mymlb architecture

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

- Interactive diagram: https://gitdiagram.com/codeurjc-students/2025-mymlb
- Repository: https://github.com/codeurjc-students/2025-mymlb

## Overview

##### Project type and purpose
- This is a full-stack web application (“MyMLB Portal”) for displaying MLB information, managing user accounts, ticket purchases, and administrative operations.
- Frontend: Angular SPA providing responsive UI and charts.
- Backend: Spring Boot REST API handling business logic, security, data access, and static asset hosting.
- Database: MySQL storing users, teams, games, tickets, and related entities.
- CI/CD: GitHub Actions + Docker + Sonar for build, test, analysis, and deployments.
- External services: Email delivery for notifications and password recovery.

##### File structure
- Top-level folders:
- .github/workflows: CI pipelines for basic and full builds, Sonar analysis.
- backend: Maven Spring Boot project
– Controllers, Services, Repositories, Models reflect a layered MVC pattern
– application.properties configures database and mail settings
– static directory holds compiled Angular assets (index.html, JS bundles, CSS)
– src/test contains unit, integration, and end-to-end tests using JUnit, Mockito, AssertJ, REST-Assured
- frontend: Angular CLI project
– src/app: Components, Services, Models, routing, styles
– cypress and Karma/Jasmine configs for front-end e2e and unit tests
– proxy.conf.json to forward API calls to backend during development
- Build and packaging:
- Maven wrapper and pom.xml drive backend build
- package.json + Angular CLI drive frontend build
- Dockerfiles (not shown) likely containerize both pieces

##### Key insights from README
- Client-server architecture over HTTPS
- REST endpoints for user and admin workflows
- Role-based navigation (anonymous, registered, admin)
- Automated standings and statistics computed server-side
- ng2-charts integration for visualization
- Docker used in CI/CD for consistent environment

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Layer"
        B["User Browser"]:::external
    end

    subgraph "Frontend (Angular SPA)"
        SPA["Angular SPA"]:::frontend
        UComp["UserComponent"]:::frontend
        FServ["UserService"]:::frontend
        FModel["UserModel"]:::frontend
        Routing["Routing Config"]:::frontend
        UCompUT["UserComponent.spec.ts"]:::test
        UServUT["UserService.spec.ts"]:::test
        E2ETests["UserSystemTest.cy.ts"]:::test

        SPA --> UComp
        SPA --> FServ
        SPA --> FModel
        SPA --> Routing
        UComp --> UCompUT
        FServ --> UServUT
        SPA --> E2ETests
    end

    subgraph "Backend (Spring Boot)"
        App["MlbPortalApplication"]:::backend
        Controllers["Controllers"]:::backend
        Services["UserService"]:::backend
        Repos["UserRepository"]:::backend
        Entities["UserEntity"]:::backend
        Config["application.properties"]:::config
        Static["Static Assets"]:::static
        UT["UserServiceTest.java"]:::test
        IT["UserServiceIntegrationTest.java"]:::test
        E2E["UserControllerTest.java"]:::test

        App --> Controllers
        Controllers --> Services
        Services --> Repos
        Repos --> Entities
        App --> Config
        App --> Static
        Services --> UT
        Services --> IT
        Controllers --> E2E
    end

    subgraph "Data Layer"
        DB["MySQL Database"]:::database
    end

    Mail["Email Service"]:::external

    subgraph "Infrastructure"
        CI["GitHub Actions (CI/CD)"]:::infra
        Docker["Docker Registry"]:::infra
        Deploy["Deployment Environment"]:::infra
        Mvn["pom.xml"]:::infra
        Npm["package.json"]:::infra
    end

    B -->|"HTTP GET index.html"| SPA
    SPA -->|"REST API calls"| Controllers
    Controllers -->|"JDBC/ORM"| DB
    Controllers -->|"send emails SMTP"| Mail
    CI -->|"build & test"| Docker
    Docker -->|"push images"| Deploy
    Deploy --> SPA
    Deploy --> App

    click SPA "https://github.com/codeurjc-students/2025-mymlb/tree/main/frontend/src/app"
    click UComp "https://github.com/codeurjc-students/2025-mymlb/blob/main/frontend/src/app/Components/User/User.component.ts"
    click FServ "https://github.com/codeurjc-students/2025-mymlb/blob/main/frontend/src/app/Services/User.service.ts"
    click FModel "https://github.com/codeurjc-students/2025-mymlb/blob/main/frontend/src/app/Models/User.ts"
    click Routing "https://github.com/codeurjc-students/2025-mymlb/blob/main/frontend/src/app/app.routes.ts"
    click E2ETests "https://github.com/codeurjc-students/2025-mymlb/blob/main/frontend/cypress/e2e/UserSystemTest.cy.ts"
    click UCompUT "https://github.com/codeurjc-students/2025-mymlb/blob/main/frontend/src/testing/unit/User.component.spec.ts"
    click UServUT "https://github.com/codeurjc-students/2025-mymlb/blob/main/frontend/src/testing/unit/User.service.spec.ts"
    click App "https://github.com/codeurjc-students/2025-mymlb/blob/main/backend/src/main/java/com/mlb/mlbportal/MlbPortalApplication.java"
    click Controllers "https://github.com/codeurjc-students/2025-mymlb/tree/main/backend/src/main/java/com/mlb/mlbportal/Controllers"
    click Services "https://github.com/codeurjc-students/2025-mymlb/blob/main/backend/src/main/java/com/mlb/mlbportal/Services/UserService.java"
    click Repos "https://github.com/codeurjc-students/2025-mymlb/blob/main/backend/src/main/java/com/mlb/mlbportal/Repositories/UserRepository.java"
    click Entities "https://github.com/codeurjc-students/2025-mymlb/blob/main/backend/src/main/java/com/mlb/mlbportal/Models/UserEntity.java"
    click Config "https://github.com/codeurjc-students/2025-mymlb/blob/main/backend/src/main/resources/application.properties"
    click Static "https://github.com/codeurjc-students/2025-mymlb/tree/main/backend/src/main/resources/static"
    click UT "https://github.com/codeurjc-students/2025-mymlb/blob/main/backend/src/test/java/com/mlb/mlbportal/unit/UserServiceTest.java"
    click IT "https://github.com/codeurjc-students/2025-mymlb/blob/main/backend/src/test/java/com/mlb/mlbportal/integration/UserServiceIntegrationTest.java"
    click E2E "https://github.com/codeurjc-students/2025-mymlb/blob/main/backend/src/test/java/com/mlb/mlbportal/e2e/UserControllerTest.java"
    click CI "https://github.com/codeurjc-students/2025-mymlb/blob/main/.github/workflows/basic-ci.yml"
    click CI "https://github.com/codeurjc-students/2025-mymlb/blob/main/.github/workflows/complete-ci.yml"
    click CI "https://github.com/codeurjc-students/2025-mymlb/blob/main/.github/workflows/sonar-build.yml"
    click Mvn "https://github.com/codeurjc-students/2025-mymlb/blob/main/backend/pom.xml"
    click Npm "https://github.com/codeurjc-students/2025-mymlb/blob/main/frontend/package.json"

    classDef frontend fill:#ADD8E6,stroke:#000;
    classDef backend fill:#90EE90,stroke:#000;
    classDef database fill:#F5F5DC,stroke:#000;
    classDef external fill:#D3D3D3,stroke:#000;
    classDef test fill:#FFE4E1,stroke:#000;
    classDef infra fill:#FFFACD,stroke:#000;
    classDef config fill:#EEE8AA,stroke:#000;
    classDef static fill:#E6E6FA,stroke:#000;
```
