# abhishek-sharma182005/codequest-100-days-dsa architecture

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

- Interactive diagram: https://gitdiagram.com/abhishek-sharma182005/codequest-100-days-dsa
- Repository: https://github.com/abhishek-sharma182005/codequest-100-days-dsa

## Overview

##### Project Type and Purpose
- This is an open-source “challenge platform” repository (CodeQuest) that hosts a 100-day DSA coding challenge.
- It is primarily a static frontend (HTML/CSS/JS) plus a Python script and JSON file for scoring, all orchestrated via GitHub Actions workflows.

##### File Structure
- Top-level:
- index.html, style.css, script.js – static UI
- daily_pr_points.py (or daily_pr_points.py) – Python scoring logic
- points.json – persistent leaderboard data
- .github/workflows/… – CI/CD pipelines (automated scoring, merges, score updates)
- submissions/… – per-participant code submissions (PR source)
- README.md describes folder structure and submission guidelines.
- No traditional “backend” server: scoring is done in CI runners and results stored in JSON.

##### README Insights
- Explains submission flow (fork → PR), scoring rules, weekly/daily points.
- Mentions a leaderboard updated weekly.

##### Main Components
a. GitHub Repository
- Hosts code, static site, submissions folder, scoring script, JSON.
b. GitHub Actions CI/CD
- Multiple workflows:
- daily scoring (`update_score.yml`)
- manual triggers (`manual.yml`, `Manual_with_points.yml`)
- auto-merge PRs (`auto_merge.yml`)
c. Scoring Engine (Python)
- daily_pr_points.py runs in CI runner
- Reads submissions, computes points according to rules, writes to points.json
d. Data Store (JSON)
- points.json stores current leaderboard data
e. Static Frontend
- index.html + style.css + script.js served via GitHub Pages
- script.js fetches points.json to render leaderboard
f. External Services
- GitHub API (for PR events, file updates, commits)
- GitHub Pages hosting

##### Relationships and Data Flow
1. User forks repo & submits solution via PR → PR event triggers GitHub Actions.
2. CI Workflow (`Manual_with_points` or `auto_merge`) reviews/merges PR.
3. Scheduled CI Workflow (`update_score.yml`) runs daily:
- Checks out repo
- Executes daily_pr_points.py
- Updates points.json
- Commits & pushes updated JSON
4. GitHub Pages picks up updated index.html + points.json → user views refreshed leaderboard.
5. script.js fetches points.json at runtime to display charts/tables.

##### Key Architectural Patterns
- Event-driven (GitHub Event → Actions workflows)
- CI/CD as “backend” compute layer
- GitOps approach: all data + state (leaderboard) versioned in JSON in the repo
- Static site generation / hosting via GitHub Pages

##### Technologies & Libraries
- Static: HTML5, CSS3, Vanilla JS (fetch API)
- Compute: Python 3 script (daily_pr_points.py)
- Storage: points.json (flat file)
- Orchestration: GitHub Actions
- Hosting: GitHub Pages
- Version control & API: Git, GitHub PR hooks

##### Detailed Capture of Essential Elements
- Workflows directory as a component under CI/CD
- Points.json as version-controlled state
- Distinguish between “developer/participant” actor and “mentor/reviewer” if desired
- Use of GitHub API for automated merges and commits

## Diagram (Mermaid)

```mermaid
graph TD
    Dev["Developer/Participant"]:::actor
    Repo["CodeQuest Repo"]:::github
    Actions["GitHub Actions"]:::github
    Pages["GitHub Pages"]:::github
    External["GitHub API"]:::external

    Submissions["submissions/"]:::data
    README["README.md"]:::docs
    LIC["LICENSE"]:::docs
    GIT[".gitignore"]:::docs

    HTML["index.html"]:::frontend
    CSS["style.css"]:::frontend
    JS["script.js"]:::frontend

    Python["daily_pr_points.py"]:::compute
    JSON["points.json"]:::dataStore

    W1["update_score.yml"]:::workflow
    W2["manual.yml"]:::workflow
    W3["Manual_with_points.yml"]:::workflow
    W4["auto_merge.yml"]:::workflow
    W5["main1.yml"]:::workflow

    Dev -->|fork & PR Submit| Repo
    Repo -->|contains| Submissions
    Repo -->|contains| README
    Repo -->|contains| LIC
    Repo -->|contains| GIT
    Repo -->|contains| HTML
    Repo -->|contains| CSS
    Repo -->|contains| JS
    Repo -->|contains| Python
    Repo -->|contains| JSON
    Repo -->|contains| W1
    Repo -->|contains| W2
    Repo -->|contains| W3
    Repo -->|contains| W4
    Repo -->|contains| W5

    Repo -->|PR Event on: pull_request| Actions
    Actions -->|runs scoring workflow| W1
    Actions -->|runs manual workflows| W2
    Actions -->|runs manual workflows| W3
    Actions -->|runs auto-merge workflow| W4
    Actions -->|runs other workflow| W5

    Actions -->|runs script| Python
    Python -->|writes leaderboard| JSON
    Actions -->|commit & push updated JSON| Repo

    Repo -->|serve static site| Pages
    Pages -->|hosts| HTML
    Pages -->|hosts| CSS
    Pages -->|hosts| JS
    Pages -->|hosts| JSON

    JS -->|fetch points.json| JSON
    Actions -->|calls| External

    classDef github fill:#bbdefb,stroke:#1976d2,color:#0d47a1;
    classDef compute fill:#ffcc80,stroke:#ef6c00,color:#e65100;
    classDef dataStore fill:#a5d6a7,stroke:#2e7d32,color:#1b5e20;
    classDef frontend fill:#fff176,stroke:#f9a825,color:#f57f17;
    classDef workflow fill:#ffe0b2,stroke:#f57c00,color:#e65100;
    classDef data fill:#c8e6c9,stroke:#388e3c,color:#1b5e20;
    classDef docs fill:#e0e0e0,stroke:#757575,color:#424242;
    classDef actor fill:#cfd8dc,stroke:#607d8b,color:#263238;
    classDef external fill:#eceff1,stroke:#90a4ae,color:#455a64;

    click Repo "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/tree/main//"
    click HTML "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//index.html"
    click CSS "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//style.css"
    click JS "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//script.js"
    click Python "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//daily_pr_points.py"
    click JSON "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//points.json"
    click W1 "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//.github/workflows/update_score.yml"
    click W2 "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//.github/workflows/manual.yml"
    click W3 "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//.github/workflows/Manual_with_points.yml"
    click W4 "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//.github/workflows/auto_merge.yml"
    click W5 "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//.github/workflows/main1.yml"
    click Submissions "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/tree/main//submissions/"
    click README "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//README.md"
    click LIC "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/tree/main//LICENSE"
    click GIT "https://github.com/abhishek-sharma182005/codequest-100-days-dsa/blob/main//.gitignore"
```
