# glacy/fg1-astro architecture

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

- Interactive diagram: https://gitdiagram.com/glacy/fg1-astro
- Repository: https://github.com/glacy/fg1-astro

## Overview

FG1 is a static course website and installable PWA for students, with course materials, weekly planning, assessments, office hours, and academic readings. The main journey is browsing the dashboard into weekly plans or readings; separate planner and schedule pages provide assessment and instructor information with client-side filters. The repository also documents a distinct Starlight documentation area and offline support. Edges reflect README-described routing and sampled data/filter/cache behavior; page implementations and several integrations were not sampled, so uncertain wiring is omitted.

Main entry points: [`src/layouts/ShellLayout.astro`](https://github.com/glacy/fg1-astro/blob/main/src/layouts/ShellLayout.astro) (Astro shell), [`src/pages/schedule/index.astro`](https://github.com/glacy/fg1-astro/blob/main/src/pages/schedule/index.astro) (Office hours), [`src/sw.ts`](https://github.com/glacy/fg1-astro/blob/main/src/sw.ts) (Service worker), [`src/pages/weekly/[semana].astro`](https://github.com/glacy/fg1-astro/blob/main/src/pages/weekly/%5Bsemana%5D.astro) (Weekly plans)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_course["Course pages"]
  node_dashboard["Dashboard<br/>[index.astro]"]
  node_weekly["Weekly plans<br/>[&#91;semana&#93;.astro]"]
  node_planner["Assessment planner<br/>[index.astro]"]
  node_schedule["Office hours<br/>[index.astro]"]
  node_docindex["Reading index<br/>[index.astro]"]
  node_shell["Astro shell<br/>[ShellLayout.astro]"]
end

subgraph group_learning["Learning materials"]
  node_starlight["Academic readings"]
  node_exercises["Interactive exercises<br/>[Exercise.astro]"]
  node_math["Math diagrams<br/>[index.ts]"]
end

subgraph group_data["Course data"]
  node_weekdata["Weekly content"]
  node_weekloader["Week loader<br/>[weeks.ts]"]
  node_examdata["Assessment data<br/>[exams.json]"]
  node_examlogic["Exam filters<br/>[index.ts]"]
  node_instructors["Instructor data<br/>[instructors.ts]"]
  node_schedulefilter["Schedule filters"]
end

subgraph group_runtime["Browser runtime"]
  node_sw["Service worker<br/>[sw.ts]"]
  node_offline["Offline page<br/>[offline.astro]"]
  node_theme["Theme preference<br/>[theme.ts]"]
end

node_student(("Student"))
node_browser[("Browser storage")]
node_network(("Web network"))

node_student -->|"opens"| node_dashboard
node_student -->|"browses"| node_weekly
node_student -->|"browses"| node_planner
node_student -->|"browses"| node_schedule
node_student -->|"browses"| node_docindex
node_student -->|"reads"| node_starlight
node_dashboard -->|"uses layout"| node_shell
node_weekly -->|"uses layout"| node_shell
node_planner -->|"uses layout"| node_shell
node_schedule -->|"uses layout"| node_shell
node_docindex -->|"uses layout"| node_shell
node_weekly -->|"loads weeks"| node_weekloader
node_weekloader -->|"reads"| node_weekdata
node_planner -->|"filters exams"| node_examlogic
node_examlogic -->|"reads"| node_examdata
node_schedule -->|"renders hours"| node_instructors
node_schedule -->|"sets up filters"| node_schedulefilter
node_starlight -->|"renders exercises"| node_exercises
node_starlight -->|"renders diagrams"| node_math
node_shell -->|"sets theme"| node_theme
node_theme -->|"stores preference"| node_browser
node_sw -->|"caches pages"| node_browser
node_sw -->|"fetches pages"| node_network
node_sw -->|"falls back"| node_offline

click node_dashboard "https://github.com/glacy/fg1-astro/blob/main/src/pages/index.astro"
click node_weekly "https://github.com/glacy/fg1-astro/blob/main/src/pages/weekly/%5Bsemana%5D.astro"
click node_planner "https://github.com/glacy/fg1-astro/blob/main/src/pages/planner/index.astro"
click node_schedule "https://github.com/glacy/fg1-astro/blob/main/src/pages/schedule/index.astro"
click node_docindex "https://github.com/glacy/fg1-astro/blob/main/src/pages/documentos/index.astro"
click node_shell "https://github.com/glacy/fg1-astro/blob/main/src/layouts/ShellLayout.astro"
click node_starlight "https://github.com/glacy/fg1-astro/tree/main/src/content/docs"
click node_exercises "https://github.com/glacy/fg1-astro/blob/main/src/components/Exercise.astro"
click node_math "https://github.com/glacy/fg1-astro/blob/main/src/components/graph/index.ts"
click node_weekdata "https://github.com/glacy/fg1-astro/tree/main/src/content/weeks"
click node_weekloader "https://github.com/glacy/fg1-astro/blob/main/src/lib/weekly/weeks.ts"
click node_examdata "https://github.com/glacy/fg1-astro/blob/main/src/lib/planner/exams.json"
click node_examlogic "https://github.com/glacy/fg1-astro/blob/main/src/lib/planner/index.ts"
click node_instructors "https://github.com/glacy/fg1-astro/blob/main/src/lib/instructors.ts"
click node_schedulefilter "https://github.com/glacy/fg1-astro/blob/main/src/lib/schedule-filter.client.ts"
click node_sw "https://github.com/glacy/fg1-astro/blob/main/src/sw.ts"
click node_offline "https://github.com/glacy/fg1-astro/blob/main/src/pages/offline.astro"
click node_theme "https://github.com/glacy/fg1-astro/blob/main/src/lib/shared/theme.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_dashboard,node_weekly,node_planner,node_schedule,node_docindex,node_shell toneBlue
class node_starlight,node_exercises,node_math,node_browser toneAmber
class node_weekdata,node_weekloader,node_examdata,node_examlogic,node_instructors,node_schedulefilter toneMint
class node_sw,node_offline,node_theme toneRose
class node_student,node_network toneIndigo
```

## Components

### Course pages

- [Dashboard](https://github.com/glacy/fg1-astro/blob/main/src/pages/index.astro): `src/pages/index.astro`
- [Weekly plans](https://github.com/glacy/fg1-astro/blob/main/src/pages/weekly/%5Bsemana%5D.astro): `src/pages/weekly/[semana].astro`
- [Assessment planner](https://github.com/glacy/fg1-astro/blob/main/src/pages/planner/index.astro): `src/pages/planner/index.astro`
- [Office hours](https://github.com/glacy/fg1-astro/blob/main/src/pages/schedule/index.astro): `src/pages/schedule/index.astro`
- [Reading index](https://github.com/glacy/fg1-astro/blob/main/src/pages/documentos/index.astro): `src/pages/documentos/index.astro`
- [Astro shell](https://github.com/glacy/fg1-astro/blob/main/src/layouts/ShellLayout.astro): `src/layouts/ShellLayout.astro`

### Learning materials

- [Academic readings](https://github.com/glacy/fg1-astro/tree/main/src/content/docs): `src/content/docs`
- [Interactive exercises](https://github.com/glacy/fg1-astro/blob/main/src/components/Exercise.astro): `src/components/Exercise.astro`
- [Math diagrams](https://github.com/glacy/fg1-astro/blob/main/src/components/graph/index.ts): `src/components/graph/index.ts`

### Course data

- [Weekly content](https://github.com/glacy/fg1-astro/tree/main/src/content/weeks): `src/content/weeks`
- [Week loader](https://github.com/glacy/fg1-astro/blob/main/src/lib/weekly/weeks.ts): `src/lib/weekly/weeks.ts`
- [Assessment data](https://github.com/glacy/fg1-astro/blob/main/src/lib/planner/exams.json): `src/lib/planner/exams.json`
- [Exam filters](https://github.com/glacy/fg1-astro/blob/main/src/lib/planner/index.ts): `src/lib/planner/index.ts`
- [Instructor data](https://github.com/glacy/fg1-astro/blob/main/src/lib/instructors.ts): `src/lib/instructors.ts`
- [Schedule filters](https://github.com/glacy/fg1-astro/blob/main/src/lib/schedule-filter.client.ts): `src/lib/schedule-filter.client.ts`

### Browser runtime

- [Service worker](https://github.com/glacy/fg1-astro/blob/main/src/sw.ts): `src/sw.ts`
- [Offline page](https://github.com/glacy/fg1-astro/blob/main/src/pages/offline.astro): `src/pages/offline.astro`
- [Theme preference](https://github.com/glacy/fg1-astro/blob/main/src/lib/shared/theme.ts): `src/lib/shared/theme.ts`

### Other components

- **Student**
- **Browser storage**
- **Web network**

## Connections

- Student → Dashboard: opens
- Student → Weekly plans: browses
- Student → Assessment planner: browses
- Student → Office hours: browses
- Student → Reading index: browses
- Student → Academic readings: reads
- Dashboard → Astro shell: uses layout
- Weekly plans → Astro shell: uses layout
- Assessment planner → Astro shell: uses layout
- Office hours → Astro shell: uses layout
- Reading index → Astro shell: uses layout
- Weekly plans → Week loader: loads weeks
- Week loader → Weekly content: reads
- Assessment planner → Exam filters: filters exams
- Exam filters → Assessment data: reads
- Office hours → Instructor data: renders hours
- Office hours → Schedule filters: sets up filters
- Academic readings → Interactive exercises: renders exercises
- Academic readings → Math diagrams: renders diagrams
- Astro shell → Theme preference: sets theme
- Theme preference → Browser storage: stores preference
- Service worker → Browser storage: caches pages
- Service worker → Web network: fetches pages
- Service worker → Offline page: falls back
