# yulcaribe/main architecture

> Architecture diagram of the GitHub repository yulcaribe/main, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yulcaribe/main
- Repository: https://github.com/yulcaribe/main

## Overview

YulCaribe is an aviation-information web app centered on an interactive map. Users switch map modes to inspect navigation charts, live aircraft, NOTAMs, and WAFS overlays; the map controller activates the relevant client module, which requests data from PHP endpoints. Separate weather and NOTAM pages are also present. The sampled code supports the map dispatch and several API integrations; unsampled page wiring and some backend details are not inferred.

Main entry points: [`map/map.js`](https://github.com/yulcaribe/main/blob/main/map/map.js) (Map controller), [`api/cron.php`](https://github.com/yulcaribe/main/blob/main/api/cron.php) (NOTAM synchronizer), [`map/charts.js`](https://github.com/yulcaribe/main/blob/main/map/charts.js) (Charts layer), [`map/notam.js`](https://github.com/yulcaribe/main/blob/main/map/notam.js) (NOTAM layer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_map["Interactive map"]
  node_map_controller["Map controller<br/>[map.js]"]
  node_charts["Charts layer<br/>[charts.js]"]
  node_notam_ui["NOTAM layer<br/>[notam.js]"]
  node_adsb_ui["Aircraft layer<br/>[adsb.js]"]
  node_wafs_ui["WAFS overlays<br/>[wafs.js]"]
end

subgraph group_services["Aviation services"]
  node_navdata_api["Navigation data API<br/>[navdata.php]"]
  node_notam_api["NOTAM API<br/>[notam.php]"]
  node_adsb_api["ADS-B API<br/>[adsb.php]"]
  node_wafs_api["WAFS API<br/>[wafs.php]"]
  node_weather_api["METAR/TAF API<br/>[metartaf.php]"]
  node_notam_cron["NOTAM synchronizer<br/>[cron.php]"]
end

subgraph group_data["Operational data"]
  node_nav_store[("Navigation database<br/>[navdata.php]")]
  node_notam_store[("NOTAM database<br/>[notam.php]")]
end

subgraph group_pages["Web pages"]
  node_map_page["Map interface<br/>[index.html]"]
  node_app_js["Weather and app logic<br/>[app.js]"]
  node_home_page["Home page<br/>[index.html]"]
  node_notam_page["NOTAM page<br/>[index.html]"]
  node_health_page["Health page<br/>[index.html]"]
end

node_visitor(("Visitor"))
node_nms["FAA NMS"]
node_aircraft_feed["Aircraft feed"]
node_aviation_weather["AviationWeather.gov"]
node_awc_wafs["AWC WAFS"]

node_visitor -->|"opens"| node_map_page
node_map_page -->|"loads"| node_map_controller
node_map_controller -->|"creates and activates"| node_charts
node_map_controller -->|"creates and activates"| node_notam_ui
node_map_controller -->|"creates and activates"| node_adsb_ui
node_map_controller -->|"creates and activates"| node_wafs_ui
node_charts -->|"requests viewport data"| node_navdata_api
node_notam_ui -->|"requests map and detail"| node_notam_api
node_adsb_ui -->|"requests aircraft"| node_adsb_api
node_wafs_ui -->|"requests image"| node_wafs_api
node_navdata_api -->|"reads"| node_nav_store
node_notam_api -->|"reads"| node_notam_store
node_notam_cron -->|"fetches NOTAMs"| node_nms
node_notam_cron -->|"stores and prunes"| node_notam_store
node_adsb_api -->|"fetches feed"| node_aircraft_feed
node_weather_api -->|"fetches reports"| node_aviation_weather
node_wafs_api -->|"fetches imagery"| node_awc_wafs
node_visitor -->|"opens"| node_home_page
node_visitor -->|"opens"| node_notam_page
node_visitor -->|"opens"| node_health_page
node_home_page -->|"loads"| node_app_js
node_notam_page -->|"loads"| node_app_js

click node_map_page "https://github.com/yulcaribe/main/blob/main/map/index.html"
click node_map_controller "https://github.com/yulcaribe/main/blob/main/map/map.js"
click node_charts "https://github.com/yulcaribe/main/blob/main/map/charts.js"
click node_notam_ui "https://github.com/yulcaribe/main/blob/main/map/notam.js"
click node_adsb_ui "https://github.com/yulcaribe/main/blob/main/map/adsb.js"
click node_wafs_ui "https://github.com/yulcaribe/main/blob/main/map/wafs.js"
click node_navdata_api "https://github.com/yulcaribe/main/blob/main/api/navdata.php"
click node_notam_api "https://github.com/yulcaribe/main/blob/main/api/notam.php"
click node_adsb_api "https://github.com/yulcaribe/main/blob/main/api/adsb.php"
click node_wafs_api "https://github.com/yulcaribe/main/blob/main/api/wafs.php"
click node_weather_api "https://github.com/yulcaribe/main/blob/main/api/metartaf.php"
click node_notam_cron "https://github.com/yulcaribe/main/blob/main/api/cron.php"
click node_nav_store "https://github.com/yulcaribe/main/blob/main/api/navdata.php"
click node_notam_store "https://github.com/yulcaribe/main/blob/main/api/notam.php"
click node_app_js "https://github.com/yulcaribe/main/blob/main/app.js"
click node_home_page "https://github.com/yulcaribe/main/blob/main/index.html"
click node_notam_page "https://github.com/yulcaribe/main/blob/main/notam/index.html"
click node_health_page "https://github.com/yulcaribe/main/blob/main/health/index.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_map_controller,node_charts,node_notam_ui,node_adsb_ui,node_wafs_ui toneBlue
class node_navdata_api,node_notam_api,node_adsb_api,node_wafs_api,node_weather_api,node_notam_cron toneAmber
class node_nav_store,node_notam_store toneMint
class node_map_page,node_app_js,node_home_page,node_notam_page,node_health_page toneRose
class node_visitor,node_nms,node_aircraft_feed,node_aviation_weather,node_awc_wafs toneIndigo
```

## Components

### Interactive map

- [Map controller](https://github.com/yulcaribe/main/blob/main/map/map.js): `map/map.js`
- [Charts layer](https://github.com/yulcaribe/main/blob/main/map/charts.js): `map/charts.js`
- [NOTAM layer](https://github.com/yulcaribe/main/blob/main/map/notam.js): `map/notam.js`
- [Aircraft layer](https://github.com/yulcaribe/main/blob/main/map/adsb.js): `map/adsb.js`
- [WAFS overlays](https://github.com/yulcaribe/main/blob/main/map/wafs.js): `map/wafs.js`

### Aviation services

- [Navigation data API](https://github.com/yulcaribe/main/blob/main/api/navdata.php): `api/navdata.php`
- [NOTAM API](https://github.com/yulcaribe/main/blob/main/api/notam.php): `api/notam.php`
- [ADS-B API](https://github.com/yulcaribe/main/blob/main/api/adsb.php): `api/adsb.php`
- [WAFS API](https://github.com/yulcaribe/main/blob/main/api/wafs.php): `api/wafs.php`
- [METAR/TAF API](https://github.com/yulcaribe/main/blob/main/api/metartaf.php): `api/metartaf.php`
- [NOTAM synchronizer](https://github.com/yulcaribe/main/blob/main/api/cron.php): `api/cron.php`

### Operational data

- [Navigation database](https://github.com/yulcaribe/main/blob/main/api/navdata.php): `api/navdata.php`
- [NOTAM database](https://github.com/yulcaribe/main/blob/main/api/notam.php): `api/notam.php`

### Web pages

- [Map interface](https://github.com/yulcaribe/main/blob/main/map/index.html): `map/index.html`
- [Weather and app logic](https://github.com/yulcaribe/main/blob/main/app.js): `app.js`
- [Home page](https://github.com/yulcaribe/main/blob/main/index.html): `index.html`
- [NOTAM page](https://github.com/yulcaribe/main/blob/main/notam/index.html): `notam/index.html`
- [Health page](https://github.com/yulcaribe/main/blob/main/health/index.html): `health/index.html`

### Other components

- **Visitor**
- **FAA NMS**
- **Aircraft feed**
- **AviationWeather.gov**
- **AWC WAFS**

## Connections

- Visitor → Map interface: opens
- Map interface → Map controller: loads
- Map controller → Charts layer: creates and activates
- Map controller → NOTAM layer: creates and activates
- Map controller → Aircraft layer: creates and activates
- Map controller → WAFS overlays: creates and activates
- Charts layer → Navigation data API: requests viewport data
- NOTAM layer → NOTAM API: requests map and detail
- Aircraft layer → ADS-B API: requests aircraft
- WAFS overlays → WAFS API: requests image
- Navigation data API → Navigation database: reads
- NOTAM API → NOTAM database: reads
- NOTAM synchronizer → FAA NMS: fetches NOTAMs
- NOTAM synchronizer → NOTAM database: stores and prunes
- ADS-B API → Aircraft feed: fetches feed
- METAR/TAF API → AviationWeather.gov: fetches reports
- WAFS API → AWC WAFS: fetches imagery
- Visitor → Home page: opens
- Visitor → NOTAM page: opens
- Visitor → Health page: opens
- Home page → Weather and app logic: loads
- NOTAM page → Weather and app logic: loads
