# leileisme/sclub-front architecture

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

- Interactive diagram: https://gitdiagram.com/leileisme/sclub-front
- Repository: https://github.com/leileisme/sclub-front

## Overview

##### Project type and purpose
- This is a Vue-based Single Page Application (SPA) called “SClub,” a student-club social community front end. It consumes a separate backend API (see README link to SClub-backend) and is deployed as a static site (GitHub Pages / free hosting).

##### File structure
- Top-level config files (.env.development, vite.config.js, ts/jsconfig, ESLint, Prettier) indicate a modern JavaScript toolchain.
- “src/” contains the core Vue app:
- src/main.js boots the app, registers plugins (Vuetify, Axios wrapper, mitt).
- src/router/ defines all SPA routes under front and admin paths.
- src/store/ (Vuex) holds global state modules (user, etc.).
- src/layouts/ distinguishes AdminLayout vs FrontLayout.
- src/views/ are route-level page components under admin, front, text.
- src/components/ are reusable UI bits (AddEvent, TicketView, PersonalView subtrees).
- src/composables/ wrap common logic (axios instance, logout, event bus, routeUser guard).
- src/enums/ define shared constants.
- src/plugins/ configure third-party libraries (Vuetify theme, mitt, etc.).
- src/assets/ and global.css for styling and static HTML samples.
- canvas/ and public/ hold demo pages and PWA manifest/ assets for splashscreens.

##### README
- Confirms front-to-back integration, login credentials, hosting caveats, and links to live site and backend repo.
- Illustrative screenshots hint at features: user registration/login, event browsing, ticket management, personal club management, admin dashboard.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["End User"]:::external -->|opens SPA| Browser["Browser"]:::external
    subgraph "Static Hosting"
        GH["GitHub Pages"]:::infra
    end
    GH -->|serves assets| Browser

    Browser -->|requests SPA assets| SPA["SClub SPA"]:::container

    subgraph "SClub SPA"
        subgraph "Presentation Layer" 
            LayoutAdmin["AdminLayout"]:::ui
            LayoutFront["FrontLayout"]:::ui
            subgraph "Views (Front)"
                HV["HomeView"]:::ui
                LV["LoginView"]:::ui
                RegV["RegisterView"]:::ui
                PostV["PostView"]:::ui
                PersV["PersonalView"]:::ui
                EventV["EventView"]:::ui
                TickV["TicketView"]:::ui
                TickUsed["TicketUsed"]:::ui
            end
            subgraph "Views (Admin)"
                AdminHV["Admin HomeView"]:::ui
            end
            NotFound["NotFoundView"]:::ui
            subgraph "Text Samples"
                DPV["DataPicker測試"]:::ui
                EDV["EventDate"]:::ui
            end
        end

        subgraph "Components"
            AddEvent["AddEvent"]:::ui
            AddMenu["AddMenu"]:::ui
            Blank["BlankLine"]:::ui
            InfoAll["InfoAll"]:::ui
            TimePost["TimePost"]:::ui
            subgraph "EventView subtree"
                HostCard["EventHostCard"]:::ui
                EventInfo["EventInfo"]:::ui
                EventSet["EventSetList"]:::ui
                IsEvent["IsEvent"]:::ui
            end
            subgraph "PersonalView subtree"
                ClubMember["ClubMember"]:::ui
                EditClub["EditClub"]:::ui
                EventMenu["EventMenu"]:::ui
                FollowNum["FollowNumber"]:::ui
                NPersonal["NPersonalClub"]:::ui
                PersonalClub["PersonalClub"]:::ui
                PostEventComp["PostEvent"]:::ui
                SchoolName["SchoolName"]:::ui
                SettingsMenu["SettingsMenu"]:::ui
                SettingsMenuOther["SettingsMenuOther"]:::ui
                StatusBtn["StatusBtn"]:::ui
            end
            subgraph "TicketView subtree"
                IsTicket["IsTicket"]:::ui
                TicketAppBar["TicketAppBar"]:::ui
                TicketDate["TicketDate"]:::ui
            end
        end

        subgraph "State & Logic"
            Store["Vuex Store"]:::state
            Router["vue-router"]:::state
            Plugins["Plugins"]:::state
            Composables["Composables"]:::state
        end

        subgraph "Build & Config"
            Env[".env.development"]:::infra
            Vite["vite.config.js"]:::infra
            JSConfig["jsconfig.json"]:::infra
            ESLint[".eslintrc.js"]:::infra
            Prettier[".prettierrc"]:::infra
            Package["package.json"]:::infra
        end

        subgraph "Assets & Hosting Prep"
            Assets["src/assets & css"]:::infra
            PWA["public (PWA)"]:::infra
            Canvas["canvas pages"]:::infra
        end
    end

    SPA -->|"navigate"| Router
    Router -->|"route guard"| Composables
    SPA -->|"commits/actions"| Store
    Store -->|"calls"| Composables
    Composables -->|"HTTP calls via Axios"| API["Backend API"]:::api
    API -->|reads/writes| DB["Database"]:::infra
    DB -->|returns JSON| API
    API -->|responds| Composables
    Composables -->|dispatch| Store
    Store -->|updates UI| SPA

    classDef ui fill:#E3F2FD,stroke:#2196F3,color:#0D47A1;
    classDef state fill:#E8F5E9,stroke:#4CAF50,color:#1B5E20;
    classDef api fill:#FFF3E0,stroke:#FB8C00,color:#E65100;
    classDef infra fill:#F5F5F5,stroke:#9E9E9E,color:#424242;
    classDef external fill:#FCE4EC,stroke:#EC407A,color:#880E4F;
    classDef container stroke:#000,stroke-width:2px;

    click LayoutAdmin "https://github.com/leileisme/sclub-front/blob/main/src/layouts/AdminLayout.vue"
    click LayoutFront "https://github.com/leileisme/sclub-front/blob/main/src/layouts/FrontLayout.vue"
    click HV "https://github.com/leileisme/sclub-front/blob/main/src/views/front/HomeView.vue"
    click LV "https://github.com/leileisme/sclub-front/blob/main/src/views/front/LoginView.vue"
    click RegV "https://github.com/leileisme/sclub-front/blob/main/src/views/front/RegisterView.vue"
    click PostV "https://github.com/leileisme/sclub-front/blob/main/src/views/front/PostView.vue"
    click PersV "https://github.com/leileisme/sclub-front/blob/main/src/views/front/PersonalView.vue"
    click EventV "https://github.com/leileisme/sclub-front/blob/main/src/views/front/EventView.vue"
    click TickV "https://github.com/leileisme/sclub-front/blob/main/src/views/front/TicketView.vue"
    click TickUsed "https://github.com/leileisme/sclub-front/blob/main/src/views/front/TicketUsed.vue"
    click AdminHV "https://github.com/leileisme/sclub-front/blob/main/src/views/admin/HomeView.vue"
    click NotFound "https://github.com/leileisme/sclub-front/blob/main/src/views/NotFoundView.vue"
    click DPV "https://github.com/leileisme/sclub-front/blob/main/src/views/text/DataPicker測試.vue"
    click EDV "https://github.com/leileisme/sclub-front/blob/main/src/views/text/EventDate.vue"
    click AddEvent "https://github.com/leileisme/sclub-front/blob/main/src/components/AddEvent.vue"
    click AddMenu "https://github.com/leileisme/sclub-front/blob/main/src/components/AddMenu.vue"
    click Blank "https://github.com/leileisme/sclub-front/blob/main/src/components/BlankLine.vue"
    click InfoAll "https://github.com/leileisme/sclub-front/blob/main/src/components/InfoAll.vue"
    click TimePost "https://github.com/leileisme/sclub-front/blob/main/src/components/TimePost.vue"
    click HostCard "https://github.com/leileisme/sclub-front/blob/main/src/components/EventView/EventHostCard.vue"
    click EventInfo "https://github.com/leileisme/sclub-front/blob/main/src/components/EventView/EventInfo.vue"
    click EventSet "https://github.com/leileisme/sclub-front/blob/main/src/components/EventView/EventSetList.vue"
    click IsEvent "https://github.com/leileisme/sclub-front/blob/main/src/components/EventView/IsEvent.vue"
    click ClubMember "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/ClubMember.vue"
    click EditClub "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/EditClub.vue"
    click EventMenu "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/EventMenu.vue"
    click FollowNum "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/FollowNumber.vue"
    click NPersonal "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/NPersonalClub.vue"
    click PersonalClub "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/PersonalClub.vue"
    click PostEventComp "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/PostEvent.vue"
    click SchoolName "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/SchoolName.vue"
    click SettingsMenu "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/SettingsMenu.vue"
    click SettingsMenuOther "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/SettingsMenuOther.vue"
    click StatusBtn "https://github.com/leileisme/sclub-front/blob/main/src/components/PersonalView/StatusBtn.vue"
    click IsTicket "https://github.com/leileisme/sclub-front/blob/main/src/components/TicketView/IsTicket.vue"
    click TicketAppBar "https://github.com/leileisme/sclub-front/blob/main/src/components/TicketView/TicketAppBar.vue"
    click TicketDate "https://github.com/leileisme/sclub-front/blob/main/src/components/TicketView/TicketDate.vue"
    click Store "https://github.com/leileisme/sclub-front/blob/main/src/store/index.js"
    click Router "https://github.com/leileisme/sclub-front/blob/main/src/router/index.js"
    click Plugins "https://github.com/leileisme/sclub-front/blob/main/src/plugins/index.js"
    click Vite "https://github.com/leileisme/sclub-front/blob/main/vite.config.js"
    click Env "https://github.com/leileisme/sclub-front/blob/main/ .env.development"
    click JSConfig "https://github.com/leileisme/sclub-front/blob/main/jsconfig.json"
    click ESLint "https://github.com/leileisme/sclub-front/blob/main/.eslintrc.js"
    click Prettier "https://github.com/leileisme/sclub-front/blob/main/.prettierrc"
    click Package "https://github.com/leileisme/sclub-front/blob/main/package.json"
    click Composables "https://github.com/leileisme/sclub-front/blob/main/src/composables/axios.js"
    click Assets "https://github.com/leileisme/sclub-front/tree/main/src/assets/"
    click PWA "https://github.com/leileisme/sclub-front/tree/main/public/"
    click Canvas "https://github.com/leileisme/sclub-front/tree/main/canvas/"
```
