# ti-tecnologico-de-monterrey-oficial/tec-design-system-ng architecture

> Architecture diagram of the GitHub repository ti-tecnologico-de-monterrey-oficial/tec-design-system-ng, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng
- Repository: https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng

## Overview

- Design System Library (“ds-ng”): This is the heart of the project. Include sub-components such as:
– UI Components: All “bmb-” prefixed Angular components (e.g., bmb-accordion, bmb-alert-center, etc.). Group them by category (e.g., input elements, layout & navigation, cards, messaging, etc.).
– Directives and Foundations: Capture the folders under “directives” and “foundations” which provide low-level UI behavior and styling resources.
– Services & Utilities: Show the essential services (calendar, theme, toast, user profile, etc.) and utility files that support component functionality.
– Storybook & Testing: In the ds-ng project, a dedicated “.storybook” folder with configuration files and component stories exists; also note all “.spec.ts” files as indicators for testing.
- Demo/Consumer Application (“src/app”): This is the consumer layer using the design system library. It provides sample usage (pages like “home”, “emprendedor”, etc.) of the design system components.
- Build & CI/CD Infrastructure: Recognize the supporting tools such as GitHub Actions workflows (publish.yml, release-package.yml, sonar.yml), commit and pre-commit hooks (.husky), and configuration files (angular.json, tsconfig, package.json). These indicate how the system is built, linted, tested, and deployed.
- External Integrations & Documentation: Include external tooling (Figma for design, Supernova for documentation, GitHub for versioning) as part of the ecosystem that supports the design system’s lifecycle.

##### Relationships and Interactions
- The Angular design system library encapsulates components, directives, services, and utilities. The library exposes its public API (via projects/ds-ng/src/public-api.ts) which is then consumed by the demo application.
- Components interact with each other when composed within layouts, and they use Angular services for business logic, theme management, and notifications.
- The Storybook setup serves as a live documentation tool. Each component’s stories (with “*.stories.ts” files) demonstrate individual behavior and appearance.
- Build and test workflows (through GitHub Actions and Angular CLI configurations) ensure that changes are automatically validated, and CI processes are clearly defined.

##### Architectural Patterns and Design Principles
- Component-Based Architecture: The design system splits functionality into reusable UI components that are integrated via Angular’s module system.
- Separation of Concerns: Clearly distinct folders for components, directives, layouts, and services indicate a modular design.
- Test-Driven Development: Every component includes a “component.spec.ts” file, underscoring a commitment to testing.

##### Relevant Technologies and Frameworks
- Angular (core framework) for component development.
- Storybook for component visualization and documentation.
- SCSS for advanced styling, with centralized token files for themes.
- GitHub Actions and other CI/CD integrations to support build, testing, and deployment workflows.
- TypeScript for code quality and robustness.
- Tools like ESLint, Prettier, and commitlint support code standards and maintainability.

##### Instructing the Principal Software Engineer
– Rectangles for core modules (DS Library, Storybook, Demo App).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Angular Design System Library Subgraph
    subgraph "Angular Design System Library"
        DS("Angular Design System Library"):::module
        UI("UI Components"):::component
        DIR("Directives"):::component
        FND("Foundations"):::component
        SVC("Services"):::component
        UTIL("Utilities"):::component
        API("Public API Exposure"):::component
        SB("Storybook & Testing"):::component
    end

    %% Demo/Consumer Application
    DA("Demo Application"):::module

    %% Build & CI/CD Pipeline Subgraph
    subgraph "Build & CI/CD Pipeline"
        GA("GitHub Actions Workflows"):::ci
        HK("Hooks"):::ci
        CF("Configuration Files"):::ci
    end

    %% External Design Resources Subgraph
    subgraph "External Design Resources"
        DOC("Documentation (README.md)"):::external
        SONAR("SonarQube (sonar-project.properties)"):::external
    end

    %% Relationships within DS Library
    DS -->|"manages"| UI
    DS -->|"manages"| DIR
    DS -->|"manages"| FND
    DS -->|"manages"| SVC
    DS -->|"manages"| UTIL

    UI -->|"provides"| API
    DIR -->|"provides"| API
    FND -->|"provides"| API
    SVC -->|"provides"| API
    UTIL -->|"provides"| API

    %% DS Library exposes Public API to Demo Application
    API -->|"consumed_by"| DA

    %% Storybook for component visualization links to Documentation
    SB -->|"documents"| DOC
    SB -->|"integrates"| SONAR

    %% Build & CI/CD Pipeline interactions
    GA -->|"triggers"| DS
    GA -->|"triggers"| DA
    HK -->|"enforces"| DS
    HK -->|"enforces"| DA
    CF -->|"configures"| DS
    CF -->|"configures"| DA

    %% Click Events
    click DS "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/tree/develop/projects/ds-ng"
    click UI "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/tree/develop/projects/ds-ng/src/lib/components"
    click DIR "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/tree/develop/projects/ds-ng/src/lib/directives"
    click FND "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/tree/develop/projects/ds-ng/src/lib/foundations"
    click SVC "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/tree/develop/projects/ds-ng/src/lib/services"
    click UTIL "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/tree/develop/projects/ds-ng/src/lib/utils"
    click API "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/blob/develop/projects/ds-ng/src/public-api.ts"
    click SB "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/blob/develop/projects/ds-ng/.storybook"
    click DA "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/tree/develop/src/app"
    click GA "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/tree/develop/.github/workflows"
    click HK "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/blob/develop/.husky"
    click CF "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/blob/develop/angular.json"
    click DOC "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/blob/develop/README.md"
    click SONAR "https://github.com/ti-tecnologico-de-monterrey-oficial/tec-design-system-ng/blob/develop/sonar-project.properties"

    %% Styles
    classDef module fill:#e3f2fd,stroke:#1565c0,stroke-width:2px,stroke-dasharray: 0,0, rounded:5px;
    classDef component fill:#fff9c4,stroke:#f9a825,stroke-width:2px,rounded:5px;
    classDef ci fill:#fce4ec,stroke:#c2185b,stroke-dasharray: 5,5,stroke-width:2px,rounded:5px;
    classDef external fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,rounded:5px;
```
