# tvrrdfn/math-papers architecture

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

- Interactive diagram: https://gitdiagram.com/tvrrdfn/math-papers
- Repository: https://github.com/tvrrdfn/math-papers

## Overview

##### Project type and purpose
- This is a front-end single-page application (SPA) built with Vue.js.
- It serves as an interactive “数学试题” (math quiz/test) platform.

##### File structure
- Top-level build pipeline
- build/ – custom webpack scripts and helpers
- config/ – environment configs for dev/prod
- .babelrc, webpack.*.conf.js – transpile and bundle settings
- Application source (src/)
- main.js + App.vue – app entry point and root component
- router/index.js – Vue Router definitions (views/routes)
- store/ – Vuex modules (state, actions, mutations)
- services/ – API wrappers (e.g., questions.services.js)
- components/ – feature components (Papers, question types, break-down, test-paper, etc.)
- ui/ – reusable UI component library and demos
- assets/, styles/, utils/ – static assets, SASS/CSS frameworks, helper functions
- static/ – files copied directly to final build output

##### README for additional insights
- “npm run dev” launches a webpack dev server with hot-reload
- “npm run build” produces a minified production bundle
- No built-in backend – relies on external API or mock data for questions

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Environment
    subgraph "Developer Environment"
        direction TB
        DEV_NODE["Node.js & npm CLI"]:::devenv
        DEV_SCRIPTS["build scripts (webpack, Babel)"]:::devenv
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        direction TB
        WP_BASE["webpack.base.conf.js"]:::build
        WP_DEV["webpack.dev.conf.js"]:::build
        WP_PROD["webpack.prod.conf.js"]:::build
        BABEL[".babelrc"]:::build
    end

    %% Deployment / Hosting
    subgraph "Deployment / Hosting"
        direction TB
        STATIC_SERVER["Static Server / CDN"]:::deploy
    end

    %% Browser Runtime
    subgraph "Browser Runtime"
        direction TB
        subgraph "Vue.js App"
            direction TB
            ENTRY["App Entry (main.js & App.vue)"]:::runtime
            ROUTER["Vue Router"]:::runtime
            STORE["Vuex Store"]:::runtime
            SERVICES["Services Layer"]:::runtime
            COMP_LAY["Component Layer"]:::runtime
            UI_LIB["UI Component Library"]:::runtime
            ASSETS["Assets & Styles"]:::runtime
        end
    end

    %% External Services
    subgraph "External Services"
        direction TB
        API["Question API Endpoint"]:::external
        ANALYTICS["Analytics / Logging"]:::external
    end

    %% Connections
    DEV_NODE --> DEV_SCRIPTS
    DEV_SCRIPTS --> WP_BASE
    DEV_SCRIPTS --> WP_DEV
    DEV_SCRIPTS --> WP_PROD
    DEV_SCRIPTS --> BABEL

    WP_BASE --> STATIC_SERVER
    WP_DEV --> STATIC_SERVER
    WP_PROD --> STATIC_SERVER
    BABEL --> STATIC_SERVER

    STATIC_SERVER --> ENTRY

    ENTRY --> ROUTER
    ROUTER --> COMP_LAY
    COMP_LAY --> STORE
    STORE --> SERVICES
    SERVICES --> API
    API --> SERVICES
    SERVICES --> STORE
    STORE --> COMP_LAY
    COMP_LAY --> ASSETS
    COMP_LAY --> UI_LIB

    ANALYTICS --> ENTRY

    %% Click Events
    click WP_BASE "https://github.com/tvrrdfn/math-papers/blob/master/build/webpack.base.conf.js"
    click WP_DEV "https://github.com/tvrrdfn/math-papers/blob/master/build/webpack.dev.conf.js"
    click WP_PROD "https://github.com/tvrrdfn/math-papers/blob/master/build/webpack.prod.conf.js"
    click BABEL "https://github.com/tvrrdfn/math-papers/blob/master/.babelrc"
    click ROUTER "https://github.com/tvrrdfn/math-papers/blob/master/src/router/index.js"
    click ENTRY "https://github.com/tvrrdfn/math-papers/blob/master/src/main.js"
    click ENTRY "https://github.com/tvrrdfn/math-papers/blob/master/src/App.vue"
    click STORE "https://github.com/tvrrdfn/math-papers/blob/master/src/store/index.js"
    click STORE "https://github.com/tvrrdfn/math-papers/blob/master/src/store/main/index.js"
    click STORE "https://github.com/tvrrdfn/math-papers/blob/master/src/store/main/main.actions.js"
    click STORE "https://github.com/tvrrdfn/math-papers/blob/master/src/store/main/main.mutations.js"
    click STORE "https://github.com/tvrrdfn/math-papers/blob/master/src/store/mutation-types.js"
    click SERVICES "https://github.com/tvrrdfn/math-papers/blob/master/src/services/questions.services.js"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/Main.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/Papers.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/break-down/break-down.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/questions/index.js"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/questions/completion.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/questions/compare.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/questions/break-down.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/test-paper/test-paper.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/main-aside/main-aside.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/main-aside/question-box.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/main-body/main-body.vue"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/configs/question-type.configs.js"
    click COMP_LAY "https://github.com/tvrrdfn/math-papers/blob/master/src/components/configs/completion.config.js"
    click UI_LIB "https://github.com/tvrrdfn/math-papers/blob/master/src/ui/index.js"
    click UI_LIB "https://github.com/tvrrdfn/math-papers/blob/master/src/ui/pt-button.vue"
    click UI_LIB "https://github.com/tvrrdfn/math-papers/blob/master/src/ui/pt-modal.vue"
    click UI_LIB "https://github.com/tvrrdfn/math-papers/blob/master/src/ui/components/dragkit/dragkit.vue"
    click UI_LIB "https://github.com/tvrrdfn/math-papers/blob/master/src/ui/components/dropdown/dropdown.vue"
    click UI_LIB "https://github.com/tvrrdfn/math-papers/blob/master/src/ui/components/flowgrid/flowgrid.vue"
    click ASSETS "https://github.com/tvrrdfn/math-papers/tree/master/src/assets/"
    click ASSETS "https://github.com/tvrrdfn/math-papers/tree/master/static/"
    click ASSETS "https://github.com/tvrrdfn/math-papers/blob/master/src/styles/index.scss"
    click ASSETS "https://github.com/tvrrdfn/math-papers/blob/master/src/styles/framework/_variables.scss"
    click ASSETS "https://github.com/tvrrdfn/math-papers/blob/master/src/styles/questions.sass"
    click ASSETS "https://github.com/tvrrdfn/math-papers/tree/master/src/utils/"
    click UI_LIB "https://github.com/tvrrdfn/math-papers/tree/master/src/ui/utils/"

    %% Styles
    classDef build fill:#bbdefb,stroke:#0d47a1,stroke-width:1px;
    classDef deploy fill:#c8e6c9,stroke:#1b5e20,stroke-width:1px;
    classDef runtime fill:#ffe0b2,stroke:#e65100,stroke-width:1px;
    classDef external fill:#ffcdd2,stroke:#b71c1c,stroke-width:1px;
    classDef devenv fill:#e1bee7,stroke:#4a148c,stroke-width:1px;
```
