# erenozkan3/adsb-sim-graph architecture

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

- Interactive diagram: https://gitdiagram.com/erenozkan3/adsb-sim-graph
- Repository: https://github.com/erenozkan3/adsb-sim-graph

## Overview

##### Main Components
- Frontend (Client):
- Located in the "client" folder, this contains the React application.
- Key directories include “client/src/components” (with MapComponent, ModificationComponent, SliderComponent) and “client/src/pages” (App.jsx, GraphPage.jsx, SimulationPage.jsx).
- This is responsible for the user interface, data visualization (graph and map), and making API calls to the backend.

- Backend (Server):
- Found in the "src" folder, where “App.py” serves as the Flask application entry point.
- Modules like "DataManipulation.py", "DataTypes.py", and "FlightFetcher.py" indicate backend logic for processing simulation parameters, handling flight data, and interacting with the external flight data API.
- The “requirements.txt” document lists dependencies like Flask, Requests, and PyTest, which further confirm the backend functionalities.

- External Flight Data API:

- Simulation and Visualization:
- Although not separate components per se, the simulation logic (altering flight trajectories based on given filters and rate adjustments) runs on the backend, while visualization is handled in the frontend.

##### Relationships and Data Flow
- The Frontend (React App) sends user input (filters, ICAO24 flight ID, latitude/longitude ranges, etc.) via HTTP requests (probably through Axios) to backend endpoints exposed by the Flask application.
- The Flask Backend receives these API requests, processes the simulation parameters, potentially pulls live data from the adsb.fi API, and returns the simulation outcomes.
- The frontend updates the display, using components like MapComponent for map views and GraphPage/SimulationPage for graphical representations of flight trajectories.

##### Architectural Patterns and Technologies
- API Communication: Emphasize the REST API interaction between the frontend and backend.
- Microservice-like External Integration: Represent the adsb.fi API as an external service with which the backend communicates.
- Technologies:
- Frontend: React, Axios, Recharts.
- Backend: Flask, Requests (for external API), Python (modules for data manipulation and flight fetching).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global User
    U("User"):::user

    %% Frontend Subgraph
    subgraph "Frontend (React Application)"
        FE("React Frontend"):::frontend
        FE_Map("MapComponent"):::frontend
        FE_Mod("ModificationComponent"):::frontend
        FE_Slider("SliderComponent"):::frontend
        FE_App("App Page"):::frontend
        FE_Graph("Graph Page"):::frontend
        FE_Sim("Simulation Page"):::frontend
    end

    %% Backend Subgraph
    subgraph "Backend (Flask API Server)"
        BE("Flask API Server"):::backend
        BE_App("Flask App"):::backend
        BE_DataManip("DataManipulation"):::backend
        BE_DataTypes("DataTypes"):::backend
        BE_FlightFetcher("FlightFetcher"):::backend
        BE_Test("ManipulationTest"):::backend
    end

    %% External Flight API
    EXT("adsb.fi Flight Data API"):::external

    %% Data Flow
    U -->|"initiates"| FE
    FE -->|"simulation_request"| BE
    BE -->|"fetch_flight_data"| EXT
    EXT -->|"flight_data_response"| BE
    BE -->|"simulation_result"| FE
    FE -->|"updates_view"| U

    %% Linking Frontend Subcomponents (for UI structure)
    FE --> FE_Map
    FE --> FE_Mod
    FE --> FE_Slider
    FE --> FE_App
    FE --> FE_Graph
    FE --> FE_Sim

    %% Linking Backend Internal Modules
    BE --> BE_App
    BE --> BE_DataManip
    BE --> BE_DataTypes
    BE --> BE_FlightFetcher
    BE --> BE_Test

    %% Click Events for Frontend
    click FE "https://github.com/erenozkan3/adsb-sim-graph/tree/main/client/"
    click FE_Map "https://github.com/erenozkan3/adsb-sim-graph/blob/main/client/src/components/MapComponent.jsx"
    click FE_Mod "https://github.com/erenozkan3/adsb-sim-graph/blob/main/client/src/components/ModificationComponent.jsx"
    click FE_Slider "https://github.com/erenozkan3/adsb-sim-graph/blob/main/client/src/components/SliderComponent.jsx"
    click FE_App "https://github.com/erenozkan3/adsb-sim-graph/blob/main/client/src/pages/App.jsx"
    click FE_Graph "https://github.com/erenozkan3/adsb-sim-graph/blob/main/client/src/pages/GraphPage.jsx"
    click FE_Sim "https://github.com/erenozkan3/adsb-sim-graph/blob/main/client/src/pages/SimulationPage.jsx"

    %% Click Events for Backend
    click BE "https://github.com/erenozkan3/adsb-sim-graph/tree/main/src/"
    click BE_App "https://github.com/erenozkan3/adsb-sim-graph/blob/main/src/App.py"
    click BE_DataManip "https://github.com/erenozkan3/adsb-sim-graph/blob/main/src/DataManipulation.py"
    click BE_DataTypes "https://github.com/erenozkan3/adsb-sim-graph/blob/main/src/DataTypes.py"
    click BE_FlightFetcher "https://github.com/erenozkan3/adsb-sim-graph/blob/main/src/FlightFetcher.py"
    click BE_Test "https://github.com/erenozkan3/adsb-sim-graph/blob/main/src/ManipulationTest.py"

    %% Styles
    classDef user fill:#ffd,stroke:#333,stroke-width:2px;
    classDef frontend fill:#aaf,stroke:#333,stroke-width:2px;
    classDef backend fill:#faa,stroke:#333,stroke-width:2px;
    classDef external fill:#afa,stroke:#333,stroke-width:2px;
```
