# xkyota/bettermykoob architecture

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

- Interactive diagram: https://gitdiagram.com/xkyota/bettermykoob
- Repository: https://github.com/xkyota/bettermykoob

## Overview

BetterMykoob is a Chrome extension that reshapes the existing Mykoob page into a responsive interface while leaving Mykoob responsible for accounts, school data, and actions. The workflow is: the content script preserves the original page, reads it through a DOM adapter, and renders the React app; the app presents Home, Diary, and Grades views and can invoke supported original-page controls. The README also documents access to pages without a dedicated redesign through the original content. Evidence is limited to the supplied excerpts and README; unsampled UI behavior is represented only where documented.

Main entry points: [`src/components/App.tsx`](https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx) (React app), [`src/mykoob/domAdapter.ts`](https://github.com/xkyota/bettermykoob/blob/main/src/mykoob/domAdapter.ts) (DOM adapter), [`src/content/main.tsx`](https://github.com/xkyota/bettermykoob/blob/main/src/content/main.tsx) (Content script), [`src/mykoob/models.ts`](https://github.com/xkyota/bettermykoob/blob/main/src/mykoob/models.ts) (Snapshot models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_injection["Page integration"]
  node_content_script["Content script<br/>[main.tsx]"]
end

subgraph group_mykoob["Mykoob integration"]
  node_dom_adapter["DOM adapter<br/>[domAdapter.ts]"]
  node_models["Snapshot models<br/>[models.ts]"]
end

subgraph group_interface["Extension interface"]
  node_react_app["React app<br/>[App.tsx]"]
  node_home_view["Home view<br/>[App.tsx]"]
  node_diary_view["Diary view<br/>[App.tsx]"]
  node_grades_view["Grades view<br/>[App.tsx]"]
  node_original_view["Original-page fallback<br/>[App.tsx]"]
end

node_mykoob_site(("Mykoob page"))

node_content_script -->|"creates and reads"| node_dom_adapter
node_content_script -->|"renders with snapshot"| node_react_app
node_dom_adapter -->|"reads DOM and controls"| node_mykoob_site
node_dom_adapter -->|"fetches schedule"| node_mykoob_site
node_dom_adapter -->|"uses types"| node_models
node_react_app -->|"uses snapshot types"| node_models
node_react_app -->|"invokes page controls"| node_dom_adapter
node_react_app -->|"renders"| node_home_view
node_react_app -->|"renders"| node_diary_view
node_react_app -->|"renders"| node_grades_view
node_react_app -->|"shows original content"| node_original_view

click node_content_script "https://github.com/xkyota/bettermykoob/blob/main/src/content/main.tsx"
click node_dom_adapter "https://github.com/xkyota/bettermykoob/blob/main/src/mykoob/domAdapter.ts"
click node_models "https://github.com/xkyota/bettermykoob/blob/main/src/mykoob/models.ts"
click node_react_app "https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx"
click node_home_view "https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx"
click node_diary_view "https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx"
click node_grades_view "https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx"
click node_original_view "https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx"

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_content_script toneBlue
class node_dom_adapter,node_models toneAmber
class node_react_app,node_home_view,node_diary_view,node_grades_view,node_original_view toneMint
class node_mykoob_site toneIndigo
```

## Components

### Page integration

- [Content script](https://github.com/xkyota/bettermykoob/blob/main/src/content/main.tsx): `src/content/main.tsx`

### Mykoob integration

- [DOM adapter](https://github.com/xkyota/bettermykoob/blob/main/src/mykoob/domAdapter.ts): `src/mykoob/domAdapter.ts`
- [Snapshot models](https://github.com/xkyota/bettermykoob/blob/main/src/mykoob/models.ts): `src/mykoob/models.ts`

### Extension interface

- [React app](https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx): `src/components/App.tsx`
- [Home view](https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx): `src/components/App.tsx`
- [Diary view](https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx): `src/components/App.tsx`
- [Grades view](https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx): `src/components/App.tsx`
- [Original-page fallback](https://github.com/xkyota/bettermykoob/blob/main/src/components/App.tsx): `src/components/App.tsx`

### Other components

- **Mykoob page**

## Connections

- Content script → DOM adapter: creates and reads (evidence: `src/content/main.tsx`)
- Content script → React app: renders with snapshot (evidence: `src/content/main.tsx`)
- DOM adapter → Mykoob page: reads DOM and controls (evidence: `src/mykoob/domAdapter.ts`)
- DOM adapter → Mykoob page: fetches schedule (evidence: `src/mykoob/domAdapter.ts`)
- DOM adapter → Snapshot models: uses types (evidence: `src/mykoob/domAdapter.ts`)
- React app → Snapshot models: uses snapshot types (evidence: `src/components/App.tsx`)
- React app → DOM adapter: invokes page controls (evidence: `src/components/App.tsx`)
- React app → Home view: renders (evidence: `src/components/App.tsx`)
- React app → Diary view: renders (evidence: `src/components/App.tsx`)
- React app → Grades view: renders (evidence: `src/components/App.tsx`)
- React app → Original-page fallback: shows original content (evidence: `README.md`)
