# krakinme/gla-leaderboard architecture

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

- Interactive diagram: https://gitdiagram.com/krakinme/gla-leaderboard
- Repository: https://github.com/krakinme/gla-leaderboard

## Overview

##### Project type and purpose
- The frontend lives under a `frontend/` directory (HTML, JS, CSS), and there is a Node.js entry point (`index.js`) at the root with a `package.json`, so it’s likely a Node.js-based backend that serves both static assets and dynamic data for a leaderboard.
- The various `data_*.json` files and `details_*` directories suggest that the app reads from flat-file JSON and text sources to populate leaderboard entries.

##### File structure
Top-level directories and files:
- `frontend/` – contains `index.html`, `index.js`, and `styles.css`.
- `admin.html` – a standalone admin UI page for uploading or viewing raw data.
- `data_January.json`, `data_Second.json`, `data_September.json` – JSON data sources for different time periods.
- `details_January/`, `details_Second/`, `details_September/` – beneath each, plain text files (day.txt, mobno.txt, name.txt, roll.txt, sections.txt, urls.txt) hold granular data fields.
- `index.js` – Node.js server script.
- `package.json` – lists dependencies and scripts.

Architectural patterns:
- MVC-light: the Node.js script likely acts as the controller, file system + JSON serve as the model, and the HTML/JS frontends are the views.
- Static-file and dynamic-data hybrid: a single service (Express or HTTP server) handles both.

##### README for additional insights
- README only states project title and its purpose (“GLA-LeaderBoard for TBPPP”) without deep architectural notes, so we rely on the file tree for details.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser Layer
    subgraph "Browser (User)" 
        direction TB
        Browser["Web Browser"]:::frontend
        FE_App["Frontend Application"]:::frontend
        AdminUI["Admin Interface"]:::frontend
    end

    %% Frontend Assets
    subgraph "Frontend Assets" 
        direction TB
        HTML["index.html"]:::frontend
        JS["index.js"]:::frontend
        CSS["styles.css"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Server" 
        direction TB
        Server["Node.js Server"]:::backend
        Entry["index.js"]:::backend
        Config["package.json"]:::backend
    end

    %% Data Storage Layer
    subgraph "Data Store (File System)"
        direction TB
        JSONData["JSON Leaderboard Data"]:::storage
        Details["Detailed Text Records"]:::storage
    end

    %% JSON Files
    subgraph "JSON Files" 
        direction TB
        DataJan["data_January.json"]:::storage
        DataSec["data_Second.json"]:::storage
        DataSep["data_September.json"]:::storage
    end

    %% Details Directories
    subgraph "Details Directories" 
        direction TB
        DirJan["details_January/"]:::storage
        DirSec["details_Second/"]:::storage
        DirSep["details_September/"]:::storage
    end

    %% Connections
    Browser -->|"Loads Application"| Server
    Server -->|"Serves index.html"| HTML
    Server -->|"Serves styles.css"| CSS
    Server -->|"Serves index.js"| JS
    Browser -->|"GET /"| HTML
    Browser -->|"GET /styles.css"| CSS
    Browser -->|"GET /index.js"| JS
    Browser -->|"GET /admin.html"| AdminUI
    AdminUI -->|"Loads Admin UI"| Server

    Browser -->|"API: GET /api/leaderboard?month=... "| Server
    Server -->|"Read JSON files"| JSONData
    Server -->|"Read detail directories"| Details
    JSONData -->|"data_January.json, etc."| DataJan
    JSONData --> DataSec
    JSONData --> DataSep
    Details --> DirJan
    Details --> DirSec
    Details --> DirSep
    DirJan -->|"day.txt, name.txt, etc."| Server
    DirSec --> Server
    DirSep --> Server
    Server -->|"API Response (JSON)"| Browser

    %% Click Events
    click HTML "https://github.com/krakinme/gla-leaderboard/blob/main/frontend/index.html"
    click JS "https://github.com/krakinme/gla-leaderboard/blob/main/frontend/index.js"
    click CSS "https://github.com/krakinme/gla-leaderboard/blob/main/frontend/styles.css"
    click AdminUI "https://github.com/krakinme/gla-leaderboard/blob/main/admin.html"
    click Entry "https://github.com/krakinme/gla-leaderboard/blob/main/index.js"
    click Config "https://github.com/krakinme/gla-leaderboard/blob/main/package.json"
    click DataJan "https://github.com/krakinme/gla-leaderboard/blob/main/data_January.json"
    click DataSec "https://github.com/krakinme/gla-leaderboard/blob/main/data_Second.json"
    click DataSep "https://github.com/krakinme/gla-leaderboard/blob/main/data_September.json"
    click DirJan "https://github.com/krakinme/gla-leaderboard/tree/main/details_January/"
    click DirSec "https://github.com/krakinme/gla-leaderboard/tree/main/details_Second/"
    click DirSep "https://github.com/krakinme/gla-leaderboard/tree/main/details_September/"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef backend fill:#E8FFE0,stroke:#28a745,color:#28a745
    classDef storage fill:#FFF4D6,stroke:#ffab00,color:#ff8c00
```
