# jplozf/ephemeeus architecture

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

- Interactive diagram: https://gitdiagram.com/jplozf/ephemeeus
- Repository: https://github.com/jplozf/ephemeeus

## Overview

##### Main Components Identification
The system should be divided into these primary components:

A. UI Layer
- MainWindow (MainWindow.cpp, MainWindow.h, MainWindow.ui)
- Dialog Components (DlgInputLocation.cpp, DlgInputLocation.h)

B. Core Calculation Engine
- Meeus Algorithm Implementation (Meeus.cpp, Meeus.h)
- Constants Module (constants.cpp, constants.h)

C. Utility Services
- Settings Management (settings.cpp, settings.h)
- Download Service (downloader.cpp, downloader.h)
- Utility Functions (utils.cpp, utils.h)

D. Data Models
- Location Data
- Time/Date Calculations
- Astronomical Variables ("Vargets")

**┌─────────────────────────────────────────────────┐**
- UI Layer                      │
- ┌─────────────┐        ┌──────────────────┐   │
- Main Window │        │ Location Dialog   │   │
- ┘        └──────────────────┘   │
- ┬─────────────────────────┘

**┌───────────────────────▼─────────────────────────┐**
- Core Calculation Engine            │
- ┌─────────────┐        ┌──────────────────┐   │
- Meeus     │        │    Constants     │   │
- Algorithms  │◄─────► │                  │   │
- ┘        └──────────────────┘   │
- ┬─────────────────────────┘

**┌───────────────────────▼─────────────────────────┐**
- Support Services                   │
- ┌─────────────┐  ┌────────────┐ ┌─────────┐   │
- Settings   │  │ Downloader │ │ Utils   │   │
- ┘  └────────────┘ └─────────┘   │
- ┘

##### Key Relationships to Highlight
- How the MainWindow interfaces with the Meeus calculation engine
- Data flow between the location dialog and settings management
- Demonstrate how the calculation engine uses constants
- Relationship between the downloader service and the main application

##### Technical Details
- Qt Framework integration points
- Data types for astronomical calculations
- Configuration flow
- Error handling paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#b3d9ff,stroke:#333
    classDef core fill:#b3ffb3,stroke:#333
    classDef service fill:#ffd9b3,stroke:#333
    classDef docs fill:#e6e6e6,stroke:#333
    classDef config fill:#ffccff,stroke:#333

    %% UI Layer
    subgraph UI
        MainWindow["Main Window"]
        DlgLocation["Location Dialog"]
    end

    %% Core Layer
    subgraph Core
        MeeusEngine["Meeus Algorithm Engine"]
        Constants["Constants Module"]
        App["Application Core"]
    end

    %% Services Layer
    subgraph Services
        Settings["Settings Manager"]
        Downloader["Download Service"]
        Utils["Utility Functions"]
    end

    %% Documentation Layer
    subgraph Documentation
        SolarDocs["Solar Calculations"]
        LunarDocs["Lunar Calculations"]
        TimeDocs["Time & Location Docs"]
    end

    %% Configuration
    Config["Project Configuration"]

    %% Relationships
    MainWindow --> MeeusEngine
    MainWindow --> Settings
    DlgLocation --> Settings
    MeeusEngine --> Constants
    MeeusEngine --> Utils
    App --> MainWindow
    App --> MeeusEngine
    Settings --> Utils
    Downloader --> Utils

    %% Click Events
    click MainWindow "https://github.com/jplozf/ephemeeus/blob/main/MainWindow.cpp"
    click DlgLocation "https://github.com/jplozf/ephemeeus/blob/main/DlgInputLocation.cpp"
    click MeeusEngine "https://github.com/jplozf/ephemeeus/blob/main/Meeus.cpp"
    click Constants "https://github.com/jplozf/ephemeeus/blob/main/constants.cpp"
    click Settings "https://github.com/jplozf/ephemeeus/blob/main/settings.cpp"
    click Downloader "https://github.com/jplozf/ephemeeus/blob/main/downloader.cpp"
    click Utils "https://github.com/jplozf/ephemeeus/blob/main/utils.cpp"
    click App "https://github.com/jplozf/ephemeeus/blob/main/app.cpp"
    click SolarDocs "https://github.com/jplozf/ephemeeus/tree/main/dox/en"
    click LunarDocs "https://github.com/jplozf/ephemeeus/tree/main/dox/en"
    click TimeDocs "https://github.com/jplozf/ephemeeus/tree/main/dox/en"
    click Config "https://github.com/jplozf/ephemeeus/blob/main/ephemeeus.pro"

    %% Style Applications
    class MainWindow,DlgLocation ui
    class MeeusEngine,Constants,App core
    class Settings,Downloader,Utils service
    class SolarDocs,LunarDocs,TimeDocs docs
    class Config config

    %% Legend
    subgraph Legend
        UI_Component["UI Component"]:::ui
        Core_Component["Core Component"]:::core
        Service_Component["Service Component"]:::service
        Doc_Component["Documentation"]:::docs
        Config_Component["Configuration"]:::config
    end
```
