# jmpompeo/compoundinterestcalculator architecture

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

- Interactive diagram: https://gitdiagram.com/jmpompeo/compoundinterestcalculator
- Repository: https://github.com/jmpompeo/compoundinterestcalculator

## Overview

##### Project type and purpose
- From the file tree and (admittedly sparse) README, this is a serverless/.NET Azure Function project named “CompoundCalc” designed to calculate compound interest. It includes:
- A Function App (“CompoundCalculator”) implemented in C#
- Supporting business-logic services and helpers (Conversions.cs, CalculationService.cs)
- Infrastructure as code (Bicep templates under .infrastructure) to deploy the Function, Storage account, and Application Insights
- A test suite (CompoundInterestCalculatorTests)
- CI/CD workflows (GitHub Actions), PowerShell scripts, and Dockerfiles for local and test containerization

##### File structure
- Top-level directories:
- .infrastructure – Bicep modules: app-insights.bicep, function-app.bicep, storage.bicep
- CompoundCalc – the Function App source:
– Functions folder (HTTP trigger entry point)
– Services & Helpers (business logic)
– Models/Requests (data contracts)
- CompoundInterestCalculatorTests – unit tests mirroring the Function App’s code structure
- .github/workflows – CI/CD definitions (build, deploy, deploy_bicep)
- Scripts – automation helpers (export-template.psm1, test-func.psm1)
- Key config/build files:
- CompoundInterestCalculator.sln
- Dockerfile & Dockerfile.tests
- global.json, host.json, launchSettings.json

##### README for additional insights
- No architecture section present yet. We’ll infer from code and infra.
- The project uses Azure Functions, Bicep for infra, GitHub Actions for CI/CD, and .NET 6/7 SDK (global.json).

##### Detail without over-splitting
- Internal layering of the Function App: Trigger → Services → Helpers → Models
- Test suite and containerization as side-bars rather than main data flows

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["HTTP Client"]:::external

    subgraph "Azure Function App"
        CompoundFunction["Azure Function App\n(CompoundCalculator)"]:::runtime
        Trigger["HTTP Trigger\nCompoundCalculator.cs"]:::runtime
        CS["CalculationService.cs"]:::runtime
        Conv["Conversions.cs"]:::runtime
        Model["InterestCalcReq.cs"]:::runtime
    end

    subgraph "Deployment (IaC)"
        main["main.bicep"]:::deployment
        modFunc["function-app.bicep"]:::deployment
        modStorage["storage.bicep"]:::deployment
        modAI["app-insights.bicep"]:::deployment
    end

    subgraph "CI/CD Pipeline"
        GA1["build_deploy.yml"]:::deployment
        GA2["deploy_bicep.yml"]:::deployment
    end

    subgraph "Local/Test Tools"
        D1["Dockerfile"]:::tool
        D2["Dockerfile.tests"]:::tool
        S1["export-template.psm1"]:::tool
        S2["test-func.psm1"]:::tool
    end

    subgraph "Unit Test Suite"
        T1["CompoundCalcTests.cs"]:::tool
        T2["CalcServiceTests.cs"]:::tool
        T3["InterestCalcReqTests.cs"]:::tool
        Tproj["Tests Project (.csproj)"]:::tool
    end

    Storage[(Azure Storage Account)]:::runtime
    AppInsights[(Application Insights)]:::monitoring

    Client -->|HTTP Request| CompoundFunction
    CompoundFunction -->|invokes| Trigger
    Trigger -->|calls| CS
    CS -->|uses| Conv
    CS -->|binds| Model
    CompoundFunction -->|reads/writes| Storage
    CompoundFunction -->|sends telemetry| AppInsights

    GA1 -->|deploy code| CompoundFunction
    GA1 -->|build & test| Tproj
    GA2 -->|deploy infra| main
    GA2 -->|module| modFunc
    GA2 -->|module| modStorage
    GA2 -->|module| modAI

    D1 -.->|local dev| CompoundFunction
    D2 -.->|container tests| Tproj
    S1 -.->|export template| main
    S2 -.->|run function tests| Trigger

    T1 -.->|tests| Trigger
    T2 -.->|tests| CS
    T3 -.->|tests| Model

    click Trigger "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/CompoundCalc/Functions/CompoundCalculator.cs"
    click CS "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/CompoundCalc/Services/CalculationService.cs"
    click Conv "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/CompoundCalc/Helpers/Conversions.cs"
    click Model "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/CompoundCalc/Models/Requests/InterestCalcReq.cs"
    click main "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/.infrastructure/main.bicep"
    click modFunc "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/.infrastructure/modules/function-app.bicep"
    click modStorage "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/.infrastructure/modules/storage.bicep"
    click modAI "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/.infrastructure/modules/app-insights.bicep"
    click GA1 "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/.github/workflows/build_deploy.yml"
    click GA2 "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/.github/workflows/deploy_bicep.yml"
    click D1 "https://github.com/jmpompeo/compoundinterestcalculator/tree/main/Dockerfile"
    click D2 "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/Dockerfile.tests"
    click S1 "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/Scripts/export-template.psm1"
    click S2 "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/Scripts/test-func.psm1"
    click T1 "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/CompoundInterestCalculatorTests/Functions/CompoundCalcTests.cs"
    click T2 "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/CompoundInterestCalculatorTests/Services/CalcServiceTests.cs"
    click T3 "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/CompoundInterestCalculatorTests/Models/Requests/InterestCalcReqTests.cs"
    click Tproj "https://github.com/jmpompeo/compoundinterestcalculator/blob/main/CompoundInterestCalculatorTests/CompoundInterestCalculatorTests.csproj"

    classDef runtime fill:#D0E8FF,stroke:#0366d6
    classDef deployment fill:#E6F4EA,stroke:#2CBE4E
    classDef monitoring fill:#FFEFD5,stroke:#FF8C00
    classDef external fill:#F0F0F0,stroke:#888888
    classDef tool fill:#E8E8E8,stroke:#AAAAAA
```
