# freygh1/frontend architecture

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

- Interactive diagram: https://gitdiagram.com/freygh1/frontend
- Repository: https://github.com/freygh1/frontend

## Overview

This is an Astro-based English-learning site organized around lesson content, course and lesson routes, and reusable browsing components. The principal user workflow is to browse the catalog, narrow lessons with search and filters, then open a course or lesson. The content schema defines lessons loaded from Markdown files; the client search code filters rendered lesson cards and uses a shared text normalizer. The README is empty and most UI source was not sampled, so UI connections below are dashed and unverified; the two solid edges are directly supported by excerpts.

Main entry points: [`src/scripts/search.client.ts`](https://github.com/freygh1/frontend/blob/main/src/scripts/search.client.ts) (Filter controller), [`src/pages/index.astro`](https://github.com/freygh1/frontend/blob/main/src/pages/index.astro) (Home route), [`src/content.config.ts`](https://github.com/freygh1/frontend/blob/main/src/content.config.ts) (Lesson schema), [`src/pages/courses/[course].astro`](https://github.com/freygh1/frontend/blob/main/src/pages/courses/%5Bcourse%5D.astro) (Course route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Lesson content"]
  node_lesson_data["Lesson Markdown"]
  node_lesson_schema["Lesson schema<br/>[content.config.ts]"]
end

subgraph group_routes["Site routes"]
  node_home_route["Home route<br/>[index.astro]"]
  node_course_route["Course route<br/>[&#91;course&#93;.astro]"]
  node_lesson_route["Lesson route<br/>[&#91;id&#93;.astro]"]
  node_landing_layout["Landing layout"]
end

subgraph group_browse["Browsing interface"]
  node_main_view["Main view<br/>[Main.astro]"]
  node_courses_section["Courses section"]
  node_lesson_grid["Lesson grid<br/>[LessonGrid.astro]"]
  node_lesson_card["Lesson card<br/>[LessonCard.astro]"]
  node_search_bar["Search controls<br/>[SearchBar.astro]"]
  node_toc["Course contents<br/>[TOC.astro]"]
  node_header["Header<br/>[Header.astro]"]
  node_hero["Hero<br/>[Hero.astro]"]
  node_footer["Footer<br/>[Footer.astro]"]
  node_logo["Logo<br/>[Logo.astro]"]
end

subgraph group_search["Search behavior"]
  node_search_client["Filter controller<br/>[search.client.ts]"]
  node_normalizer["Text normalizer<br/>[normalize.ts]"]
end

node_learner(("Learner"))

node_lesson_schema -->|"loads lessons"| node_lesson_data
node_search_client -->|"normalizes query"| node_normalizer
node_learner -.->|"opens catalog"| node_home_route
node_home_route -.->|"renders with"| node_landing_layout
node_course_route -.->|"opens lesson"| node_lesson_route
node_search_client -.->|"handles filters"| node_search_bar
node_search_client -.->|"filters cards"| node_lesson_grid
node_toc -.->|"sets filters"| node_search_client

click node_lesson_data "https://github.com/freygh1/frontend/tree/main/src/content/lessons"
click node_lesson_schema "https://github.com/freygh1/frontend/blob/main/src/content.config.ts"
click node_home_route "https://github.com/freygh1/frontend/blob/main/src/pages/index.astro"
click node_course_route "https://github.com/freygh1/frontend/blob/main/src/pages/courses/%5Bcourse%5D.astro"
click node_lesson_route "https://github.com/freygh1/frontend/blob/main/src/pages/lessons/%5Bid%5D.astro"
click node_landing_layout "https://github.com/freygh1/frontend/blob/main/src/layouts/LandingPageLayout.astro"
click node_main_view "https://github.com/freygh1/frontend/blob/main/src/components/Main.astro"
click node_courses_section "https://github.com/freygh1/frontend/blob/main/src/components/CoursesSection.astro"
click node_lesson_grid "https://github.com/freygh1/frontend/blob/main/src/components/LessonGrid.astro"
click node_lesson_card "https://github.com/freygh1/frontend/blob/main/src/components/LessonCard.astro"
click node_search_bar "https://github.com/freygh1/frontend/blob/main/src/components/SearchBar.astro"
click node_toc "https://github.com/freygh1/frontend/blob/main/src/components/TOC.astro"
click node_header "https://github.com/freygh1/frontend/blob/main/src/components/Header.astro"
click node_hero "https://github.com/freygh1/frontend/blob/main/src/components/Hero.astro"
click node_footer "https://github.com/freygh1/frontend/blob/main/src/components/Footer.astro"
click node_logo "https://github.com/freygh1/frontend/blob/main/src/components/Logo.astro"
click node_search_client "https://github.com/freygh1/frontend/blob/main/src/scripts/search.client.ts"
click node_normalizer "https://github.com/freygh1/frontend/blob/main/src/utils/normalize.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_lesson_data,node_lesson_schema toneBlue
class node_home_route,node_course_route,node_lesson_route,node_landing_layout toneAmber
class node_main_view,node_courses_section,node_lesson_grid,node_lesson_card,node_search_bar,node_toc,node_header,node_hero,node_footer,node_logo toneMint
class node_search_client,node_normalizer toneRose
class node_learner toneIndigo
```

## Components

### Lesson content

- [Lesson Markdown](https://github.com/freygh1/frontend/tree/main/src/content/lessons): `src/content/lessons`
- [Lesson schema](https://github.com/freygh1/frontend/blob/main/src/content.config.ts): `src/content.config.ts`

### Site routes

- [Home route](https://github.com/freygh1/frontend/blob/main/src/pages/index.astro): `src/pages/index.astro`
- [Course route](https://github.com/freygh1/frontend/blob/main/src/pages/courses/%5Bcourse%5D.astro): `src/pages/courses/[course].astro`
- [Lesson route](https://github.com/freygh1/frontend/blob/main/src/pages/lessons/%5Bid%5D.astro): `src/pages/lessons/[id].astro`
- [Landing layout](https://github.com/freygh1/frontend/blob/main/src/layouts/LandingPageLayout.astro): `src/layouts/LandingPageLayout.astro`

### Browsing interface

- [Main view](https://github.com/freygh1/frontend/blob/main/src/components/Main.astro): `src/components/Main.astro`
- [Courses section](https://github.com/freygh1/frontend/blob/main/src/components/CoursesSection.astro): `src/components/CoursesSection.astro`
- [Lesson grid](https://github.com/freygh1/frontend/blob/main/src/components/LessonGrid.astro): `src/components/LessonGrid.astro`
- [Lesson card](https://github.com/freygh1/frontend/blob/main/src/components/LessonCard.astro): `src/components/LessonCard.astro`
- [Search controls](https://github.com/freygh1/frontend/blob/main/src/components/SearchBar.astro): `src/components/SearchBar.astro`
- [Course contents](https://github.com/freygh1/frontend/blob/main/src/components/TOC.astro): `src/components/TOC.astro`
- [Header](https://github.com/freygh1/frontend/blob/main/src/components/Header.astro): `src/components/Header.astro`
- [Hero](https://github.com/freygh1/frontend/blob/main/src/components/Hero.astro): `src/components/Hero.astro`
- [Footer](https://github.com/freygh1/frontend/blob/main/src/components/Footer.astro): `src/components/Footer.astro`
- [Logo](https://github.com/freygh1/frontend/blob/main/src/components/Logo.astro): `src/components/Logo.astro`

### Search behavior

- [Filter controller](https://github.com/freygh1/frontend/blob/main/src/scripts/search.client.ts): `src/scripts/search.client.ts`
- [Text normalizer](https://github.com/freygh1/frontend/blob/main/src/utils/normalize.ts): `src/utils/normalize.ts`

### Other components

- **Learner**

## Connections

- Lesson schema → Lesson Markdown: loads lessons (evidence: `src/content.config.ts`)
- Filter controller → Text normalizer: normalizes query (evidence: `src/scripts/search.client.ts`)
- Learner → Home route: opens catalog
- Home route → Landing layout: renders with
- Course route → Lesson route: opens lesson
- Filter controller → Search controls: handles filters
- Filter controller → Lesson grid: filters cards
- Course contents → Filter controller: sets filters
