# yacsch/estacionesserviciowpa architecture

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

- Interactive diagram: https://gitdiagram.com/yacsch/estacionesserviciowpa
- Repository: https://github.com/yacsch/estacionesserviciowpa

## Overview

This is a Chilean fuel-station finder and price-comparison web app. The main journey loads official CNE station data through a server-side proxy, then lets users locate stations, filter by distance and fuel, compare prices, view a map, and open directions or share a station. The graph includes the sampled runtime flow and documented-in-code proxy behavior; other UI capabilities are included where supported by the tree and excerpts. Unsampled relationships are omitted rather than inferred.

Main entry points: [`src/components/Views/HomeList.jsx`](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Views/HomeList.jsx) (Station discovery), [`src/pages/Home.jsx`](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/pages/Home.jsx) (Home page), [`src/components/StationCard/index.jsx`](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/StationCard/index.jsx) (Station details), [`src/components/Header/index.jsx`](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Header/index.jsx) (Header and controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_header["Header and controls<br/>[index.jsx]"]
  node_main["Main view<br/>[index.jsx]"]
  node_footer["Footer<br/>[index.jsx]"]
end

subgraph group_discovery["Station discovery"]
  node_home_list["Station discovery<br/>[HomeList.jsx]"]
  node_station_card["Station details<br/>[index.jsx]"]
  node_map["Station map<br/>[index.jsx]"]
  node_station_logic["Station utilities<br/>[stations.js]"]
  node_brand_logos["Brand logos<br/>[brandLogos.js]"]
end

subgraph group_data["CNE data access"]
  node_api_client["Station API client<br/>[getData.js]"]
  node_api_route["Stations endpoint<br/>[estaciones.js]"]
  node_proxy["CNE proxy<br/>[_cne.js]"]
end

subgraph group_support["User preferences"]
  node_storage[("Local preferences<br/>[storage.js]")]
  node_theme["Theme toggle<br/>[index.jsx]"]
  node_install["Install prompt<br/>[index.jsx]"]
end

node_visitor(("Driver"))
node_browser_location(("Browser geolocation"))
node_mapping_service(("Map tiles and directions"))
node_cne_api(("CNE API"))
node_browser_share(("Browser share and clipboard"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_home -->|"loads stations"| node_api_client
node_api_client -->|"requests"| node_api_route
node_api_route -->|"delegates to"| node_proxy
node_proxy -->|"authenticates and fetches"| node_cne_api
node_home -->|"renders"| node_header
node_home -->|"renders"| node_main
node_home -->|"renders"| node_footer
node_main -->|"renders"| node_home_list
node_home_list -->|"calculates and filters"| node_station_logic
node_home_list -->|"reads and saves location and filters"| node_storage
node_home_list -->|"requests position"| node_browser_location
node_home_list -->|"renders stations"| node_map
node_home_list -->|"renders results"| node_station_card
node_station_card -->|"formats station data"| node_station_logic
node_station_card -->|"gets logo"| node_brand_logos
node_station_card -->|"shares or copies"| node_browser_share
node_map -->|"formats map data"| node_station_logic
node_map -->|"loads tiles and directions"| node_mapping_service
node_header -->|"renders"| node_theme
node_header -->|"renders"| node_install
node_theme -->|"reads and writes theme"| node_storage

click node_app "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/App.jsx"
click node_home "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/pages/Home.jsx"
click node_header "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Header/index.jsx"
click node_main "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Main/index.jsx"
click node_footer "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Footer/index.jsx"
click node_home_list "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Views/HomeList.jsx"
click node_station_card "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/StationCard/index.jsx"
click node_map "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Maps/index.jsx"
click node_station_logic "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/utils/stations.js"
click node_brand_logos "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/utils/brandLogos.js"
click node_api_client "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/api/getData.js"
click node_api_route "https://github.com/yacsch/estacionesserviciowpa/blob/main/api/estaciones.js"
click node_proxy "https://github.com/yacsch/estacionesserviciowpa/blob/main/api/_cne.js"
click node_storage "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/utils/storage.js"
click node_theme "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/ThemeToggle/index.jsx"
click node_install "https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/InstallPrompt/index.jsx"

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_app,node_home,node_header,node_main,node_footer,node_browser_location,node_browser_share toneBlue
class node_home_list,node_station_card,node_map,node_station_logic,node_brand_logos toneAmber
class node_api_client,node_api_route,node_proxy,node_cne_api toneMint
class node_storage,node_theme,node_install toneRose
class node_visitor,node_mapping_service toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/App.jsx): `src/App.jsx`
- [Home page](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Header and controls](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Header/index.jsx): `src/components/Header/index.jsx`
- [Main view](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Main/index.jsx): `src/components/Main/index.jsx`
- [Footer](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Footer/index.jsx): `src/components/Footer/index.jsx`

### Station discovery

- [Station discovery](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Views/HomeList.jsx): `src/components/Views/HomeList.jsx`
- [Station details](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/StationCard/index.jsx): `src/components/StationCard/index.jsx`
- [Station map](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/Maps/index.jsx): `src/components/Maps/index.jsx`
- [Station utilities](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/utils/stations.js): `src/utils/stations.js`
- [Brand logos](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/utils/brandLogos.js): `src/utils/brandLogos.js`

### CNE data access

- [Station API client](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/api/getData.js): `src/api/getData.js`
- [Stations endpoint](https://github.com/yacsch/estacionesserviciowpa/blob/main/api/estaciones.js): `api/estaciones.js`
- [CNE proxy](https://github.com/yacsch/estacionesserviciowpa/blob/main/api/_cne.js): `api/_cne.js`

### User preferences

- [Local preferences](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/utils/storage.js): `src/utils/storage.js`
- [Theme toggle](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/ThemeToggle/index.jsx): `src/components/ThemeToggle/index.jsx`
- [Install prompt](https://github.com/yacsch/estacionesserviciowpa/blob/main/src/components/InstallPrompt/index.jsx): `src/components/InstallPrompt/index.jsx`

### Other components

- **Driver**
- **Browser geolocation**
- **Map tiles and directions**
- **CNE API**
- **Browser share and clipboard**

## Connections

- Driver → App routing: opens
- App routing → Home page: routes to (evidence: `src/App.jsx`)
- Home page → Station API client: loads stations (evidence: `src/pages/Home.jsx`)
- Station API client → Stations endpoint: requests (evidence: `src/api/getData.js`)
- Stations endpoint → CNE proxy: delegates to (evidence: `api/estaciones.js`)
- CNE proxy → CNE API: authenticates and fetches (evidence: `api/_cne.js`)
- Home page → Header and controls: renders (evidence: `src/pages/Home.jsx`)
- Home page → Main view: renders (evidence: `src/pages/Home.jsx`)
- Home page → Footer: renders (evidence: `src/pages/Home.jsx`)
- Main view → Station discovery: renders (evidence: `src/components/Main/index.jsx`)
- Station discovery → Station utilities: calculates and filters (evidence: `src/components/Views/HomeList.jsx`)
- Station discovery → Local preferences: reads and saves location and filters (evidence: `src/components/Views/HomeList.jsx`)
- Station discovery → Browser geolocation: requests position
- Station discovery → Station map: renders stations (evidence: `src/components/Views/HomeList.jsx`)
- Station discovery → Station details: renders results (evidence: `src/components/Views/HomeList.jsx`)
- Station details → Station utilities: formats station data (evidence: `src/components/StationCard/index.jsx`)
- Station details → Brand logos: gets logo (evidence: `src/components/StationCard/index.jsx`)
- Station details → Browser share and clipboard: shares or copies
- Station map → Station utilities: formats map data (evidence: `src/components/Maps/index.jsx`)
- Station map → Map tiles and directions: loads tiles and directions (evidence: `src/components/Maps/index.jsx`)
- Header and controls → Theme toggle: renders (evidence: `src/components/Header/index.jsx`)
- Header and controls → Install prompt: renders (evidence: `src/components/Header/index.jsx`)
- Theme toggle → Local preferences: reads and writes theme (evidence: `src/components/ThemeToggle/index.jsx`)
