# jodacola/strontium architecture

> Architecture diagram of the GitHub repository jodacola/strontium, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jodacola/strontium
- Repository: https://github.com/jodacola/strontium

## Overview

##### Component Details and Relationships

a. Framework Core (StrontiumApp)
- Center the `StrontiumApp` component as the main orchestrator
- It to `SrApp` and `SrServiceContainer` for service management
- `Logger` system with different log levels
- Connection to `SrStats` for performance monitoring

b. Services Layer
- Service container management system
- To configuration system

c. UI Layer
- `SrUi` and `SrUiComponent` as base components
- Relationship with `SrComponentStateHelpers`
- To the configuration system via `StrontiumUiConfig`

d. Messaging System
- `SrLocalMessaging`
- `IMessageHandler`
- `IMessageInterceptor`
- Message flow paths

e. Navigation System
- `NavHandler` and its utilities
- `NavigationTarget` processing
- Route matching system
- Navigation state management

f. API Layer
- `SrWebApiConnection` implementation
- Request/response flow
- Loading states management

g. Configuration System
- `StrontiumAppConfig` at the center
- Various config elements:
- API configuration
- Logger configuration
- Service configuration
- UI configuration
- Route configuration

##### Important Relationships to Highlight

- How the messaging system integrates with all other components
- Configuration system's influence on each component
- Demonstrate the service container's relationship with other services
- How the UI components interact with the navigation system
- API integration points with the rest of the system

## Diagram (Mermaid)

```mermaid
graph TB
    %% Core Framework
    subgraph Core
        StrontiumApp["StrontiumApp"]:::core
        SrApp["SrApp"]:::core
        Logger["Logger"]:::core
        SrStats["SrStats"]:::core
        SrServiceContainer["SrServiceContainer"]:::core
    end

    %% Services Layer
    subgraph Services
        IAppService["IAppService"]:::service
        ServiceConfig["ServiceConfigElement"]:::service
        ServicesConfig["ServicesConfigElement"]:::service
    end

    %% UI Layer
    subgraph UI
        SrUi["SrUi"]:::ui
        SrUiComponent["SrUiComponent"]:::ui
        StateHelpers["SrComponentStateHelpers"]:::ui
        UiConfig["StrontiumUiConfig"]:::ui
    end

    %% Messaging System
    subgraph Messaging
        SrLocalMessaging["SrLocalMessaging"]:::messaging
        IMessageHandler["IMessageHandler"]:::messaging
        IMessageInterceptor["IMessageInterceptor"]:::messaging
        SrAppMessage["SrAppMessage"]:::messaging
        CommonMessages["CommonMessages"]:::messaging
    end

    %% Navigation System
    subgraph Navigation
        NavHandler["NavHandler"]:::nav
        NavigationTarget["NavigationTarget"]:::nav
        NavHandlerUtils["NavHandlerUtils"]:::nav
        INavigationHandler["INavigationHandler"]:::nav
    end

    %% API Layer
    subgraph API
        SrApi["SrApi"]:::api
        ApiContainer["ApiContainer"]:::api
        SrWebApiConnection["SrWebApiConnection"]:::api
        SrServiceRequest["SrServiceRequest"]:::api
        SrServiceResponse["SrServiceResponse"]:::api
    end

    %% Configuration System
    subgraph Config
        StrontiumAppConfig["StrontiumAppConfig"]:::config
        ApiConfigElement["ApiConfigElement"]:::config
        LoggerConfigElement["LoggerConfigElement"]:::config
        RouteConfigElement["RouteConfigElement"]:::config
        DefaultAppConfig["DefaultAppConfig"]:::config
    end

    %% Relationships
    StrontiumApp --> SrApp
    StrontiumApp --> SrServiceContainer
    StrontiumApp --> Logger
    StrontiumApp --> SrStats

    SrServiceContainer --> IAppService
    IAppService --> ServiceConfig
    ServiceConfig --> ServicesConfig

    StrontiumApp --> SrUi
    SrUi --> SrUiComponent
    SrUiComponent --> StateHelpers
    SrUi --> UiConfig

    StrontiumApp --> SrLocalMessaging
    SrLocalMessaging --> IMessageHandler
    SrLocalMessaging --> IMessageInterceptor
    SrLocalMessaging --> SrAppMessage
    SrLocalMessaging --> CommonMessages

    StrontiumApp --> NavHandler
    NavHandler --> NavigationTarget
    NavHandler --> NavHandlerUtils
    NavHandler --> INavigationHandler

    StrontiumApp --> SrApi
    SrApi --> ApiContainer
    ApiContainer --> SrWebApiConnection
    SrWebApiConnection --> SrServiceRequest
    SrWebApiConnection --> SrServiceResponse

    StrontiumAppConfig --> ApiConfigElement
    StrontiumAppConfig --> LoggerConfigElement
    StrontiumAppConfig --> RouteConfigElement
    StrontiumAppConfig --> DefaultAppConfig
    StrontiumAppConfig --> UiConfig

    %% Click Events
    click StrontiumApp "https://github.com/jodacola/strontium/blob/master/lib/framework/StrontiumApp.tsx"
    click SrApp "https://github.com/jodacola/strontium/blob/master/lib/framework/SrApp.ts"
    click Logger "https://github.com/jodacola/strontium/blob/master/lib/framework/Logger.ts"
    click SrStats "https://github.com/jodacola/strontium/blob/master/lib/framework/SrStats.ts"
    click SrServiceContainer "https://github.com/jodacola/strontium/blob/master/lib/framework/SrServiceContainer.ts"
    click IAppService "https://github.com/jodacola/strontium/blob/master/lib/framework/IAppService.ts"
    click ServiceConfig "https://github.com/jodacola/strontium/blob/master/lib/config/ServiceConfigElement.tsx"
    click ServicesConfig "https://github.com/jodacola/strontium/blob/master/lib/config/ServicesConfigElement.tsx"
    click SrUi "https://github.com/jodacola/strontium/blob/master/lib/ui/SrUi.tsx"
    click SrUiComponent "https://github.com/jodacola/strontium/blob/master/lib/ui/SrUiComponent.tsx"
    click StateHelpers "https://github.com/jodacola/strontium/blob/master/lib/ui/SrComponentStateHelpers.ts"
    click UiConfig "https://github.com/jodacola/strontium/blob/master/lib/config/StrontiumUiConfig.ts"
    click SrLocalMessaging "https://github.com/jodacola/strontium/blob/master/lib/messaging/SrLocalMessaging.ts"
    click IMessageHandler "https://github.com/jodacola/strontium/blob/master/lib/messaging/IMessageHandler.ts"
    click IMessageInterceptor "https://github.com/jodacola/strontium/blob/master/lib/messaging/IMessageInterceptor.ts"
    click SrAppMessage "https://github.com/jodacola/strontium/blob/master/lib/messaging/SrAppMessage.ts"
    click CommonMessages "https://github.com/jodacola/strontium/blob/master/lib/messaging/CommonMessages.ts"
    click NavHandler "https://github.com/jodacola/strontium/blob/master/lib/navigation/NavHandler.ts"
    click NavigationTarget "https://github.com/jodacola/strontium/blob/master/lib/navigation/NavigationTarget.ts"
    click NavHandlerUtils "https://github.com/jodacola/strontium/blob/master/lib/navigation/NavHandlerUtils.ts"
    click INavigationHandler "https://github.com/jodacola/strontium/blob/master/lib/navigation/INavigationHandler.ts"
    click SrApi "https://github.com/jodacola/strontium/blob/master/lib/api/SrApi.ts"
    click ApiContainer "https://github.com/jodacola/strontium/blob/master/lib/api/ApiContainer.ts"
    click SrWebApiConnection "https://github.com/jodacola/strontium/blob/master/lib/api/SrWebApiConnection.ts"
    click SrServiceRequest "https://github.com/jodacola/strontium/blob/master/lib/api/SrServiceRequest.ts"
    click SrServiceResponse "https://github.com/jodacola/strontium/blob/master/lib/api/SrServiceResponse.ts"
    click StrontiumAppConfig "https://github.com/jodacola/strontium/blob/master/lib/config/StrontiumAppConfig.ts"
    click ApiConfigElement "https://github.com/jodacola/strontium/blob/master/lib/config/ApiConfigElement.tsx"
    click LoggerConfigElement "https://github.com/jodacola/strontium/blob/master/lib/config/LoggerConfigElement.tsx"
    click RouteConfigElement "https://github.com/jodacola/strontium/blob/master/lib/config/RouteConfigElement.tsx"
    click DefaultAppConfig "https://github.com/jodacola/strontium/blob/master/lib/config/DefaultAppConfig.ts"

    %% Styles
    classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px;
    classDef service fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef ui fill:#FFEB3B,stroke:#333,stroke-width:2px;
    classDef messaging fill:#FFA500,stroke:#333,stroke-width:2px;
    classDef nav fill:#E1BEE7,stroke:#333,stroke-width:2px;
    classDef api fill:#FF8A80,stroke:#333,stroke-width:2px;
    classDef config fill:#E0E0E0,stroke:#333,stroke-width:2px;

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Services"]:::service
        L3["UI Components"]:::ui
        L4["Messaging"]:::messaging
        L5["Navigation"]:::nav
        L6["API"]:::api
        L7["Configuration"]:::config
    end
```
