# sun92122/ntnux architecture

> Architecture diagram of the GitHub repository sun92122/ntnux, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sun92122/ntnux
- Repository: https://github.com/sun92122/ntnux

## Overview

##### Project type and purpose
- This is a full-stack web application with two distinct parts:
- A backend “data pipeline” in Python that crawls, analyzes, processes, and stores JSON datasets.
- A Nuxt.js (Vue) frontend that consumes those JSON files as static assets and renders a web UI (schedule/course viewer).
- The empty README suggests no additional architectural docs; we infer from the file tree:
- Backend directory contains crawler, hook modules, original_data, and processing tools.
- Frontend directory follows a Nuxt project structure, with pages, components, static assets under public/data, and configuration files.

##### File structure
- Top-level
- backend/ – Python scripts for ETL
– crawl/browser.py (web crawler entry)
– hook/analysis.py & save.py (data transformation & persistence)
– tool/ (utilities: minimize, parse, proxy, strip)
– original_data/ (raw JSON input + formatted JSON)
– main.py (orchestrator)
– requirements.txt
- frontend/ – Nuxt3 application
– pages/ (Vue pages)
– components/ (reusable Vue components: FloatingSchedule.vue, courseCell.vue)
– public/data/ (static JSON served to client)
– nuxt.config.ts, package.json, tsconfig.json
– server/ (TypeScript config for server-side API if any)
- Patterns
- Backend implements an ETL pipeline (Extract via crawl, Transform via hook & tool, Load into JSON files).
- Frontend is a static-first SPA/SSR with static JSON assets served under /data.

##### Key insights from README
- README.md is empty; rely fully on inferred architecture.

##### Elements
- Clear labels for each component (e.g., “crawl/browser.py”, “Nuxt Server”)
- External world (gray)

##### Final recommendations
- Be very detailed: break the backend into its scripts and highlight the ETL stages.
- How static data flows into the frontend build or runtime.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Backend Layer
    subgraph "Backend ETL Pipeline"
        direction TB
        BackendETL["Backend ETL Pipeline"]:::backend
        Orchestrator["main.py"]:::backend
        Crawler["crawl/browser.py"]:::backend
        RawData[(Raw JSON Repository)]:::data
        Analysis["hook/analysis.py"]:::backend
        SaveHook["hook/save.py"]:::backend
        Tools["Utility Tools"]:::backend
        ToolMin["minimize.py"]:::backend
        ToolParse["parse.py"]:::backend
        ToolProxy["proxy.py"]:::backend
        ToolStrip["strip.py"]:::backend
        FinalData[(Processed JSON)]:::data
        Requirements["requirements.txt"]:::backend

        BackendETL --> Orchestrator
        Orchestrator --> Crawler
        Crawler --> RawData
        RawData --> Analysis
        Analysis --> SaveHook
        SaveHook --> Tools
        Tools --> ToolMin
        Tools --> ToolParse
        Tools --> ToolProxy
        Tools --> ToolStrip
        ToolMin --> FinalData
        ToolParse --> FinalData
        ToolProxy --> FinalData
        ToolStrip --> FinalData
        Orchestrator --> Requirements
    end

    %% Frontend Layer
    subgraph "Frontend / Presentation Layer"
        direction TB
        FrontendApp["Frontend Nuxt Application"]:::frontend
        NuxtConfig["nuxt.config.ts"]:::frontend
        Pages["pages/index.vue"]:::frontend
        Components["UI Components"]:::frontend
        Floating["FloatingSchedule.vue"]:::frontend
        CourseCell["courseCell.vue"]:::frontend
        ServerTS["server/tsconfig.json"]:::frontend
        Dependencies["package.json & lock, tsconfig.json"]:::frontend
        StaticJSON[(public/data Static JSON Store)]:::data
        BundledData[(output-data.json)]:::data
        NuxtServer["Nuxt Server"]:::frontend

        FrontendApp --> NuxtConfig
        FrontendApp --> Dependencies
        FrontendApp --> ServerTS
        FrontendApp --> Pages
        FrontendApp --> Components
        Components --> Floating
        Components --> CourseCell
        FrontendApp --> NuxtServer
        NuxtServer --> StaticJSON
        NuxtServer --> BundledData
    end

    %% Client
    Browser["Browser / Client"]:::external
    Browser -->|"HTTP Request"| NuxtServer
    Browser -->|"Fetch JSON"| StaticJSON
    Browser -->|"Fetch JSON"| BundledData
    Browser -->|"Render UI"| Pages
    Pages --> Floating
    Pages --> CourseCell

    %% Deployment Data Flow
    FinalData -->|"Deployed to"| StaticJSON
    FinalData -->|"Deployed to"| BundledData

    %% Click Events
    click BackendETL "https://github.com/sun92122/ntnux/tree/main/backend/"
    click Crawler "https://github.com/sun92122/ntnux/blob/main/backend/crawl/browser.py"
    click Analysis "https://github.com/sun92122/ntnux/blob/main/backend/hook/analysis.py"
    click SaveHook "https://github.com/sun92122/ntnux/blob/main/backend/hook/save.py"
    click ToolMin "https://github.com/sun92122/ntnux/blob/main/backend/tool/minimize.py"
    click ToolParse "https://github.com/sun92122/ntnux/blob/main/backend/tool/parse.py"
    click ToolProxy "https://github.com/sun92122/ntnux/blob/main/backend/tool/proxy.py"
    click ToolStrip "https://github.com/sun92122/ntnux/blob/main/backend/tool/strip.py"
    click RawData "https://github.com/sun92122/ntnux/tree/main/backend/original_data/"
    click Orchestrator "https://github.com/sun92122/ntnux/blob/main/backend/main.py"
    click Requirements "https://github.com/sun92122/ntnux/blob/main/backend/requirements.txt"
    click FrontendApp "https://github.com/sun92122/ntnux/tree/main/frontend/"
    click NuxtConfig "https://github.com/sun92122/ntnux/blob/main/frontend/nuxt.config.ts"
    click Pages "https://github.com/sun92122/ntnux/blob/main/frontend/pages/index.vue"
    click Floating "https://github.com/sun92122/ntnux/blob/main/frontend/components/FloatingSchedule.vue"
    click CourseCell "https://github.com/sun92122/ntnux/blob/main/frontend/components/courseCell.vue"
    click StaticJSON "https://github.com/sun92122/ntnux/tree/main/frontend/public/data/"
    click BundledData "https://github.com/sun92122/ntnux/blob/main/frontend/output-data.json"
    click Dependencies "https://github.com/sun92122/ntnux/blob/main/frontend/package.json"
    click ServerTS "https://github.com/sun92122/ntnux/blob/main/frontend/server/tsconfig.json"

    %% Styles
    classDef backend fill:#d0e7ff,stroke:#036,sroke-width:1px
    classDef frontend fill:#e0ffe0,stroke:#093,stroke-width:1px
    classDef data fill:#fff3cd,stroke:#993,stroke-width:1px
    classDef external fill:#f0f0f0,stroke:#666,stroke-width:1px
```
