# silvauncompte/satellite-clock architecture

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

- Interactive diagram: https://gitdiagram.com/silvauncompte/satellite-clock
- Repository: https://github.com/silvauncompte/satellite-clock

## Overview

##### Main Components
- Hardware Interfaces:
- GPS Receiver (the source of the GPS trames used for time calculation)
- LED Display (for showing the time or clock information)
- WiFi Module (to enable server-based remote interactions)
- Software Modules (located in the src folder):
- LEDManager (controls the LED display behavior)
- gpsManager (handles communication with the GPS receiver)
- timeManager / TimeObj (manages time computations using GPS data)
- wifiManager (deals with network connectivity)
- server (provides an interface, likely via an embedded web server, which complements the data directory—HTML, JS, CSS—for a frontend UI)
- Additional Supporting Modules:
- “include” and “lib” directories can contain helper libraries or additional code shared across modules.
- “data” folder which holds frontend files (index.html, script.js, style.css). This suggests that a web-based interface is provided for monitoring or configuring the clock.
- “test” directory possibly for unit or integration tests.

##### Relationships and Interactions
- The gpsManager continuously receives GPS signals and extracts time information.
- timeManager (and possibly TimeObj) processes and formats the GPS data into proper time representations.
- LEDManager uses the processed time to control the display (likely in an LED matrix or similar hardware).
- wifiManager establishes network connectivity to allow remote interactions and possibly firmware updates.
- The server component serves the web frontend (files in the “data” directory) and may provide an API endpoint that the frontend’s JavaScript interacts with to display live clock data.
- The “platformio.ini” configuration indicates that the project is managed via PlatformIO, which is common in embedded projects and should be noted as part of the deployment/build system.

##### Architectural Patterns & Design Principles
- Modularity: Each functionality (GPS, LED, Time, WiFi, Server) is encapsulated in its own module with distinct responsibilities.
- Separation of Concerns: Hardware interfacing and user interface (web page) functionalities are clearly separated.
- Embedded and Full-Stack Integration: While the core is embedded C++ logic, there is also a web-based user interface indicating a full-stack interaction on a microcontroller platform.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Embedded Hardware"
        GPSR["GPS Receiver"]:::hardware
        LEDH["LED Display"]:::hardware
        WIFIH["WiFi Module"]:::hardware
    end

    subgraph "Embedded Software"
        gps["gpsManager"]:::software
        tm["timeManager"]:::software
        led["LEDManager"]:::software
        wifi["wifiManager"]:::software
        svr["server"]:::software
    end

    subgraph "Web/UI"
        web["Web Frontend"]:::web
    end

    subgraph "Supporting Modules"
        inc["include"]:::support
        lib["lib"]:::support
    end

    subgraph "Build & Deployment"
        pio["platformio.ini"]:::build
    end

    %% Data Flow Connections
    GPSR -->|"provides"| gps
    gps -->|"processes"| tm
    tm -->|"updates"| led
    tm -->|"provides"| svr
    wifi -->|"controls"| WIFIH
    led -->|"drives"| LEDH
    wifi -->|"connects"| svr
    svr -->|"serves"| web

    %% Supporting Modules Connections
    inc ---|"provides_helpers"| gps
    lib ---|"provides_libraries"| tm
    pio -->|"builds"| gps

    %% Click Events
    click gps "https://github.com/silvauncompte/satellite-clock/blob/main/src/gpsManager.cpp"
    click led "https://github.com/silvauncompte/satellite-clock/blob/main/src/LEDManager.cpp"
    click wifi "https://github.com/silvauncompte/satellite-clock/blob/main/src/wifiManager.cpp"
    click tm "https://github.com/silvauncompte/satellite-clock/blob/main/src/timeManager.cpp"
    click svr "https://github.com/silvauncompte/satellite-clock/blob/main/src/server.cpp"
    click web "https://github.com/silvauncompte/satellite-clock/tree/main/data"
    click inc "https://github.com/silvauncompte/satellite-clock/tree/main/include"
    click lib "https://github.com/silvauncompte/satellite-clock/tree/main/lib"
    click pio "https://github.com/silvauncompte/satellite-clock/blob/main/platformio.ini"

    %% Styles
    classDef hardware fill:#FAD7A0,stroke:#333,stroke-width:2px;
    classDef software fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef web fill:#A9DFBF,stroke:#333,stroke-width:2px;
    classDef support fill:#F5B7B1,stroke:#333,stroke-width:2px;
    classDef build fill:#F9E79F,stroke:#333,stroke-width:2px;
```
