# casaturf/carr--magique-turf architecture

> Architecture diagram of the GitHub repository casaturf/carr--magique-turf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/casaturf/carr--magique-turf
- Repository: https://github.com/casaturf/carr--magique-turf

## Overview

This repository combines dated horse-racing content pages with a Cloudflare Worker for the Carré Magique Turf Premium access-code service and its embedded subscription/admin interface. Visitors browse race content or use the premium interface to verify access; administrators generate, list, revoke, and reset codes. The worker excerpt directly shows KV operations and browser requests for code management and exchange rates. The tree identifies the content page families, but their links and page behavior were not sampled, so those relationships are not asserted.

Main entry points: [`worker_v2.js`](https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js) (Premium interface), [`2026-02-16/index.html`](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/index.html) (Daily index), [`2026-02-16/course_R1C1.html`](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/course_R1C1.html) (Race courses), [`2026-02-16/formules_R1C1.html`](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/formules_R1C1.html) (Race formulas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Race content"]
  node_daily_index["Daily index<br/>[index.html]"]
  node_race_course["Race courses<br/>[course_R1C1.html]"]
  node_race_formulas["Race formulas<br/>[formules_R1C1.html]"]
  node_participants["Participants"]
  node_reducer["Race reducer"]
  node_meeting["Meeting pages<br/>[reunion_R1.html]"]
  node_daily_summary["Daily summary"]
end

subgraph group_premium["Premium access"]
  node_premium_ui["Premium interface<br/>[worker_v2.js]"]
  node_code_verify["Code verification<br/>[worker_v2.js]"]
  node_rate_lookup["Exchange rates<br/>[worker_v2.js]"]
end

subgraph group_admin["Subscription administration"]
  node_admin_generate["Generate codes<br/>[worker_v2.js]"]
  node_admin_list["List subscriptions<br/>[worker_v2.js]"]
  node_admin_revoke["Revoke codes<br/>[worker_v2.js]"]
  node_admin_reset["Reset devices<br/>[worker_v2.js]"]
end

subgraph group_state["Persistent state"]
  node_kv[("Cloudflare KV")]
end

node_visitor(("Visitor"))
node_administrator(("Administrator"))

node_visitor -.->|"browses"| node_daily_index
node_visitor -.->|"browses"| node_race_course
node_visitor -.->|"browses"| node_race_formulas
node_visitor -.->|"browses"| node_participants
node_visitor -.->|"browses"| node_reducer
node_visitor -.->|"browses"| node_meeting
node_visitor -.->|"browses"| node_daily_summary
node_visitor -.->|"uses"| node_premium_ui
node_administrator -.->|"uses"| node_premium_ui
node_premium_ui -->|"requests verification"| node_code_verify
node_premium_ui -->|"requests rates"| node_rate_lookup
node_premium_ui -->|"requests generation"| node_admin_generate
node_premium_ui -.->|"requests listing"| node_admin_list
node_premium_ui -->|"requests revocation"| node_admin_revoke
node_admin_generate -->|"writes codes"| node_kv
node_admin_list -->|"reads codes"| node_kv
node_admin_reset -->|"updates devices"| node_kv
node_admin_revoke -.->|"updates codes"| node_kv

click node_daily_index "https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/index.html"
click node_race_course "https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/course_R1C1.html"
click node_race_formulas "https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/formules_R1C1.html"
click node_participants "https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/participants_R1C1.html"
click node_reducer "https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/reducteur_R1C1.html"
click node_meeting "https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/reunion_R1.html"
click node_daily_summary "https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/bilan_2026-02-16.html"
click node_premium_ui "https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js"
click node_code_verify "https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js"
click node_rate_lookup "https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js"
click node_admin_generate "https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js"
click node_admin_list "https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js"
click node_admin_revoke "https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js"
click node_admin_reset "https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.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_daily_index,node_race_course,node_race_formulas,node_participants,node_reducer,node_meeting,node_daily_summary toneBlue
class node_premium_ui,node_code_verify,node_rate_lookup toneAmber
class node_admin_generate,node_admin_list,node_admin_revoke,node_admin_reset toneMint
class node_kv toneRose
class node_visitor,node_administrator toneIndigo
```

## Components

### Race content

- [Daily index](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/index.html): `2026-02-16/index.html`
- [Race courses](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/course_R1C1.html): `2026-02-16/course_R1C1.html`
- [Race formulas](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/formules_R1C1.html): `2026-02-16/formules_R1C1.html`
- [Participants](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/participants_R1C1.html): `2026-02-16/participants_R1C1.html`
- [Race reducer](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/reducteur_R1C1.html): `2026-02-16/reducteur_R1C1.html`
- [Meeting pages](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/reunion_R1.html): `2026-02-16/reunion_R1.html`
- [Daily summary](https://github.com/casaturf/carr--magique-turf/blob/main/2026-02-16/bilan_2026-02-16.html): `2026-02-16/bilan_2026-02-16.html`

### Premium access

- [Premium interface](https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js): `worker_v2.js`
- [Code verification](https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js): `worker_v2.js`
- [Exchange rates](https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js): `worker_v2.js`

### Subscription administration

- [Generate codes](https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js): `worker_v2.js`
- [List subscriptions](https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js): `worker_v2.js`
- [Revoke codes](https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js): `worker_v2.js`
- [Reset devices](https://github.com/casaturf/carr--magique-turf/blob/main/worker_v2.js): `worker_v2.js`

### Persistent state

- **Cloudflare KV**

### Other components

- **Visitor**
- **Administrator**

## Connections

- Visitor → Daily index: browses
- Visitor → Race courses: browses
- Visitor → Race formulas: browses
- Visitor → Participants: browses
- Visitor → Race reducer: browses
- Visitor → Meeting pages: browses
- Visitor → Daily summary: browses
- Visitor → Premium interface: uses
- Administrator → Premium interface: uses
- Premium interface → Code verification: requests verification (evidence: `worker_v2.js`)
- Premium interface → Exchange rates: requests rates (evidence: `worker_v2.js`)
- Premium interface → Generate codes: requests generation (evidence: `worker_v2.js`)
- Premium interface → List subscriptions: requests listing (evidence: `worker_v2.js`)
- Premium interface → Revoke codes: requests revocation (evidence: `worker_v2.js`)
- Generate codes → Cloudflare KV: writes codes (evidence: `worker_v2.js`)
- List subscriptions → Cloudflare KV: reads codes (evidence: `worker_v2.js`)
- Reset devices → Cloudflare KV: updates devices (evidence: `worker_v2.js`)
- Revoke codes → Cloudflare KV: updates codes
