How didouougha/tariki works
1. Project shape
This repository is a static front-end application with a small set of ES module scripts and a build-time CSS pipeline. The app is centered around a single index.html entry point and is meant to run in the browser, then be deployed as static assets on Cloudflare Pages.
2. Entry point and UI composition
index.html is the shell that wires the whole experience together: page layout, map container, alert areas, and script/style inclusion. There is no server-rendered backend in this repo; all dynamic behavior happens client-side.
3. Styling subsystem
Styling is split between:
- src/input.css as the Tailwind v4 source/input file
- assets/css/style.css as the generated output consumed by the page
This indicates a build step that compiles utility-first CSS into a browser-ready stylesheet, reducing runtime styling complexity.
4. JavaScript module boundaries
The front-end logic is intentionally separated into small modules under assets/js/:
- main.js is the application bootstrap/orchestration layer
- ui.js handles DOM updates and interface state
- map.js owns map initialization and map-specific rendering
- api.js is the data-access layer for fetching external content
This is the main architectural boundary in the repo: presentation, map behavior, and remote-data access are decoupled.
5. Map subsystem
map.js is the dedicated mapping layer. Per the README, it uses Leaflet.js with OpenStreetMap tiles and custom marker/icon rendering for traffic-related conditions such as accidents, roadworks, and weather events. This subsystem is likely responsible for translating data records into map overlays and marker state.
6. Live alerts / external data subsystem
api.js is the boundary to external live content. The README says the app fetches updates from the official Facebook page via a Cloudflare Worker that acts as an RSS-to-JSON proxy and CORS-safe endpoint. In architecture terms, the browser never talks directly to the source feed; it consumes a normalized API provided by the worker.
7. Data flow through the app
The runtime flow is:
external traffic/news source → Cloudflare Worker proxy → api.js fetches JSON → main.js coordinates updates → ui.js renders alerts/news ticker and sidebar → map.js updates map markers/overlays.
This is the key end-to-end pipeline to capture in an architecture diagram.
8. Client-side orchestration
main.js appears to be the integration point that ties together the other modules after page load. It likely initializes the map, triggers data fetches, and schedules UI refreshes or periodic updates. This makes it the central runtime coordinator, but not a data or rendering layer itself.
9. Browser/runtime constraints
The project relies on ES6 modules, which is why the README notes running it through a local server rather than opening files directly. The app is therefore browser-native and static, but still depends on HTTP delivery for module loading.
10. Build and packaging boundary
package.json and package-lock.json define the Node-based tooling used only for development/building, not for runtime serving logic. The main build artifact of interest is the compiled CSS in assets/css/style.css; the rest of the site is shipped as static HTML, JS, and assets.
11. Infrastructure boundary
The only backend-like component is external to this repo: Cloudflare Workers. That worker exists to normalize third-party data and avoid CORS issues. Cloudflare Pages serves the front-end, but there is no in-repo application server or database.
12. What to show in an architecture diagram
A clear diagram would have:
- Browser/client as the main runtime
- Static assets originating from this repo
- A CSS build pipeline feeding assets/css/style.css
- A modular JS layer with main.js coordinating ui.js, map.js, and api.js
- An external worker/API boundary for live alerts
- Leaflet/OpenStreetMap as the map rendering dependency
- Cloudflare Pages as the static hosting target
Main entry points: main.js main.js · map.js map.js · index.html index.html · api.js api.js
Components 12
Browser app
Client-side runtime and UI composition.
- main.js · Bootstraps the app and coordinates data, UI, and map updates.
assets/js/main.js - ui.js · Updates alerts, sidebar state, and other DOM-facing interface pieces.
assets/js/ui.js - map.js · Initializes Leaflet map behavior and renders markers/overlays.
assets/js/map.js - api.js · Fetches normalized live content from the external proxy endpoint.
assets/js/api.js
Repo assets
Static HTML, styles, and browser modules shipped from the repository.
- index.html · Single-page document that wires layout, styles, and scripts.
index.html - style.css · Browser-ready stylesheet generated from the Tailwind source.
assets/css/style.css
Build toolchain
Node-based styling pipeline and packaging support.
- input.css · Authoring source for the CSS build pipeline.
src/input.css - package.json · Defines Node-based development and build tooling.
package.json
External services
Hosting, mapping, and live-data dependencies outside the repo.
- Leaflet · Client-side map rendering dependency used by the map subsystem.
- OpenStreetMap · Map tile source consumed by the Leaflet map.
- Worker API · External RSS-to-JSON proxy that normalizes live alerts and avoids CORS issues.
- Pages · Deployment target for the static front-end assets.
Connections 14
- index.html → style.css: loads · The HTML shell includes the compiled stylesheet.
- index.html → main.js: boots · The entry page loads the application bootstrap module.
- main.js → ui.js: coordinates · Main orchestrates interface updates through the UI module.
- main.js → map.js: coordinates · Main initializes and refreshes the mapping subsystem.
- main.js → api.js: fetches · Main triggers data retrieval through the API client.
- api.js → Worker API: requests · Browser code consumes the normalized external endpoint.
- Worker API → OpenStreetMap: normalizes data · External worker proxies live source information into app-ready JSON.
- map.js → Leaflet: uses · Map behavior is implemented on top of Leaflet.
- map.js → OpenStreetMap: tiles · Leaflet map renders against OpenStreetMap tiles.
- main.js → ui.js: renders alerts · Main drives alert and ticker refreshes through UI rendering.
- main.js → map.js: updates markers · Main passes new live data into map overlays and marker state.
- input.css → style.css: builds into · Tailwind source is compiled into the browser-ready stylesheet.
- package.json → input.css: builds · Project tooling manages the CSS build pipeline.
- Pages → index.html: hosts · Static site hosting serves the repository's browser assets.