# projectgroupkikmrsc/sarf-sarpcourse architecture

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

- Interactive diagram: https://gitdiagram.com/projectgroupkikmrsc/sarf-sarpcourse
- Repository: https://github.com/projectgroupkikmrsc/sarf-sarpcourse

## Overview

This is a browser-based nautical navigation and SAR planning application. The principal workflow is a learner or planner entering route/navigation inputs, receiving calculated results and chart visualizations, then using the results for planning or export. The large runtime is concentrated in app.js; land_data.js supplies a substantial offline land-polygon dataset, though the excerpts do not show its use. README-described capabilities are retained; unsampled wiring is left unasserted. Donation endpoints are shown separately from the core workflow.

Main entry points: [`app.js`](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js) (Navigation app runtime), [`index.html`](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/index.html) (Web entry page), [`api/callback.js`](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/api/callback.js) (Payment callback), [`api/derma.js`](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/api/derma.js) (Create donation bill)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser application"]
  node_web_entry["Web entry page<br/>[index.html]"]
  node_runtime["Navigation app runtime<br/>[app.js]"]
end

subgraph group_navigation["Navigation and charts"]
  node_vector_calc["Vector calculations<br/>[app.js]"]
  node_chart["Interactive chart<br/>[app.js]"]
  node_land_mask["Offline land polygons<br/>[land_data.js]"]
  node_route_results["Route results<br/>[app.js]"]
end

subgraph group_planning["Maritime planning"]
  node_drift["Drift and datum analysis<br/>[app.js]"]
  node_search_patterns["SAR search patterns<br/>[app.js]"]
  node_monte_carlo["Monte Carlo timeline<br/>[app.js]"]
  node_tides["Tidal planning<br/>[app.js]"]
  node_exports["Plan and chart exports<br/>[app.js]"]
end

subgraph group_support["Contributions"]
  node_donation["Create donation bill<br/>[derma.js]"]
  node_callback["Payment callback<br/>[callback.js]"]
end

node_user(("Learner / planner"))
node_payment["ToyyibPay"]
node_supabase[("Donations store")]

node_user -->|"opens"| node_web_entry
node_web_entry -.->|"loads runtime"| node_runtime
node_runtime -->|"calculates vectors"| node_vector_calc
node_runtime -->|"renders navigation"| node_chart
node_runtime -->|"presents results"| node_route_results
node_runtime -->|"analyzes drift"| node_drift
node_runtime -->|"generates patterns"| node_search_patterns
node_runtime -->|"controls timeline"| node_monte_carlo
node_runtime -->|"renders tidal data"| node_tides
node_runtime -->|"exports plans"| node_exports
node_donation -->|"creates bill"| node_payment
node_payment -.->|"sends callback"| node_callback
node_callback -->|"writes donation"| node_supabase

click node_web_entry "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/index.html"
click node_runtime "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js"
click node_vector_calc "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js"
click node_chart "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js"
click node_land_mask "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/land_data.js"
click node_route_results "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js"
click node_drift "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js"
click node_search_patterns "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js"
click node_monte_carlo "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js"
click node_tides "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js"
click node_exports "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js"
click node_donation "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/api/derma.js"
click node_callback "https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/api/callback.js"

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_web_entry,node_runtime toneBlue
class node_vector_calc,node_chart,node_land_mask,node_route_results,node_supabase toneAmber
class node_drift,node_search_patterns,node_monte_carlo,node_tides,node_exports toneMint
class node_donation,node_callback toneRose
class node_user,node_payment toneIndigo
```

## Components

### Browser application

- [Web entry page](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/index.html): `index.html`
- [Navigation app runtime](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js): `app.js`

### Navigation and charts

- [Vector calculations](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js): `app.js`
- [Interactive chart](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js): `app.js`
- [Offline land polygons](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/land_data.js): `land_data.js`
- [Route results](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js): `app.js`

### Maritime planning

- [Drift and datum analysis](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js): `app.js`
- [SAR search patterns](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js): `app.js`
- [Monte Carlo timeline](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js): `app.js`
- [Tidal planning](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js): `app.js`
- [Plan and chart exports](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/app.js): `app.js`

### Contributions

- [Create donation bill](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/api/derma.js): `api/derma.js`
- [Payment callback](https://github.com/projectgroupkikmrsc/sarf-sarpcourse/blob/main/api/callback.js): `api/callback.js`

### Other components

- **Learner / planner**
- **ToyyibPay**
- **Donations store**

## Connections

- Learner / planner → Web entry page: opens (evidence: `README.md`)
- Web entry page → Navigation app runtime: loads runtime
- Navigation app runtime → Vector calculations: calculates vectors (evidence: `app.js`)
- Navigation app runtime → Interactive chart: renders navigation (evidence: `app.js`)
- Navigation app runtime → Route results: presents results (evidence: `README.md`)
- Navigation app runtime → Drift and datum analysis: analyzes drift (evidence: `app.js`)
- Navigation app runtime → SAR search patterns: generates patterns (evidence: `app.js`)
- Navigation app runtime → Monte Carlo timeline: controls timeline (evidence: `app.js`)
- Navigation app runtime → Tidal planning: renders tidal data (evidence: `app.js`)
- Navigation app runtime → Plan and chart exports: exports plans (evidence: `app.js`)
- Create donation bill → ToyyibPay: creates bill (evidence: `api/derma.js`)
- ToyyibPay → Payment callback: sends callback
- Payment callback → Donations store: writes donation (evidence: `api/callback.js`)
