# docouto/azure-firewall-mon architecture

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

- Interactive diagram: https://gitdiagram.com/docouto/azure-firewall-mon
- Repository: https://github.com/docouto/azure-firewall-mon

## Overview

##### Project type and purpose
- This is a single‐page application (SPA) written in Angular that provides a live, “Sysinternals‐Procmon”-style view of Azure Firewall logs without requiring Kusto queries.
- It also includes a Bicep template that provisions the Azure resources needed: Event Hub, Azure Map account, Azure OpenAI service, Application Insights, etc.

##### File structure
- Top level
– bicep/… .bicep & .json – Infrastructure-as-Code for deploying Azure resources
– firewall-mon-app/… – Angular SPA source code
- firewall-mon-app/src/app/
– Components: login, main-page, yesno-dialog
– Services:
· event-hub-source.service.ts (real-time log ingestion)
· search-field.service.ts & model.service.ts (text filter & ChatGPT mode via Azure OpenAI)
· encryption.service.ts, logging.service.ts, flags.service.ts (misc utilities)
- firewall-mon-app/src/environments – environment.ts for Azure connection strings, keys, endpoints

##### Extract README insights
- Architecture overview (images/architecture.png) shows:
Azure Firewall → Diagnostic Settings → Event Hub → Angular SPA → Browser
- Steps to provision: Event Hub Namespace/Hub, Azure Map, Azure OpenAI (GPT-4), Diagnostic Settings.
- SPA hosted (e.g.) as an Azure Static Web App or any static host; integrates with Application Insights.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% IaC Templates
    subgraph "Infrastructure as Code" 
        direction TB
        Bicep["Bicep Template"]:::iac
        ARMJSON["ARM JSON Output"]:::iac
    end

    %% Azure Resources
    subgraph "Azure Services" 
        direction TB
        Firewall["Azure Firewall"]:::azure
        Diag["Diagnostic Settings"]:::azure
        EH[(Azure Event Hub<br/>1-day retention<br/>1 partition)]:::azure
        Maps["Azure Maps Account"]:::azure
        OpenAI["Azure OpenAI (GPT-4)"]:::azure
        Insights["Application Insights"]:::azure
    end

    %% SPA Source
    subgraph "Angular SPA Source" 
        direction TB
        SPA["Angular SPA"]:::client
        MainTS["main.ts"]:::client
        AppModule["app.module.ts"]:::client
        AppRouting["app-routing.module.ts"]:::client
        LoginComp["login.component.ts"]:::client
        MainPageComp["main-page.component.ts"]:::client
        YesNoComp["yesno-dialog.component.ts"]:::client
        EventHubSvc["event-hub-source.service.ts"]:::client
        SearchSvc["search-field.service.ts"]:::client
        ModelSvc["model.service.ts"]:::client
        EncryptSvc["encryption.service.ts"]:::client
        LoggingSvc["logging.service.ts"]:::client
        FlagsSvc["flags.service.ts"]:::client
        FlagsData["flags-all-countries.json"]:::client
        DemoSvc["demo-source.service.ts"]:::client
        EnvDev["environment.ts"]:::client
        EnvProd["environment.prod.ts"]:::client
        SWAConfig["staticwebapp.config.json"]:::client
        LottieAssets["lottie assets<br/>(directory)"]:::client
    end

    %% End User
    Browser["End User Browser"]:::client

    %% Relationships
    Firewall -->|emits logs| Diag
    Diag -->|streams logs| EH
    EH -->|AMQP/HTTPS| SPA
    SPA -->|startup config| EnvDev
    SPA -->|startup config| EnvProd
    SPA -->|login UI| LoginComp
    SPA -->|main view| MainPageComp
    SPA -->|dialog| YesNoComp
    SPA -->|ingests logs| EventHubSvc
    SPA -->|full-text filter| SearchSvc
    SPA -->|ChatGPT mode| ModelSvc
    SPA -->|encrypt| EncryptSvc
    SPA -->|log telemetry| LoggingSvc
    SPA -->|flag utils| FlagsSvc
    SPA -->|flag data| FlagsData
    SPA -->|demo fallback| DemoSvc
    SPA -->|map lookups| Maps
    SPA -->|OpenAI calls| OpenAI
    SPA -->|insights| Insights
    Browser -->|renders| SPA

    Bicep -->|deploys| Firewall
    Bicep -->|deploys| Diag
    Bicep -->|deploys| EH
    Bicep -->|deploys| Maps
    Bicep -->|deploys| OpenAI
    Bicep -->|deploys| Insights

    ARMJSON -->|output of| Bicep

    %% Click Events
    click Bicep "https://github.com/docouto/azure-firewall-mon/blob/main/bicep/firewall-mon-azure-stuff.bicep"
    click ARMJSON "https://github.com/docouto/azure-firewall-mon/blob/main/bicep/firewall-mon-azure-stuff.json"
    click SPA "https://github.com/docouto/azure-firewall-mon/tree/main/firewall-mon-app/"
    click MainTS "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/main.ts"
    click AppModule "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/app.module.ts"
    click AppRouting "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/app-routing.module.ts"
    click LoginComp "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/login/login.component.ts"
    click MainPageComp "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/main-page/main-page.component.ts"
    click YesNoComp "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/yesno-dialog/yesno-dialog.component.ts"
    click EventHubSvc "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/services/event-hub-source.service.ts"
    click SearchSvc "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/services/search-field.service.ts"
    click ModelSvc "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/services/model.service.ts"
    click EncryptSvc "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/services/encryption.service.ts"
    click LoggingSvc "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/services/logging.service.ts"
    click FlagsSvc "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/services/flags.service.ts"
    click FlagsData "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/services/flags-all-countries.json"
    click DemoSvc "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/app/services/demo-source.service.ts"
    click EnvDev "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/environments/environment.ts"
    click EnvProd "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/environments/environment.prod.ts"
    click SWAConfig "https://github.com/docouto/azure-firewall-mon/blob/main/firewall-mon-app/src/assets/staticwebapp.config.json"
    click LottieAssets "https://github.com/docouto/azure-firewall-mon/tree/main/firewall-mon-app/src/assets/lottie/"

    %% Styles
    classDef azure fill:#dae8fc,stroke:#6c8ebf
    classDef client fill:#d5e8d4,stroke:#82b366
    classDef iac fill:#fff2cc,stroke:#d6b656
    class Bicep,ARMJSON iac
    class Firewall,Diag,EH,Maps,OpenAI,Insights azure
    class SPA,MainTS,AppModule,AppRouting,LoginComp,MainPageComp,YesNoComp,EventHubSvc,SearchSvc,ModelSvc,EncryptSvc,LoggingSvc,FlagsSvc,FlagsData,DemoSvc,EnvDev,EnvProd,SWAConfig,LottieAssets,Browser client
```
