# itshenrywu/mcut-course architecture

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

- Interactive diagram: https://gitdiagram.com/itshenrywu/mcut-course
- Repository: https://github.com/itshenrywu/mcut-course

## Overview

1. **What this repository is**
   - This is a **Nuxt 2 / Vue 2 frontend application** for Ming Chi University of Technology’s course selection helper.
   - The app’s core jobs are: **browse the full course catalog, inspect class schedules, plan a schedule, detect conflicts, and check graduation/selection rules**.

2. **Top-level architecture**
   - The project is organized as a standard Nuxt app:
     - `pages/` defines the routed screens.
     - `layouts/` provides the app shell and error handling.
     - `components/` contains reusable UI blocks.
     - `store/` holds shared application state.
     - `plugins/` injects client/runtime utilities.
     - `static/` and `asset/` hold deployable assets, styles, icons, and helper scripts.

3. **Routing model and page boundaries**
   - The app is page-driven, with several functional areas:
     - General info pages: `index`, `about`, `info`, `terms`, `more`.
     - Schedule/planning pages: `calendar`, `saved`, `my`.
     - Course browsing pages: `course/index`, `course/_term/_dept/_id`.
     - Class detail pages: `class/_term/_dept/_class`.
     - Graduation/rule pages: `rule/_year/_dept/_id`.
     - Account/auth-related pages: `login`, `logout`, `passport`.
   - The dynamic route structure shows the domain hierarchy is centered on **term, department, course/class ID, and graduation year**.

4. **Data flow through the app**
   - The UI is likely driven by **remote course and rule data** fetched through the `axios` plugin.
   - Data then flows into the **Vuex store** for app-wide state such as selected courses, saved plans, and user-facing filters.
   - Pages and components read from the store to render lists, details, and conflict/schedule views.

5. **State persistence and client-side sync**
   - `plugins/storage-sync.client.js` indicates a **browser-only persistence layer**, likely syncing local storage with app state.
   - This is important for features like **saved schedules / favorites / pre-planned courses**, which need to survive refreshes and possibly sync across tabs.

6. **Reusable UI components**
   - `components/CourseList.vue` is the central list-rendering component for course browsing.
   - `components/loading.vue`, `components/profile.vue`, and `components/top-menu.vue` support the app shell and common interaction states.
   - These components are shared across multiple route pages rather than being tied to a single screen.

7. **Layout and shell**
   - `layouts/default.vue` is the main application frame used across most pages.
   - `layouts/error.vue` provides fallback behavior for route/data failures.
   - This suggests a conventional Nuxt shell where pages supply content and layouts supply global navigation and structure.

8. **UI system and styling**
   - The app uses **Tocas UI** heavily, bundled locally under `asset/tocas/`.
   - That folder contains the CSS for many UI primitives and patterns: grids, forms, tabs, modals, dropdowns, tables, tooltips, sidebar/navbar, etc.
   - The app also ships icon fonts and flag assets, so the visual system is largely self-contained and static.

9. **Client-side behavior libraries**
   - `asset/tocas/scripts/` includes Tocas runtime scripts such as dropdown, dialog, popover, tooltip, tabs, and responsive helpers.
   - These scripts handle interactive UI behavior on the client without requiring a separate backend service.

10. **Static/public assets and entry points**
   - `static/` contains deployment-facing files like `robots.txt`, `ads.txt`, `site.webmanifest`, `icomoon.css`, fonts, and a `github.html` page.
   - `static/import.js` and `static/scriptable.js` suggest support files for external embedding or scripting integration.
   - This indicates the app is designed to be a **fully hosted frontend** with a rich static asset footprint.

11. **Build and deployment**
   - `nuxt.config.js` defines the Nuxt build/runtime behavior.
   - `.github/workflows/deploy.yml` shows automated deployment via GitHub Actions.
   - `asset/utils/` contains build helpers such as `sitemap.js` and `minify-icons.js`, implying some asset preprocessing during release.

12. **Architecture boundary to keep in mind**
   - There is **no obvious server-side application code in this repo**.
   - The main architectural boundary is between:
     - the **Nuxt/Vue frontend** in this repository, and
     - the **external data source(s)** that provide course, schedule, and graduation-rule information.
   - So the repo should be drawn as a client application with local state, remote data access, and static asset/runtime dependencies rather than as a backend system.

Main entry points: [`layouts/default.vue`](https://github.com/itshenrywu/mcut-course/blob/main/layouts/default.vue) (Main shell), [`store/index.js`](https://github.com/itshenrywu/mcut-course/blob/main/store/index.js) (Vuex store), [`nuxt.config.js`](https://github.com/itshenrywu/mcut-course/blob/main/nuxt.config.js) (Nuxt config), [`asset/tocas/tocas.css`](https://github.com/itshenrywu/mcut-course/blob/main/asset/tocas/tocas.css) (Tocas UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Nuxt App"]
end

subgraph group_pages["Routes"]
  node_home_page["Home<br/>route page<br/>[index.vue]"]
  node_general_pages["Info pages<br/>route pages<br/>[about.vue]"]
  node_schedule_pages["Planner pages<br/>route pages<br/>[calendar.vue]"]
  node_course_browser["Course browser<br/>route page<br/>[index.vue]"]
  node_course_detail["Course detail<br/>route page<br/>[_id.vue]"]
  node_class_detail["Class detail<br/>route page<br/>[_class.vue]"]
  node_rule_detail["Rule detail<br/>route page<br/>[_id.vue]"]
  node_auth_pages["Auth pages<br/>route pages<br/>[login.vue]"]
end

subgraph group_ui["Shared UI"]
  node_default_layout["Main shell<br/>layout<br/>[default.vue]"]
  node_error_layout["Error shell<br/>layout<br/>[error.vue]"]
  node_course_list["Course list<br/>shared component<br/>[CourseList.vue]"]
  node_top_menu["Top menu<br/>shared component<br/>[top-menu.vue]"]
  node_profile_card["Profile card<br/>shared component<br/>[profile.vue]"]
  node_loading_state["Loading view<br/>shared component<br/>[loading.vue]"]
end

subgraph group_state["State & Plugins"]
  node_store[("Vuex store<br/>app state<br/>[index.js]")]
  node_axios_plugin["Axios plugin<br/>http client<br/>[axios.js]"]
  node_sync_plugin["Storage sync<br/>client persistence"]
end

subgraph group_assets["Static Assets"]
  node_tocas_ui["Tocas UI<br/>css/runtime ui<br/>[tocas.css]"]
  node_asset_utils["Asset utils<br/>build helpers<br/>[sitemap.js]"]
  node_static_bundle["Static bundle<br/>public assets<br/>[site.webmanifest]"]
end

subgraph group_deploy["Delivery"]
  node_nuxt_config["Nuxt config<br/>build config<br/>[nuxt.config.js]"]
  node_deploy_workflow["Deploy workflow<br/>ci deploy<br/>[deploy.yml]"]
end

subgraph group_external["External Data"]
  node_external_data[("Course data<br/>remote sources")]
end

node_nuxt_config -->|"configures"| node_default_layout
node_nuxt_config -->|"loads"| node_axios_plugin
node_nuxt_config -->|"loads"| node_sync_plugin
node_deploy_workflow -->|"builds"| node_nuxt_config
node_default_layout -->|"uses"| node_top_menu
node_default_layout -->|"uses"| node_loading_state
node_error_layout -->|"falls back"| node_loading_state
node_home_page -->|"renders in"| node_default_layout
node_general_pages -->|"renders in"| node_default_layout
node_schedule_pages -->|"renders in"| node_default_layout
node_course_browser -->|"uses"| node_course_list
node_course_browser -->|"renders in"| node_default_layout
node_course_detail -->|"drills into"| node_course_list
node_course_detail -->|"renders in"| node_default_layout
node_class_detail -->|"renders in"| node_default_layout
node_rule_detail -->|"renders in"| node_default_layout
node_auth_pages -->|"uses"| node_profile_card
node_auth_pages -->|"renders in"| node_default_layout
node_store -->|"feeds"| node_course_list
node_store -->|"persists"| node_schedule_pages
node_store -->|"syncs through"| node_sync_plugin
node_axios_plugin -->|"fetches from"| node_external_data
node_store -->|"requests"| node_axios_plugin
node_tocas_ui -->|"styles"| node_default_layout
node_tocas_ui -->|"styles"| node_top_menu
node_asset_utils -->|"prepares"| node_static_bundle
node_static_bundle -->|"ships with"| node_tocas_ui

click node_nuxt_config "https://github.com/itshenrywu/mcut-course/blob/main/nuxt.config.js"
click node_deploy_workflow "https://github.com/itshenrywu/mcut-course/blob/main/.github/workflows/deploy.yml"
click node_default_layout "https://github.com/itshenrywu/mcut-course/blob/main/layouts/default.vue"
click node_error_layout "https://github.com/itshenrywu/mcut-course/blob/main/layouts/error.vue"
click node_course_list "https://github.com/itshenrywu/mcut-course/blob/main/components/CourseList.vue"
click node_top_menu "https://github.com/itshenrywu/mcut-course/blob/main/components/top-menu.vue"
click node_profile_card "https://github.com/itshenrywu/mcut-course/blob/main/components/profile.vue"
click node_loading_state "https://github.com/itshenrywu/mcut-course/blob/main/components/loading.vue"
click node_store "https://github.com/itshenrywu/mcut-course/blob/main/store/index.js"
click node_axios_plugin "https://github.com/itshenrywu/mcut-course/blob/main/plugins/axios.js"
click node_sync_plugin "https://github.com/itshenrywu/mcut-course/blob/main/plugins/storage-sync.client.js"
click node_home_page "https://github.com/itshenrywu/mcut-course/blob/main/pages/index.vue"
click node_general_pages "https://github.com/itshenrywu/mcut-course/blob/main/pages/about.vue"
click node_schedule_pages "https://github.com/itshenrywu/mcut-course/blob/main/pages/calendar.vue"
click node_course_browser "https://github.com/itshenrywu/mcut-course/blob/main/pages/course/index.vue"
click node_course_detail "https://github.com/itshenrywu/mcut-course/blob/main/pages/course/_term/_dept/_id.vue"
click node_class_detail "https://github.com/itshenrywu/mcut-course/blob/main/pages/class/_term/_dept/_class.vue"
click node_rule_detail "https://github.com/itshenrywu/mcut-course/blob/main/pages/rule/_year/_dept/_id.vue"
click node_auth_pages "https://github.com/itshenrywu/mcut-course/blob/main/pages/login.vue"
click node_tocas_ui "https://github.com/itshenrywu/mcut-course/blob/main/asset/tocas/tocas.css"
click node_asset_utils "https://github.com/itshenrywu/mcut-course/blob/main/asset/utils/sitemap.js"
click node_static_bundle "https://github.com/itshenrywu/mcut-course/blob/main/static/site.webmanifest"

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_page,node_general_pages,node_schedule_pages,node_course_browser,node_course_detail,node_class_detail,node_rule_detail,node_auth_pages toneAmber
class node_default_layout,node_error_layout,node_course_list,node_top_menu,node_profile_card,node_loading_state toneMint
class node_store,node_axios_plugin,node_sync_plugin toneRose
class node_tocas_ui,node_asset_utils,node_static_bundle toneIndigo
class node_nuxt_config,node_deploy_workflow toneTeal
class node_external_data toneBlue
```

## Components

### Routes

Page-driven functional areas

- [Home](https://github.com/itshenrywu/mcut-course/blob/main/pages/index.vue): route page · Landing page and overview entry point · `pages/index.vue`
- [Info pages](https://github.com/itshenrywu/mcut-course/blob/main/pages/about.vue): route pages · General information and static content screens · `pages/about.vue`
- [Planner pages](https://github.com/itshenrywu/mcut-course/blob/main/pages/calendar.vue): route pages · Calendar, saved plans, and personal schedule views · `pages/calendar.vue`
- [Course browser](https://github.com/itshenrywu/mcut-course/blob/main/pages/course/index.vue): route page · Catalog entry page for browsing courses · `pages/course/index.vue`
- [Course detail](https://github.com/itshenrywu/mcut-course/blob/main/pages/course/_term/_dept/_id.vue): route page · Dynamic course detail route by term, department, and id · `pages/course/_term/_dept/_id.vue`
- [Class detail](https://github.com/itshenrywu/mcut-course/blob/main/pages/class/_term/_dept/_class.vue): route page · Dynamic class section route by term, department, and class · `pages/class/_term/_dept/_class.vue`
- [Rule detail](https://github.com/itshenrywu/mcut-course/blob/main/pages/rule/_year/_dept/_id.vue): route page · Dynamic graduation-rule route by year, department, and id · `pages/rule/_year/_dept/_id.vue`
- [Auth pages](https://github.com/itshenrywu/mcut-course/blob/main/pages/login.vue): route pages · Login, logout, and passport/account flows · `pages/login.vue`

### Shared UI

Reusable components and layouts

- [Main shell](https://github.com/itshenrywu/mcut-course/blob/main/layouts/default.vue): layout · Primary app frame used across most pages · `layouts/default.vue`
- [Error shell](https://github.com/itshenrywu/mcut-course/blob/main/layouts/error.vue): layout · Fallback layout for route and data failures · `layouts/error.vue`
- [Course list](https://github.com/itshenrywu/mcut-course/blob/main/components/CourseList.vue): shared component · Central list renderer for course browsing · `components/CourseList.vue`
- [Top menu](https://github.com/itshenrywu/mcut-course/blob/main/components/top-menu.vue): shared component · Primary navigation for the app shell · `components/top-menu.vue`
- [Profile card](https://github.com/itshenrywu/mcut-course/blob/main/components/profile.vue): shared component · User/account summary block · `components/profile.vue`
- [Loading view](https://github.com/itshenrywu/mcut-course/blob/main/components/loading.vue): shared component · Common loading and empty-state feedback · `components/loading.vue`

### State & Plugins

Vuex store and runtime helpers

- [Vuex store](https://github.com/itshenrywu/mcut-course/blob/main/store/index.js): app state · Shared client state for plans, selections, and filters · `store/index.js`
- [Axios plugin](https://github.com/itshenrywu/mcut-course/blob/main/plugins/axios.js): http client · Injected client for remote course and rule requests · `plugins/axios.js`
- [Storage sync](https://github.com/itshenrywu/mcut-course/blob/main/plugins/storage-sync.client.js): client persistence · Browser-only state synchronization with local storage · `plugins/storage-sync.client.js`

### Static Assets

Local CSS, icons, scripts, and generated utilities

- [Tocas UI](https://github.com/itshenrywu/mcut-course/blob/main/asset/tocas/tocas.css): css/runtime ui · Bundled local UI system for layout, controls, and interactions · `asset/tocas/tocas.css`
- [Asset utils](https://github.com/itshenrywu/mcut-course/blob/main/asset/utils/sitemap.js): build helpers · Sitemap generation and icon minification helpers · `asset/utils/sitemap.js`
- [Static bundle](https://github.com/itshenrywu/mcut-course/blob/main/static/site.webmanifest): public assets · Deployable icons, fonts, manifest, and embed helpers · `static/site.webmanifest`

### Delivery

Build and deployment configuration

- [Nuxt config](https://github.com/itshenrywu/mcut-course/blob/main/nuxt.config.js): build config · Runtime and build settings for the Nuxt app · `nuxt.config.js`
- [Deploy workflow](https://github.com/itshenrywu/mcut-course/blob/main/.github/workflows/deploy.yml): ci deploy · GitHub Actions deployment pipeline · `.github/workflows/deploy.yml`

### External Data

Remote course and rule sources consumed by the client

- **Course data**: remote sources · External course, schedule, and graduation-rule providers

## Connections

- Nuxt config → Main shell: configures · Declares app-wide Nuxt runtime behavior
- Nuxt config → Axios plugin: loads · Registers HTTP client behavior
- Nuxt config → Storage sync: loads · Registers browser-only persistence sync
- Deploy workflow → Nuxt config: builds · Automated deployment uses the Nuxt build output
- Main shell → Top menu: uses · Provides global navigation and shell structure
- Main shell → Loading view: uses · Displays global loading feedback
- Error shell → Loading view: falls back · Shares common status presentation patterns
- Home → Main shell: renders in · Home page is placed inside the app shell
- Info pages → Main shell: renders in · Static/info pages use the main shell
- Planner pages → Main shell: renders in · Planning views use the main shell
- Course browser → Course list: uses · Catalog browsing is driven by the central list component
- Course browser → Main shell: renders in · Course browser is part of the main shell
- Course detail → Course list: drills into · Course detail builds on list/browse flows
- Course detail → Main shell: renders in · Dynamic course detail page uses the main shell
- Class detail → Main shell: renders in · Class detail page uses the main shell
- Rule detail → Main shell: renders in · Graduation-rule page uses the main shell
- Auth pages → Profile card: uses · Authentication/account screens surface user identity
- Auth pages → Main shell: renders in · Account pages use the main shell
- Vuex store → Course list: feeds · Shared state drives catalog and selection views
- Vuex store → Planner pages: persists · Saved plans and user selections live in shared state
- Vuex store → Storage sync: syncs through · Client storage keeps state across refreshes and tabs
- Axios plugin → Course data: fetches from · Remote data is brought into the client via HTTP
- Vuex store → Axios plugin: requests · State and pages rely on fetched course data
- Tocas UI → Main shell: styles · Provides the app's visual system and interactive primitives
- Tocas UI → Top menu: styles · Shared navigation and controls use Tocas UI
- Asset utils → Static bundle: prepares · Build-time helpers process shipped assets
- Static bundle → Tocas UI: ships with · Public assets complement the bundled UI system
