# xepes0/wloc architecture

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

- Interactive diagram: https://gitdiagram.com/xepes0/wloc
- Repository: https://github.com/xepes0/wloc

## Overview

WLOC is a community-maintained iOS network-location override tool: proxy-client modules intercept Apple’s location response and use coordinates persisted by the client. Its companion Cloudflare Worker serves a map picker, accepts shared map links for coordinate parsing, and documents client modules. The graph focuses on the web/Worker runtime and the documented interception workflow; module files are represented as a subsystem because their contents were not sampled. Relationships to those modules and external clients follow the README, not inspected module source.

Main entry points: [`worker/src/page.js`](https://github.com/xepes0/wloc/blob/main/worker/src/page.js) (Map Picker), [`worker/src/index.js`](https://github.com/xepes0/wloc/blob/main/worker/src/index.js) (HTTP Routes), [`modules`](https://github.com/xepes0/wloc/tree/main/modules) (Client Modules), [`worker/functions/[[route]].js`](https://github.com/xepes0/wloc/blob/main/worker/functions/%5B%5Broute%5D%5D.js) (Pages Adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Picker Website"]
  node_mapui["Map Picker<br/>[page.js]"]
  node_browsercoords["Browser Coordinates<br/>[gcj-browser.js]"]
  node_favorites["Saved Favorites<br/>[page.js]"]
  node_search["Place Search<br/>[page.js]"]
  node_maplinks["Map Link Input<br/>[page.js]"]
end

subgraph group_worker["Worker API"]
  node_workerentry["HTTP Routes<br/>[index.js]"]
  node_routeadapter["Pages Adapter<br/>[&#91;&#91;route&#93;&#93;.js]"]
  node_parseapi["Link Parse API<br/>[index.js]"]
  node_coordparse["Coordinate Parser<br/>[parse.js]"]
  node_coordconvert["Coordinate Conversion<br/>[parse.js]"]
  node_projectlinks["Project Links<br/>[project.js]"]
end

subgraph group_proxy["Proxy Integration"]
  node_modules["Client Modules"]
  node_mitm["HTTPS Interception"]
  node_savedcoords[("Persisted Coordinates")]
end

node_user(("Device User"))
node_proxyclient(("Proxy Client"))
node_appleloc(("Apple Location Service"))
node_nominatim(("Nominatim Search"))

node_user -->|"selects location"| node_mapui
node_mapui -->|"converts map coordinates"| node_browsercoords
node_mapui -->|"saves favorites"| node_favorites
node_mapui -->|"searches places"| node_search
node_user -->|"pastes map link"| node_maplinks
node_maplinks -->|"requests parse API"| node_workerentry
node_routeadapter -->|"dispatches requests"| node_workerentry
node_workerentry -->|"serves picker"| node_mapui
node_workerentry -->|"routes parsing"| node_parseapi
node_parseapi -->|"parses link"| node_coordparse
node_parseapi -->|"converts coordinates"| node_coordconvert
node_mapui -->|"uses project links"| node_projectlinks
node_mapui -->|"requests coordinate save"| node_appleloc
node_mapui -->|"searches places"| node_nominatim
node_user -->|"configures client"| node_proxyclient
node_proxyclient -->|"loads module"| node_modules
node_modules -->|"enables interception"| node_mitm
node_appleloc -->|"location response"| node_mitm
node_mitm -->|"intercepts request"| node_modules
node_modules -->|"persists coordinates"| node_savedcoords
node_mapui -->|"reads or clears data"| node_savedcoords
node_proxyclient -->|"forwards location request"| node_appleloc

click node_mapui "https://github.com/xepes0/wloc/blob/main/worker/src/page.js"
click node_browsercoords "https://github.com/xepes0/wloc/blob/main/worker/src/gcj-browser.js"
click node_favorites "https://github.com/xepes0/wloc/blob/main/worker/src/page.js"
click node_search "https://github.com/xepes0/wloc/blob/main/worker/src/page.js"
click node_maplinks "https://github.com/xepes0/wloc/blob/main/worker/src/page.js"
click node_workerentry "https://github.com/xepes0/wloc/blob/main/worker/src/index.js"
click node_routeadapter "https://github.com/xepes0/wloc/blob/main/worker/functions/%5B%5Broute%5D%5D.js"
click node_parseapi "https://github.com/xepes0/wloc/blob/main/worker/src/index.js"
click node_coordparse "https://github.com/xepes0/wloc/blob/main/worker/src/parse.js"
click node_coordconvert "https://github.com/xepes0/wloc/blob/main/worker/src/parse.js"
click node_projectlinks "https://github.com/xepes0/wloc/blob/main/worker/src/project.js"
click node_modules "https://github.com/xepes0/wloc/tree/main/modules"
click node_mitm "https://github.com/xepes0/wloc/tree/main/modules"
click node_savedcoords "https://github.com/xepes0/wloc/tree/main/modules"

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_mapui,node_browsercoords,node_favorites,node_search,node_maplinks,node_user,node_proxyclient toneBlue
class node_workerentry,node_routeadapter,node_parseapi,node_coordparse,node_coordconvert,node_projectlinks toneAmber
class node_modules,node_mitm,node_savedcoords toneMint
class node_appleloc,node_nominatim toneIndigo
```

## Components

### Picker Website

- [Map Picker](https://github.com/xepes0/wloc/blob/main/worker/src/page.js): `worker/src/page.js`
- [Browser Coordinates](https://github.com/xepes0/wloc/blob/main/worker/src/gcj-browser.js): `worker/src/gcj-browser.js`
- [Saved Favorites](https://github.com/xepes0/wloc/blob/main/worker/src/page.js): `worker/src/page.js`
- [Place Search](https://github.com/xepes0/wloc/blob/main/worker/src/page.js): `worker/src/page.js`
- [Map Link Input](https://github.com/xepes0/wloc/blob/main/worker/src/page.js): `worker/src/page.js`

### Worker API

- [HTTP Routes](https://github.com/xepes0/wloc/blob/main/worker/src/index.js): `worker/src/index.js`
- [Pages Adapter](https://github.com/xepes0/wloc/blob/main/worker/functions/%5B%5Broute%5D%5D.js): `worker/functions/[[route]].js`
- [Link Parse API](https://github.com/xepes0/wloc/blob/main/worker/src/index.js): `worker/src/index.js`
- [Coordinate Parser](https://github.com/xepes0/wloc/blob/main/worker/src/parse.js): `worker/src/parse.js`
- [Coordinate Conversion](https://github.com/xepes0/wloc/blob/main/worker/src/parse.js): `worker/src/parse.js`
- [Project Links](https://github.com/xepes0/wloc/blob/main/worker/src/project.js): `worker/src/project.js`

### Proxy Integration

- [Client Modules](https://github.com/xepes0/wloc/tree/main/modules): `modules`
- [HTTPS Interception](https://github.com/xepes0/wloc/tree/main/modules): `modules`
- [Persisted Coordinates](https://github.com/xepes0/wloc/tree/main/modules): `modules`

### Other components

- **Device User**
- **Proxy Client**
- **Apple Location Service**
- **Nominatim Search**

## Connections

- Device User → Map Picker: selects location (evidence: `README.md`)
- Map Picker → Browser Coordinates: converts map coordinates (evidence: `worker/src/page.js`)
- Map Picker → Saved Favorites: saves favorites (evidence: `worker/src/page.js`)
- Map Picker → Place Search: searches places (evidence: `worker/src/page.js`)
- Device User → Map Link Input: pastes map link (evidence: `README.md`)
- Map Link Input → HTTP Routes: requests parse API (evidence: `worker/src/page.js`)
- Pages Adapter → HTTP Routes: dispatches requests (evidence: `worker/functions/[[route]].js`)
- HTTP Routes → Map Picker: serves picker (evidence: `worker/src/index.js`)
- HTTP Routes → Link Parse API: routes parsing (evidence: `worker/src/index.js`)
- Link Parse API → Coordinate Parser: parses link (evidence: `worker/src/index.js`)
- Link Parse API → Coordinate Conversion: converts coordinates (evidence: `worker/src/index.js`)
- Map Picker → Project Links: uses project links (evidence: `worker/src/page.js`)
- Map Picker → Apple Location Service: requests coordinate save (evidence: `worker/src/page.js`)
- Map Picker → Nominatim Search: searches places (evidence: `worker/src/page.js`)
- Device User → Proxy Client: configures client (evidence: `README.md`)
- Proxy Client → Client Modules: loads module (evidence: `README.md`)
- Client Modules → HTTPS Interception: enables interception (evidence: `README.md`)
- Apple Location Service → HTTPS Interception: location response (evidence: `README.md`)
- HTTPS Interception → Client Modules: intercepts request (evidence: `README.md`)
- Client Modules → Persisted Coordinates: persists coordinates (evidence: `README.md`)
- Map Picker → Persisted Coordinates: reads or clears data (evidence: `README.md`)
- Proxy Client → Apple Location Service: forwards location request (evidence: `README.md`)
