# caffeine-overload-416/lifetimefinancialplanner architecture

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

- Interactive diagram: https://gitdiagram.com/caffeine-overload-416/lifetimefinancialplanner
- Repository: https://github.com/caffeine-overload-416/lifetimefinancialplanner

## Overview

##### Project type and purpose
- This is a full-stack web application called “Lifetime Financial Planner.”
- Frontend: React single-page app (Vite).
- Backend: Spring Boot (Java) REST API with MyBatis for persistence.
- Purpose: let users define income/expense/investment events, run lifetime financial simulations, view charts and reports.

##### File structure
- Top-level:
- Gradle build files (build.gradle, settings.gradle, gradlew, gradle/wrapper)
- logs/ – simulation run output CSV/logs
- src/main/frontend/ – React code, config, public assets, build output under dist/
- src/main/java/com/app/lifetimefinancialplanner/ – Spring Boot app
– config/ – AsyncConfig, MyBatisConfiguration, TaxDataLoader, WebConfig
– controller/ – REST controllers per entity (User, Simulation, Scenario, etc.)
– service/ – business logic interfaces + implementations
– repository/ – MyBatis repositories (mappers)
– domain/ – entities, DTOs, converters, embeddables
– exception/ – custom exceptions
- src/main/resources/ – application-template.yml, static/ YAML tax brackets
- Testing: JUnit tests under src/test/java.

##### README
- Minimal README that identifies the project as “Life Time Financial Planner.”
- Implicit architecture: REST API + SPA + database + tax-bracket loader + async simulation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Tier
    subgraph "Client Tier"
        Browser["User's Browser"]:::frontend
        SPA["React SPA"]:::frontend
    end
    click SPA "https://github.com/caffeine-overload-416/lifetimefinancialplanner/tree/master/src/main/frontend/"
    Browser -->|"loads SPA"| SPA
    SPA -->|"HTTPS REST calls"| API["Spring Boot REST API"]:::controller

    %% Server Tier
    subgraph "Server Tier"
        API --> Controllers
        Controllers["API Controllers"]:::controller
        click Controllers "https://github.com/caffeine-overload-416/lifetimefinancialplanner/tree/master/src/main/java/com/app/lifetimefinancialplanner/controller/"

        Controllers -->|"delegate calls"| BusinessSvc
        Controllers -->|"start simulation"| SimSvc

        subgraph "Service Layer"
            BusinessSvc["Business Services"]:::service
            click BusinessSvc "https://github.com/caffeine-overload-416/lifetimefinancialplanner/tree/master/src/main/java/com/app/lifetimefinancialplanner/service/"

            SimSvc["SimulationServiceImpl"]:::service
            click SimSvc "https://github.com/caffeine-overload-416/lifetimefinancialplanner/blob/master/src/main/java/com/app/lifetimefinancialplanner/service/SimulationServiceImpl.java"

            SamplingSvc["SamplingService"]:::service
            click SamplingSvc "https://github.com/caffeine-overload-416/lifetimefinancialplanner/blob/master/src/main/java/com/app/lifetimefinancialplanner/service/SamplingService.java"

            LogSvc["LogService"]:::service
            click LogSvc "https://github.com/caffeine-overload-416/lifetimefinancialplanner/blob/master/src/main/java/com/app/lifetimefinancialplanner/service/LogService.java"
        end

        BusinessSvc --> Domain
        Domain["Domain Model (Entities/DTOs)"]:::domain
        click Domain "https://github.com/caffeine-overload-416/lifetimefinancialplanner/tree/master/src/main/java/com/app/lifetimefinancialplanner/domain/"

        BusinessSvc --> Repos
        SimSvc --> Repos
        subgraph "Repository Layer"
            Repos["MyBatis Repositories"]:::repo
            click Repos "https://github.com/caffeine-overload-416/lifetimefinancialplanner/tree/master/src/main/java/com/app/lifetimefinancialplanner/repository/"
        end
        Repos -->|"SQL queries"| DB

        SimSvc -->|"async tasks"| ThreadPool["Async Thread Pool"]:::service

        subgraph "Configuration & Startup"
            Config["Configurations"]:::config
            click Config "https://github.com/caffeine-overload-416/lifetimefinancialplanner/tree/master/src/main/java/com/app/lifetimefinancialplanner/config/"

            TaxLoader["TaxDataLoader"]:::config
            click TaxLoader "https://github.com/caffeine-overload-416/lifetimefinancialplanner/blob/master/src/main/java/com/app/lifetimefinancialplanner/config/TaxDataLoader.java"
        end
        Config --> TaxLoader
        TaxLoader --> StaticYAML

        %% Static Data
        subgraph "Static Data Store"
            StaticYAML["YAML Tax Brackets"]:::static
            click StaticYAML "https://github.com/caffeine-overload-416/lifetimefinancialplanner/blob/master/src/main/resources/static/federalTaxBracket2025.yaml"
            click StaticYAML "https://github.com/caffeine-overload-416/lifetimefinancialplanner/blob/master/src/main/resources/static/stateTaxBracket2025.yaml"
        end

        %% Application Config Files
        AppYml["application-template.yml"]:::static
        click AppYml "https://github.com/caffeine-overload-416/lifetimefinancialplanner/blob/master/src/main/resources/application-template.yml"
        ConfigXml["config.xml"]:::static
        click ConfigXml "https://github.com/caffeine-overload-416/lifetimefinancialplanner/blob/master/src/main/resources/config/config.xml"

        %% Database & Logs
        DB["Relational Database"]:::db
        Logs["Simulation Logs Directory"]:::static
        click Logs "https://github.com/caffeine-overload-416/lifetimefinancialplanner/tree/master/logs/simulation/"

    end

    %% Connections to external
    SPA -->|"bundled via Vite"| dist["dist/"]:::frontend

    %% Services interactions
    SimSvc --> Logs
    SimSvc --> DB

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6;
    classDef controller fill:#DFFFD0,stroke:#228B22,color:#228B22;
    classDef service fill:#FFF5B1,stroke:#DAA520,color:#DAA520;
    classDef repo fill:#FFD8B1,stroke:#FF8C00,color:#FF8C00;
    classDef db fill:#E0E0E0,stroke:#696969,color:#696969,stroke-dasharray: 5 5;
    classDef static fill:#F5E1C9,stroke:#A0522D,color:#A0522D;
    classDef config fill:#F5E1C9,stroke:#A0522D,color:#A0522D;
    classDef domain fill:#E8D0FF,stroke:#800080,color:#800080;
```
