# tfraudet/pyacphflightslogbook architecture

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

- Interactive diagram: https://gitdiagram.com/tfraudet/pyacphflightslogbook
- Repository: https://github.com/tfraudet/pyacphflightslogbook

## Overview

##### Connection and Data Flow

- APRS Server → APRS Client Module → Aircraft Logbook Processor
- Flight Logbook Manager ↔ MySQL Database
- Config Files → All Components
- All Components → Log Files

##### Additional Elements

Annotations for:
- Processing radius (200km range limitation)
- Data retention policy (30-day purge)
- Supported launch methods
- Approximate timing accuracy (1-2 minutes)

##### Technical Details

- Python version requirement (3.8.5/3.7.3)
- Key dependencies (geopy, mysql-connector, ogn-client, etc.)
- Database schema reference
- APRS filter settings

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef external fill:#D3D3D3,stroke:#333
    classDef core fill:#B3D9FF,stroke:#333
    classDef storage fill:#90EE90,stroke:#333
    classDef config fill:#FFD700,stroke:#333

    %% Legend
    subgraph Legend
        L1[External Services]:::external
        L2[Core Components]:::core
        L3[Storage Systems]:::storage
        L4[Configuration]:::config
        L5["--> Data Flow"]
        L6["==> Database Ops"]
        L7["..> Config/Logs"]
    end

    %% Data Sources Layer
    subgraph DataSources
        APRS[OGN APRS Server]:::external
        OGND[OGN Devices Database]:::external
        AIRP[Airports Database]:::external
    end

    %% Application Core Layer
    subgraph AppCore["Application Core"]
        DAEMON["ACPH Logbook Daemon"]:::core
        APRSC["APRS Client Module"]:::core
        ALOG["Aircraft Logbook Processor"]:::core
        FLOG["Flight Logbook Manager"]:::core
        AIRDB["Airport Database Manager"]:::core
        OGNDB["OGN Database Manager"]:::core
        
        %% Processing Components
        LAUNCH["Launch Method Detection"]:::core
        RUNWAY["Runway Detection System"]:::core
        EVENT["Event Processing Pipeline"]:::core
    end

    %% Storage Layer
    subgraph Storage
        MYSQL[(MySQL Database)]:::storage
        LOGS[("Log Files")]:::storage
        CONFIG["Configuration Files"]:::config
    end

    %% Connections
    APRS --> APRSC
    APRSC --> ALOG
    ALOG --> EVENT
    EVENT --> FLOG
    FLOG ==> MYSQL
    OGND --> OGNDB
    AIRP --> AIRDB
    AIRDB --> RUNWAY
    RUNWAY --> EVENT
    CONFIG -.-> DAEMON
    DAEMON -.-> LOGS

    %% Click events for component mapping
    click DAEMON "https://github.com/tfraudet/PyAcphFlightsLogbook/blob/master/acph-logbook.py"
    click APRSC "https://github.com/tfraudet/PyAcphFlightsLogbook/blob/master/acph/class_aprs.py"
    click ALOG "https://github.com/tfraudet/PyAcphFlightsLogbook/blob/master/acph/class_aircraft_logbook.py"
    click FLOG "https://github.com/tfraudet/PyAcphFlightsLogbook/blob/master/acph/class_flights_logbook.py"
    click AIRDB "https://github.com/tfraudet/PyAcphFlightsLogbook/blob/master/acph/class_airport_db.py"
    click OGNDB "https://github.com/tfraudet/PyAcphFlightsLogbook/blob/master/acph/class_ogn_db.py"
    click CONFIG "https://github.com/tfraudet/PyAcphFlightsLogbook/blob/master/acph-logbook.ini"
    click MYSQL "https://github.com/tfraudet/PyAcphFlightsLogbook/tree/master/db/"
    click LOGS "https://github.com/tfraudet/PyAcphFlightsLogbook/tree/master/logs/"
    click AIRP "https://github.com/tfraudet/PyAcphFlightsLogbook/blob/master/airports.csv"
    click OGND "https://github.com/tfraudet/PyAcphFlightsLogbook/blob/master/ogn-devices-ddb.json"

    %% Technical Annotations
    note["Processing Radius: 200km<br/>Data Retention: 30 days<br/>Timing Accuracy: 1-2 minutes"]
```
