# agniv-dutta/beyond-the-crease architecture

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

- Interactive diagram: https://gitdiagram.com/agniv-dutta/beyond-the-crease
- Repository: https://github.com/agniv-dutta/beyond-the-crease

## Overview

Beyond the Crease is a browser-only sports visibility and fan-engagement prototype. Visitors browse match and athlete coverage into stories; the Studio generates and fairness-checks drafts before publishing, while Parity visualizes illustrative visibility data and Circles support moderated fan interaction. The app exposes these capabilities through routed pages backed by a typed resolver API, fictional datasets, local state, and an in-browser webhook bus. README documents major features whose page implementations were not sampled; those nodes are retained, but unsampled internal call paths are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/App.tsx) (Route shell), [`src/api/client.ts`](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/api/client.ts) (API client), [`src/pages/StudioPage.tsx`](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/StudioPage.tsx) (Story Studio), [`src/webhooks/bus.ts`](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/webhooks/bus.ts) (Event bus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Fan experience"]
  node_home["Story feed<br/>[HomePage.tsx]"]
  node_live["Live matches<br/>[LivePage.tsx]"]
  node_match["Match detail<br/>[MatchPage.tsx]"]
  node_athletes["Athlete discovery<br/>[AthletesPage.tsx]"]
  node_athlete["Athlete profile<br/>[AthletePage.tsx]"]
  node_circles["Fan circles<br/>[CirclesPage.tsx]"]
  node_circle["Circle chat<br/>[CirclePage.tsx]"]
end

subgraph group_editorial["Storytelling"]
  node_story["Story reader<br/>[StoryPage.tsx]"]
  node_studio["Story Studio<br/>[StudioPage.tsx]"]
  node_generator["Draft generator<br/>[storyEngine.ts]"]
  node_fairness["Fairness scoring<br/>[fairness.ts]"]
  node_sharecard["Share card<br/>[ShareCardModal.tsx]"]
end

subgraph group_insight["Visibility insight"]
  node_parity["Parity tracker<br/>[ParityPage.tsx]"]
  node_visibility["Visibility data<br/>[visibility.ts]"]
end

subgraph group_platform["App platform"]
  node_app["Route shell<br/>[App.tsx]"]
  node_access["Access settings<br/>[AccessPage.tsx]"]
  node_api["API client<br/>[client.ts]"]
  node_resolvers["API resolvers<br/>[resolvers.ts]"]
  node_feedhook["Feed hook<br/>[useFeed.ts]"]
  node_async["Async state<br/>[useAsync.ts]"]
  node_datasets["Demo datasets<br/>[athletes.ts]"]
  node_selectors["Data selectors<br/>[selectors.ts]"]
  node_i18n["Translations<br/>[resources.ts]"]
end

subgraph group_state["Local services"]
  node_prefs["User preferences<br/>[prefs.ts]"]
  node_gamification["Fan rewards<br/>[gamification.ts]"]
  node_webhooks["Event bus<br/>[bus.ts]"]
  node_safety["Safety state<br/>[safety.ts]"]
end

node_visitor(("Fan"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_live
node_app -->|"routes to"| node_match
node_app -->|"routes to"| node_story
node_app -->|"routes to"| node_athletes
node_app -->|"routes to"| node_athlete
node_app -->|"routes to"| node_studio
node_app -->|"routes to"| node_parity
node_app -->|"routes to"| node_circles
node_app -->|"routes to"| node_circle
node_app -->|"routes to"| node_access
node_home -.->|"loads feed"| node_feedhook
node_feedhook -->|"requests"| node_api
node_feedhook -->|"uses"| node_async
node_async -.->|"runs fetcher"| node_api
node_api -->|"fallback calls"| node_resolvers
node_resolvers -->|"queries"| node_selectors
node_resolvers -->|"reads"| node_datasets
node_resolvers -->|"dispatches"| node_generator
node_selectors -->|"selects from"| node_datasets
node_studio -->|"requests"| node_api
node_studio -->|"generates drafts"| node_generator
node_generator -->|"scores copy"| node_fairness
node_studio -->|"checks and fixes"| node_fairness
node_studio -->|"opens"| node_sharecard
node_studio -->|"publishes event"| node_webhooks
node_circle -->|"requests"| node_api
node_circle -->|"emits message"| node_webhooks
node_circle -->|"uses moderation"| node_safety
node_athlete -->|"loads profile"| node_api
node_athlete -->|"emits alerts"| node_webhooks
node_athlete -->|"updates rewards"| node_gamification
node_access -->|"updates settings"| node_prefs
node_access -->|"reads and updates"| node_safety
node_prefs -->|"sets language"| node_i18n
node_gamification -->|"emits milestones"| node_webhooks
node_parity -.->|"visualizes"| node_visibility
node_match -.->|"loads match"| node_api
node_live -.->|"simulates events"| node_webhooks
node_story -.->|"loads story"| node_api
node_circles -.->|"loads rooms"| node_api

click node_app "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/App.tsx"
click node_home "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/HomePage.tsx"
click node_live "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/LivePage.tsx"
click node_match "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/MatchPage.tsx"
click node_athletes "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/AthletesPage.tsx"
click node_athlete "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/AthletePage.tsx"
click node_circles "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/CirclesPage.tsx"
click node_circle "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/CirclePage.tsx"
click node_story "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/StoryPage.tsx"
click node_studio "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/StudioPage.tsx"
click node_generator "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/api/storyEngine.ts"
click node_fairness "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/utils/fairness.ts"
click node_sharecard "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/components/story/ShareCardModal.tsx"
click node_parity "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/ParityPage.tsx"
click node_access "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/AccessPage.tsx"
click node_api "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/api/client.ts"
click node_resolvers "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/api/resolvers.ts"
click node_feedhook "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/hooks/useFeed.ts"
click node_async "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/hooks/useAsync.ts"
click node_datasets "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/data/athletes.ts"
click node_selectors "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/data/selectors.ts"
click node_prefs "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/store/prefs.ts"
click node_gamification "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/store/gamification.ts"
click node_webhooks "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/webhooks/bus.ts"
click node_i18n "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/i18n/resources.ts"
click node_visibility "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/data/visibility.ts"
click node_safety "https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/store/safety.ts"

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_home,node_live,node_match,node_athletes,node_athlete,node_circles,node_circle toneBlue
class node_story,node_studio,node_generator,node_fairness,node_sharecard toneAmber
class node_parity,node_visibility toneMint
class node_app,node_access,node_api,node_resolvers,node_feedhook,node_async,node_datasets,node_selectors,node_i18n toneRose
class node_prefs,node_gamification,node_webhooks,node_safety,node_visitor toneIndigo
```

## Components

### Fan experience

- [Story feed](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/HomePage.tsx): `src/pages/HomePage.tsx`
- [Live matches](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/LivePage.tsx): `src/pages/LivePage.tsx`
- [Match detail](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/MatchPage.tsx): `src/pages/MatchPage.tsx`
- [Athlete discovery](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/AthletesPage.tsx): `src/pages/AthletesPage.tsx`
- [Athlete profile](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/AthletePage.tsx): `src/pages/AthletePage.tsx`
- [Fan circles](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/CirclesPage.tsx): `src/pages/CirclesPage.tsx`
- [Circle chat](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/CirclePage.tsx): `src/pages/CirclePage.tsx`

### Storytelling

- [Story reader](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/StoryPage.tsx): `src/pages/StoryPage.tsx`
- [Story Studio](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/StudioPage.tsx): `src/pages/StudioPage.tsx`
- [Draft generator](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/api/storyEngine.ts): `src/api/storyEngine.ts`
- [Fairness scoring](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/utils/fairness.ts): `src/utils/fairness.ts`
- [Share card](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/components/story/ShareCardModal.tsx): `src/components/story/ShareCardModal.tsx`

### Visibility insight

- [Parity tracker](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/ParityPage.tsx): `src/pages/ParityPage.tsx`
- [Visibility data](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/data/visibility.ts): `src/data/visibility.ts`

### App platform

- [Route shell](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/App.tsx): `src/App.tsx`
- [Access settings](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/pages/AccessPage.tsx): `src/pages/AccessPage.tsx`
- [API client](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/api/client.ts): `src/api/client.ts`
- [API resolvers](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/api/resolvers.ts): `src/api/resolvers.ts`
- [Feed hook](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/hooks/useFeed.ts): `src/hooks/useFeed.ts`
- [Async state](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/hooks/useAsync.ts): `src/hooks/useAsync.ts`
- [Demo datasets](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/data/athletes.ts): `src/data/athletes.ts`
- [Data selectors](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/data/selectors.ts): `src/data/selectors.ts`
- [Translations](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/i18n/resources.ts): `src/i18n/resources.ts`

### Local services

- [User preferences](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/store/prefs.ts): `src/store/prefs.ts`
- [Fan rewards](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/store/gamification.ts): `src/store/gamification.ts`
- [Event bus](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/webhooks/bus.ts): `src/webhooks/bus.ts`
- [Safety state](https://github.com/agniv-dutta/beyond-the-crease/blob/main/src/store/safety.ts): `src/store/safety.ts`

### Other components

- **Fan**

## Connections

- Fan → Route shell: opens (evidence: `src/App.tsx`)
- Route shell → Story feed: routes to (evidence: `src/App.tsx`)
- Route shell → Live matches: routes to (evidence: `src/App.tsx`)
- Route shell → Match detail: routes to (evidence: `src/App.tsx`)
- Route shell → Story reader: routes to (evidence: `src/App.tsx`)
- Route shell → Athlete discovery: routes to (evidence: `src/App.tsx`)
- Route shell → Athlete profile: routes to (evidence: `src/App.tsx`)
- Route shell → Story Studio: routes to (evidence: `src/App.tsx`)
- Route shell → Parity tracker: routes to (evidence: `src/App.tsx`)
- Route shell → Fan circles: routes to (evidence: `src/App.tsx`)
- Route shell → Circle chat: routes to (evidence: `src/App.tsx`)
- Route shell → Access settings: routes to (evidence: `src/App.tsx`)
- Story feed → Feed hook: loads feed
- Feed hook → API client: requests (evidence: `src/hooks/useFeed.ts`)
- Feed hook → Async state: uses (evidence: `src/hooks/useFeed.ts`)
- Async state → API client: runs fetcher
- API client → API resolvers: fallback calls (evidence: `src/api/client.ts`)
- API resolvers → Data selectors: queries (evidence: `src/api/resolvers.ts`)
- API resolvers → Demo datasets: reads (evidence: `src/api/resolvers.ts`)
- API resolvers → Draft generator: dispatches (evidence: `src/api/resolvers.ts`)
- Data selectors → Demo datasets: selects from (evidence: `src/data/selectors.ts`)
- Story Studio → API client: requests (evidence: `src/pages/StudioPage.tsx`)
- Story Studio → Draft generator: generates drafts (evidence: `src/api/storyEngine.ts`)
- Draft generator → Fairness scoring: scores copy (evidence: `src/api/storyEngine.ts`)
- Story Studio → Fairness scoring: checks and fixes (evidence: `src/pages/StudioPage.tsx`)
- Story Studio → Share card: opens (evidence: `src/pages/StudioPage.tsx`)
- Story Studio → Event bus: publishes event (evidence: `src/pages/StudioPage.tsx`)
- Circle chat → API client: requests (evidence: `src/pages/CirclePage.tsx`)
- Circle chat → Event bus: emits message (evidence: `src/pages/CirclePage.tsx`)
- Circle chat → Safety state: uses moderation (evidence: `src/pages/CirclePage.tsx`)
- Athlete profile → API client: loads profile (evidence: `src/pages/AthletePage.tsx`)
- Athlete profile → Event bus: emits alerts (evidence: `src/pages/AthletePage.tsx`)
- Athlete profile → Fan rewards: updates rewards (evidence: `src/pages/AthletePage.tsx`)
- Access settings → User preferences: updates settings (evidence: `src/pages/AccessPage.tsx`)
- Access settings → Safety state: reads and updates (evidence: `src/pages/AccessPage.tsx`)
- User preferences → Translations: sets language (evidence: `src/store/prefs.ts`)
- Fan rewards → Event bus: emits milestones (evidence: `src/store/gamification.ts`)
- Parity tracker → Visibility data: visualizes
- Match detail → API client: loads match
- Live matches → Event bus: simulates events
- Story reader → API client: loads story
- Fan circles → API client: loads rooms
