# kingkingburger/oinqueue architecture

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

- Interactive diagram: https://gitdiagram.com/kingkingburger/oinqueue
- Repository: https://github.com/kingkingburger/oinqueue

## Overview

##### Project type and purpose
- This is a full-stack web application built with Next.js (13+) using the App Router.
- Purpose: Fetch and display League of Legends summoner and match data (from Riot Games API), render player pages, match cards, champion summaries, etc.

##### File structure
- Top-level config files: next.config.ts, tsconfig.json, bun.lock, package.json – define build and runtime configuration.
- src/app: Next.js App Router entrypoints (layout.tsx, page.tsx, globals.css).
- src/(main)/(player)/page.tsx: dynamic route for individual player pages.
- src/component: reusable React components for UI (cards, headers, separators, lists).
- src/constant: shared constants (e.g. basic.ts).
- src/lib/riotApi: server-side helper functions to call external Riot API (getSummonerInfo, getMatchList, getMatchInfo) plus type definitions.

##### README for additional insights
- Standard Next.js boilerplate, deployed on Vercel, no internal database—data comes directly from Riot API.

##### Elements
- Clear labels: “Browser,” “Next.js App Server,” “src/lib/riotApi,” “Riot Games API,” “CDN / Static Assets”
- Browser → Next.js Server (page request)
- Next.js Server → Riot API (data fetch)
- Riot API → Next.js Server (JSON response)
- Next.js Server → Browser (HTML payload)
- Browser ↔ CDN (assets)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Browser and CDN
    Browser["Browser"]:::external
    CDN["CDN / Static Assets"]:::external
    RiotAPI["Riot Games API"]:::external

    %% Backend Internal
    subgraph "Next.js App Server" 
        direction TB
        subgraph "Routing Layer"
            direction TB
            AppRouter["App Router\nsrc/app"]:::internal
            Layout["layout.tsx"]:::internal
            RootPage["page.tsx (root)"]:::internal
            GlobalsCSS["globals.css"]:::internal
            PlayerRoute["Dynamic Player Route\nsrc/(main)/(player)/page.tsx"]:::internal
        end

        subgraph "Data-Fetching Layer"
            direction TB
            RiotApiLib["src/lib/riotApi"]:::lib
            SummonerFn["getRiotSummonerInfo()"]:::lib
            MatchListFn["getMatchList()"]:::lib
            MatchInfoFn["getMatchInfo()"]:::lib
            MatchTypes["type definitions\nmatchInfoResponse.ts"]:::lib
            Utils["Champion & Utils\nchampionName.ts, utils.ts"]:::lib
        end

        subgraph "Rendering Layer"
            direction TB
            Header["header.tsx"]:::component
            WinList["summonerWinList.tsx"]:::component
            RecentMatches["recentMatches.tsx"]:::component
            MatchCard["matchCard.tsx"]:::component
            ChampSummary["championSummary.tsx"]:::component
            PlayHist["playHistory.tsx"]:::component
            IssueBar["issueBar.tsx"]:::component
            SmallDisplay["smallDataDisplay.tsx"]:::component
            CardSection["cardSection.tsx"]:::component
            LargePlaceholder["largePlaceholderCard.tsx"]:::component
            Separator["dotted-separator.tsx"]:::component
        end

        subgraph "Constants"
            direction TB
            BasicConst["basic.ts"]:::constant
        end
    end

    subgraph "Configuration"
        direction TB
        NextConfig["next.config.ts"]:::config
        TSConfig["tsconfig.json"]:::config
        BunLock["bun.lock"]:::config
        PackageJSON["package.json"]:::config
        PostCSS["postcss.config.mjs"]:::config
    end

    %% Flows
    Browser -->|HTTP GET /player| AppRouter
    AppRouter --> Layout
    Layout --> RootPage
    AppRouter --> PlayerRoute
    PlayerRoute -->|calls| SummonerFn
    PlayerRoute -->|calls| MatchListFn
    PlayerRoute -->|calls| MatchInfoFn
    SummonerFn -->|HTTP GET| RiotAPI
    MatchListFn -->|HTTP GET| RiotAPI
    MatchInfoFn -->|HTTP GET| RiotAPI
    RiotAPI -->|JSON| RiotApiLib
    RiotApiLib --> PlayerRoute
    PlayerRoute -->|renders| Header
    PlayerRoute --> WinList
    PlayerRoute --> RecentMatches
    PlayerRoute --> ChampSummary
    PlayerRoute --> PlayHist
    PlayerRoute --> IssueBar
    PlayerRoute --> SmallDisplay
    PlayerRoute --> CardSection
    PlayerRoute --> LargePlaceholder
    PlayerRoute --> Separator
    PlayerRoute -->|HTML| Browser

    Browser <-->|fetch assets| CDN

    %% Click events
    click AppRouter "https://github.com/kingkingburger/oinqueue/tree/main/src/app"
    click Layout "https://github.com/kingkingburger/oinqueue/blob/main/src/app/layout.tsx"
    click RootPage "https://github.com/kingkingburger/oinqueue/blob/main/src/app/page.tsx"
    click GlobalsCSS "https://github.com/kingkingburger/oinqueue/blob/main/src/app/globals.css"
    click PlayerRoute "https://github.com/kingkingburger/oinqueue/blob/main/src/(main)/(player)/page.tsx"
    click RiotApiLib "https://github.com/kingkingburger/oinqueue/tree/main/src/lib/riotApi"
    click SummonerFn "https://github.com/kingkingburger/oinqueue/blob/main/src/lib/riotApi/getRiotSummonerInfo.ts"
    click MatchListFn "https://github.com/kingkingburger/oinqueue/blob/main/src/lib/riotApi/getMatchList.ts"
    click MatchInfoFn "https://github.com/kingkingburger/oinqueue/blob/main/src/lib/riotApi/getMatchInfo.ts"
    click MatchTypes "https://github.com/kingkingburger/oinqueue/blob/main/src/lib/riotApi/type/matchInfoResponse.ts"
    click Utils "https://github.com/kingkingburger/oinqueue/blob/main/src/lib/championName.ts"
    click Utils "https://github.com/kingkingburger/oinqueue/blob/main/src/lib/utils.ts"
    click Header "https://github.com/kingkingburger/oinqueue/blob/main/src/component/header.tsx"
    click WinList "https://github.com/kingkingburger/oinqueue/blob/main/src/component/summonerWinList.tsx"
    click RecentMatches "https://github.com/kingkingburger/oinqueue/blob/main/src/component/recentMatches.tsx"
    click MatchCard "https://github.com/kingkingburger/oinqueue/blob/main/src/component/matchCard.tsx"
    click ChampSummary "https://github.com/kingkingburger/oinqueue/blob/main/src/component/championSummary.tsx"
    click PlayHist "https://github.com/kingkingburger/oinqueue/blob/main/src/component/playHistory.tsx"
    click IssueBar "https://github.com/kingkingburger/oinqueue/blob/main/src/component/issueBar.tsx"
    click SmallDisplay "https://github.com/kingkingburger/oinqueue/blob/main/src/component/smallDataDisplay.tsx"
    click CardSection "https://github.com/kingkingburger/oinqueue/blob/main/src/component/cardSection.tsx"
    click LargePlaceholder "https://github.com/kingkingburger/oinqueue/blob/main/src/component/largePlaceholderCard.tsx"
    click Separator "https://github.com/kingkingburger/oinqueue/blob/main/src/component/dotted-separator.tsx"
    click BasicConst "https://github.com/kingkingburger/oinqueue/blob/main/src/constant/basic.ts"

    click NextConfig "https://github.com/kingkingburger/oinqueue/blob/main/next.config.ts"
    click TSConfig "https://github.com/kingkingburger/oinqueue/blob/main/tsconfig.json"
    click BunLock "https://github.com/kingkingburger/oinqueue/blob/main/bun.lock"
    click PackageJSON "https://github.com/kingkingburger/oinqueue/blob/main/package.json"
    click PostCSS "https://github.com/kingkingburger/oinqueue/blob/main/postcss.config.mjs"

    %% Styles
    classDef internal fill:#e0f7fa,stroke:#006064,color:#000
    classDef external fill:#e3f2fd,stroke:#0d47a1,color:#000
    classDef lib fill:#fff3e0,stroke:#e65100,color:#000
    classDef component fill:#f3e5f5,stroke:#4a148c,color:#000
    classDef constant fill:#fce4ec,stroke:#880e4f,color:#000
    classDef config fill:#eceff1,stroke:#37474f,color:#000
```
