# microsoft/azure-boards-estimate architecture

> Architecture diagram of the GitHub repository microsoft/azure-boards-estimate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/azure-boards-estimate
- Repository: https://github.com/microsoft/azure-boards-estimate

## Overview

This project, “Azure Boards Estimate,” is an Azure DevOps extension designed to facilitate collaborative sprint planning using a Planning Poker mechanism within Azure DevOps. Its primary function is to enable teams to estimate work items in real time, streamlining the estimation process during sprint planning.

##### Main Components
- Extension/Frontend UI:
– The majority of the UI lives within the “src” directory, with a strong separation in components and pages.
– The “src/pages” directory is segmented by functionality (home, create, session, settings) that represent different screens or views in the application.

- State Management & Business Logic:
– The project employs Redux (with files like reducer.ts, initReducer.ts, and actions/sagas/selectors in various pages) to manage state and asynchronous actions.
– In “src/initSaga.ts” and individual pages (e.g., “src/pages/home/sessionsSaga.ts”, “src/pages/session/sessionSaga.ts”), sagas orchestrate side effects.

- Services & Communication Layer:
– The “src/services” folder contains modules responsible for interacting with Azure DevOps APIs and handling business logic (e.g., estimation, identity, workItems, sessions).
– Within “src/services/channels” there are multiple utilities (signalr, offline, etc.) managing real-time data and communication channels.

- Utilities & Shared Libraries:
– The “src/lib” directory includes helper functions (history management, URL management, CSS modules) which are re-used across the app.
– The “src/model” directory defines data models and types (cards, queries, sessions, work items) that form the application’s data structures.

- Configuration & Deployment:
– Top-level files like “.azure-pipelines/azure-pipeline.yml”, “.devcontainer”, “configs”, and various scripts indicate CI/CD pipelines, containerized development, and environment-specific configurations.
– The “package.json”, “tsconfig.json”, and lint/prettier configuration files define the development environment and build settings.

##### Relationships and Interactions
- UI Interactions:
– UI components render in the browser (using React as indicated by TypeScript JSX files) and interact with the Redux store.
– Pages act as containers routing and aggregating these components.

- Communication Flow:
– User actions on the UI trigger dispatches which are handled by Redux actions and sagas.
– Sagas then invoke services that perform calls to Azure DevOps APIs or manage real-time channels (signalr/offline) to update work items.

- Data Flow:
– Data models defined in “src/model” are used across actions, reducers, and components ensuring consistent type definitions.

- External Integration:

##### Architectural Patterns and Design Principles
- Modular Service Layer: Identify how “services” abstract away business logic and external communication.
- Redux Pattern: Represent the flow from UI to actions, followed by reducers and sagas.
- Separation of Concerns: Differentiate clearly between the UI layer (with presentational components), state management, and service/communication layers.

##### Relevant Technologies & Frameworks
- React with TypeScript: Indicated by .tsx files in “src”
- Redux for state management (actions, reducers, sagas)
- SignalR for real-time communication (within services/channels)
- Docker (from .devcontainer) and Azure Pipelines for CI/CD
- Azure DevOps Extension APIs referenced throughout

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend UI
    subgraph "Frontend UI"
        UIComp("UI - Components"):::ui
        UIPages("UI - Pages"):::ui
    end

    %% State Management & Business Logic
    subgraph "State Management (Redux)"
        ReduxInitReducer("Init Reducer"):::state
        ReduxInitSaga("Init Saga"):::state
        ReduxHomeActions("Home Actions"):::state
        ReduxHomeReducer("Home Reducer"):::state
        ReduxHomeSaga("Home Saga"):::state
        ReduxSessionActions("Session Actions"):::state
        ReduxSessionReducer("Session Reducer"):::state
        ReduxSessionSaga("Session Saga"):::state
        ReduxSagas("Combined Sagas"):::state
    end

    %% Service Layer
    subgraph "Service Layer"
        ServiceCalls("Service Calls"):::service
        ServEst("Service - Estimation"):::service
        ServWork("Service - Work Items"):::service
        ServIdentity("Service - Identity"):::service
        ServSessions("Service - Sessions"):::service
        subgraph "Communication Channels"
            ChannelSignalR("SignalR Channel"):::service
            ChannelOffline("Offline Channel"):::service
        end
    end

    %% External Integration
    External("Azure DevOps"):::external

    %% Utilities & Shared Libraries
    subgraph "Utilities & Shared Libraries"
        UtilLib("Utilities - Lib"):::utility
        ModelCards("Model - Cards"):::utility
        ModelEstimate("Model - Estimate"):::utility
        ModelSession("Model - Session"):::utility
    end

    %% Configuration & Deployment
    subgraph "Configuration & Deployment"
        ConfigAzurePipeline(".azure-pipelines"):::config
        ConfigDevContainer(".devcontainer"):::config
        Configs("Configs"):::config
        ConfigPackage("package.json"):::config
        ConfigTsconfig("tsconfig.json"):::config
    end

    %% Connections between Frontend UI and State Management
    UIComp -->|"triggers"| UIPages
    UIPages -->|"dispatches"| ReduxHomeActions
    UIPages -->|"dispatches"| ReduxSessionActions

    %% Internal Redux Flow
    ReduxInitReducer --> ReduxHomeReducer
    ReduxInitSaga --> ReduxHomeSaga
    ReduxHomeActions --> ReduxHomeSaga
    ReduxSessionActions --> ReduxSessionSaga
    ReduxHomeSaga --> ReduxSagas
    ReduxSessionSaga --> ReduxSagas

    %% Connecting Redux to Services
    ReduxSagas -->|"calls"| ServiceCalls
    ServiceCalls --> ServEst
    ServiceCalls --> ServWork
    ServiceCalls --> ServIdentity
    ServiceCalls --> ServSessions

    %% Services communicating with Communication Channels
    ServWork -->|"updates"| ChannelSignalR
    ServWork -->|"updates"| ChannelOffline

    %% Communication Channels interact with External System
    ChannelSignalR -->|"real-time sync"| External
    ChannelOffline -->|"sync when online"| External

    %% Utilities support all layers (dotted connections as shared)
    UtilLib --- UIComp
    UtilLib --- ReduxHomeActions
    UtilLib --- ServEst
    ModelCards --- ReduxHomeReducer
    ModelEstimate --- ReduxHomeReducer
    ModelSession --- ReduxSessionReducer

    %% Click Events for Frontend UI
    click UIComp "https://github.com/microsoft/azure-boards-estimate/blob/main/src/components/buttons.tsx"
    click UIPages "https://github.com/microsoft/azure-boards-estimate/blob/main/src/pages/home/home.tsx"

    %% Click Events for State Management & Business Logic
    click ReduxInitReducer "https://github.com/microsoft/azure-boards-estimate/blob/main/src/initReducer.ts"
    click ReduxInitSaga "https://github.com/microsoft/azure-boards-estimate/blob/main/src/initSaga.ts"
    click ReduxHomeActions "https://github.com/microsoft/azure-boards-estimate/blob/main/src/pages/home/sessionsActions.ts"
    click ReduxHomeReducer "https://github.com/microsoft/azure-boards-estimate/blob/main/src/pages/home/sessionsReducer.ts"
    click ReduxHomeSaga "https://github.com/microsoft/azure-boards-estimate/blob/main/src/pages/home/sessionsSaga.ts"
    click ReduxSessionActions "https://github.com/microsoft/azure-boards-estimate/blob/main/src/pages/session/sessionActions.ts"
    click ReduxSessionReducer "https://github.com/microsoft/azure-boards-estimate/blob/main/src/pages/session/sessionReducer.ts"
    click ReduxSessionSaga "https://github.com/microsoft/azure-boards-estimate/blob/main/src/pages/session/sessionSaga.ts"

    %% Click Events for Services & Communication Layer
    click ServEst "https://github.com/microsoft/azure-boards-estimate/blob/main/src/services/estimation.ts"
    click ServWork "https://github.com/microsoft/azure-boards-estimate/blob/main/src/services/workItems.ts"
    click ServIdentity "https://github.com/microsoft/azure-boards-estimate/blob/main/src/services/identity.ts"
    click ServSessions "https://github.com/microsoft/azure-boards-estimate/blob/main/src/services/sessions.ts"
    click ChannelSignalR "https://github.com/microsoft/azure-boards-estimate/blob/main/src/services/channels/signalr.ts"
    click ChannelOffline "https://github.com/microsoft/azure-boards-estimate/blob/main/src/services/channels/offline.ts"

    %% Click Events for Utilities & Shared Libraries
    click UtilLib "https://github.com/microsoft/azure-boards-estimate/tree/main/src/lib"
    click ModelCards "https://github.com/microsoft/azure-boards-estimate/blob/main/src/model/cards.ts"
    click ModelEstimate "https://github.com/microsoft/azure-boards-estimate/blob/main/src/model/estimate.ts"
    click ModelSession "https://github.com/microsoft/azure-boards-estimate/blob/main/src/model/session.ts"

    %% Click Events for Configuration & Deployment
    click ConfigAzurePipeline "https://github.com/microsoft/azure-boards-estimate/blob/main/.azure-pipelines/azure-pipeline.yml"
    click ConfigDevContainer "https://github.com/microsoft/azure-boards-estimate/blob/main/.devcontainer"
    click Configs "https://github.com/microsoft/azure-boards-estimate/tree/main/configs"
    click ConfigPackage "https://github.com/microsoft/azure-boards-estimate/blob/main/package.json"
    click ConfigTsconfig "https://github.com/microsoft/azure-boards-estimate/blob/main/tsconfig.json"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef state fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef service fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef external fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef utility fill:#e2e3e5,stroke:#41464b,stroke-width:2px;
    classDef config fill:#fce5cd,stroke:#997a00,stroke-width:2px;
```
