# steinaustgen/newtra architecture

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

- Interactive diagram: https://gitdiagram.com/steinaustgen/newtra
- Repository: https://github.com/steinaustgen/newtra

## Overview

This is a browser-based Pampanga jeepney route planner and transit information app. Users choose stops and passenger type, then receive fewest-ride journey options with fares and map directions. The same JavaScript file also supports stop and route browsing, fare estimates, nearby-stop discovery, contributions, and theme preferences. The excerpts show these capabilities in a monolithic implementation; omitted portions limit confidence about some internal calls and data loading.

Main entry points: [`app.js`](https://github.com/steinaustgen/newtra/blob/main/app.js) (App Controller), [`index.html`](https://github.com/steinaustgen/newtra/blob/main/index.html) (Browser Interface), [`stops.csv`](https://github.com/steinaustgen/newtra/blob/main/stops.csv) (Stop Data), [`routes.csv`](https://github.com/steinaustgen/newtra/blob/main/routes.csv) (Route Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_journey["Journey Planning"]
  node_planner["Journey Planner<br/>[app.js]"]
  node_search["Fewest-Ride Search<br/>[app.js]"]
  node_directions["Map Directions<br/>[app.js]"]
end

subgraph group_reference["Transit Reference"]
  node_stops[("Stop Data<br/>[stops.csv]")]
  node_routes[("Route Data<br/>[routes.csv]")]
  node_directory["Stop Directory<br/>[app.js]"]
  node_catalog["Route Catalog<br/>[app.js]"]
end

subgraph group_tools["Travel Tools"]
  node_fare["Fare Estimator<br/>[app.js]"]
  node_nearby["Nearest Stop<br/>[app.js]"]
  node_contribution["Contributions<br/>[app.js]"]
end

subgraph group_experience["App Experience"]
  node_interface["Browser Interface<br/>[index.html]"]
  node_app["App Controller<br/>[app.js]"]
  node_preferences["Theme Preferences<br/>[app.js]"]
end

node_traveler(("Traveler"))
node_maps["Google Maps"]
node_formspree["Formspree"]

node_traveler -->|"uses"| node_interface
node_interface -->|"triggers controls"| node_app
node_app -->|"dispatches planning"| node_planner
node_planner -->|"finds journeys"| node_search
node_app -->|"updates estimate"| node_fare
node_app -->|"toggles theme"| node_preferences
node_app -->|"submits form"| node_contribution
node_planner -->|"renders map"| node_directions
node_directions -->|"embeds map"| node_maps
node_directions -->|"opens directions"| node_maps
node_app -->|"renders stops"| node_directory
node_app -->|"renders routes"| node_catalog
node_app -->|"locates nearby stop"| node_nearby
node_app -.->|"loads stop data"| node_stops
node_app -.->|"loads route data"| node_routes
node_contribution -.->|"may submit to"| node_formspree

click node_interface "https://github.com/steinaustgen/newtra/blob/main/index.html"
click node_app "https://github.com/steinaustgen/newtra/blob/main/app.js"
click node_stops "https://github.com/steinaustgen/newtra/blob/main/stops.csv"
click node_routes "https://github.com/steinaustgen/newtra/blob/main/routes.csv"
click node_planner "https://github.com/steinaustgen/newtra/blob/main/app.js"
click node_search "https://github.com/steinaustgen/newtra/blob/main/app.js"
click node_directions "https://github.com/steinaustgen/newtra/blob/main/app.js"
click node_directory "https://github.com/steinaustgen/newtra/blob/main/app.js"
click node_catalog "https://github.com/steinaustgen/newtra/blob/main/app.js"
click node_fare "https://github.com/steinaustgen/newtra/blob/main/app.js"
click node_nearby "https://github.com/steinaustgen/newtra/blob/main/app.js"
click node_contribution "https://github.com/steinaustgen/newtra/blob/main/app.js"
click node_preferences "https://github.com/steinaustgen/newtra/blob/main/app.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_planner,node_search,node_directions toneBlue
class node_stops,node_routes,node_directory,node_catalog toneAmber
class node_fare,node_nearby,node_contribution toneMint
class node_interface,node_app,node_preferences toneRose
class node_traveler,node_maps,node_formspree toneIndigo
```

## Components

### Journey Planning

- [Journey Planner](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`
- [Fewest-Ride Search](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`
- [Map Directions](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`

### Transit Reference

- [Stop Data](https://github.com/steinaustgen/newtra/blob/main/stops.csv): `stops.csv`
- [Route Data](https://github.com/steinaustgen/newtra/blob/main/routes.csv): `routes.csv`
- [Stop Directory](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`
- [Route Catalog](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`

### Travel Tools

- [Fare Estimator](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`
- [Nearest Stop](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`
- [Contributions](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`

### App Experience

- [Browser Interface](https://github.com/steinaustgen/newtra/blob/main/index.html): `index.html`
- [App Controller](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`
- [Theme Preferences](https://github.com/steinaustgen/newtra/blob/main/app.js): `app.js`

### Other components

- **Traveler**
- **Google Maps**
- **Formspree**

## Connections

- Traveler → Browser Interface: uses
- Browser Interface → App Controller: triggers controls (evidence: `app.js`)
- App Controller → Journey Planner: dispatches planning (evidence: `app.js`)
- Journey Planner → Fewest-Ride Search: finds journeys (evidence: `app.js`)
- App Controller → Fare Estimator: updates estimate (evidence: `app.js`)
- App Controller → Theme Preferences: toggles theme (evidence: `app.js`)
- App Controller → Contributions: submits form (evidence: `app.js`)
- Journey Planner → Map Directions: renders map (evidence: `app.js`)
- Map Directions → Google Maps: embeds map (evidence: `app.js`)
- Map Directions → Google Maps: opens directions (evidence: `app.js`)
- App Controller → Stop Directory: renders stops (evidence: `app.js`)
- App Controller → Route Catalog: renders routes (evidence: `app.js`)
- App Controller → Nearest Stop: locates nearby stop (evidence: `app.js`)
- App Controller → Stop Data: loads stop data (evidence: `app.js`)
- App Controller → Route Data: loads route data (evidence: `app.js`)
- Contributions → Formspree: may submit to (evidence: `app.js`)
