# trong678112/scaduwingheroes architecture

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

- Interactive diagram: https://gitdiagram.com/trong678112/scaduwingheroes
- Repository: https://github.com/trong678112/scaduwingheroes

## Overview

##### Project type and purpose
- This is a single-page web application (SPA) built with React and Vite.
- It’s primarily a front-end project: there is no custom backend or microservice code here; instead static JSON files, images, a PDF guide, and an audio file live in the public folder.
- The app appears to serve pages for card scanning, library management, a user guide, etc., pulling data from `public/database.json` and `public/library-cards.json`.

##### File structure
- Top level:
- `index.html` – application shell
- `package.json` & `vite.config.js` – build and dev-server config
- `eslint.config.js` – linting rules
- `vercel.json` – deployment configuration for Vercel
- `public/`: static assets served unchanged (JSON, PDF, images, music)
- `src/`: React source
- `main.jsx` – React application entry point
- `App.jsx` & `App.css` – root component
- `components/` – shared UI elements (Header, Footer)
- `pages/` – route-specific views (Home, CardPage, GuidePage, LibraryPage, ScanPage)
- `assets/` – any additional images/CSS you might add

##### README for additional insights
- Confirms use of Vite with React HMR, ESLint plugins.
- No backend; suggests production recommendation if migrating to TypeScript but currently JavaScript only.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Development Environment"
        VITE["Vite Dev Server"]:::devtools
        ESLINT["ESLint Config"]:::devtools
        VITE --> ESLINT
    end
    click VITE "https://github.com/trong678112/scaduwingheroes/blob/master/vite.config.js"
    click ESLINT "https://github.com/trong678112/scaduwingheroes/blob/master/eslint.config.js"

    subgraph "Build Pipeline"
        PACKAGE["package.json"]:::pipeline
        LOCK["package-lock.json"]:::pipeline
        HTMLTPL["index.html"]:::pipeline
        VITEBUILD["Vite Bundler"]:::pipeline
        PRODART["Production Artifacts"]:::pipeline
        PACKAGE --> VITEBUILD
        LOCK --> VITEBUILD
        HTMLTPL --> VITEBUILD
        VITEBUILD --> PRODART
    end
    click PACKAGE "https://github.com/trong678112/scaduwingheroes/blob/master/package.json"
    click LOCK "https://github.com/trong678112/scaduwingheroes/blob/master/package-lock.json"
    click HTMLTPL "https://github.com/trong678112/scaduwingheroes/blob/master/index.html"

    subgraph "React Application"
        MAIN["main.jsx"]:::runtime
        APPCOM["App.jsx"]:::runtime
        APPCSS["App.css"]:::runtime
        ROUTER["Routing Layer"]:::runtime
        MAIN --> APPCOM
        APPCOM --> ROUTER
        APPCOM --> APPCSS
    end
    click MAIN "https://github.com/trong678112/scaduwingheroes/blob/master/src/main.jsx"
    click APPCOM "https://github.com/trong678112/scaduwingheroes/blob/master/src/App.jsx"
    click APPCSS "https://github.com/trong678112/scaduwingheroes/blob/master/src/App.css"

    subgraph "Shared Components"
        HEADER["Header"]:::components
        FOOTER["Footer"]:::components
    end
    click HEADER "https://github.com/trong678112/scaduwingheroes/blob/master/src/components/Header.jsx"
    click HEADER "https://github.com/trong678112/scaduwingheroes/blob/master/src/components/Header.css"
    click FOOTER "https://github.com/trong678112/scaduwingheroes/blob/master/src/components/Footer.jsx"
    click FOOTER "https://github.com/trong678112/scaduwingheroes/blob/master/src/components/Footer.css"

    subgraph "Page Components"
        HOME["HomePage"]:::components
        CARDP["CardPage"]:::components
        LIB["LibraryPage"]:::components
        GUIDE["GuidePage"]:::components
        SCAN["ScanPage"]:::components
    end
    click HOME "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/HomePage.jsx"
    click HOME "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/HomePage.css"
    click CARDP "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/CardPage.jsx"
    click CARDP "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/CardPage.css"
    click LIB "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/LibraryPage.jsx"
    click LIB "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/LibraryPage.css"
    click GUIDE "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/GuidePage.jsx"
    click GUIDE "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/GuidePage.css"
    click SCAN "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/ScanPage.jsx"
    click SCAN "https://github.com/trong678112/scaduwingheroes/blob/master/src/pages/ScanPage.css"

    subgraph "Static Assets (public/)"
        JSON1["database.json"]:::assets
        JSON2["library-cards.json"]:::assets
        PDF["guide.pdf"]:::assets
        IMAGES["images/"]:::assets
        CARDS["images/cards/"]:::assets
        AUDIO["theme-song.mp3"]:::assets
    end
    click JSON1 "https://github.com/trong678112/scaduwingheroes/blob/master/public/database.json"
    click JSON2 "https://github.com/trong678112/scaduwingheroes/blob/master/public/library-cards.json"
    click PDF "https://github.com/trong678112/scaduwingheroes/blob/master/public/guide.pdf"
    click IMAGES "https://github.com/trong678112/scaduwingheroes/tree/master/public/images/"
    click CARDS "https://github.com/trong678112/scaduwingheroes/tree/master/public/images/cards/"
    click AUDIO "https://github.com/trong678112/scaduwingheroes/blob/master/public/music/theme-song.mp3"

    subgraph "Deployment"
        GIT["Git Repo"]:::deployment
        VERCEL["Vercel CI/CD"]:::deployment
        HOST["Static Host"]:::deployment
        GIT --> VERCEL --> HOST
    end
    click VERCEL "https://github.com/trong678112/scaduwingheroes/blob/master/vercel.json"

    HOST -->|"Serves Production Artifacts & Static Assets"| BROWSER
    PRODART --> BROWSER["Browser"]:::external
    BROWSER -->|"HTTP GET index.html"| HOST
    BROWSER -->|"Fetch JS/CSS Bundles"| HOST

    HOME -->|"GET /database.json"| JSON1
    LIB -->|"GET /library-cards.json"| JSON2
    GUIDE -->|"Load PDF"| PDF
    SCAN -->|"Load images & audio"| IMAGES
    SCAN -->|"Load images & audio"| AUDIO

    classDef devtools fill:#ffcccc,stroke:#b33;
    classDef pipeline fill:#ccf,stroke:#33b;
    classDef runtime fill:#cfc,stroke:#3b3;
    classDef components fill:#ffc,stroke:#bb3;
    classDef assets fill:#cff,stroke:#3b5;
    classDef deployment fill:#fcf,stroke:#b3b;
    classDef external fill:#eee,stroke:#888;
```
