# angelabauer/python-coding-challenges architecture

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

- Interactive diagram: https://gitdiagram.com/angelabauer/python-coding-challenges
- Repository: https://github.com/angelabauer/python-coding-challenges

## Overview

##### Project type and purpose
- This is a React‐based Single‐Page Application (SPA) that renders a set of Python coding challenges entirely in the browser.
- It ships as a static site (build/ folder) and is designed to be hosted (e.g., GitHub Pages).
- Content (all challenges and metadata) lives in the challenges/ folder and is preprocessed by a Node.js script into a combined JSON that the client consumes.

##### File structure
- Top-Level:
- package.json, package-lock.json – front-end dependencies and scripts
- public/ – static HTML and manifest for the SPA
- src/ – React source code (components, styles, assets)
- build/ – output of `npm run build` (static HTML, CSS, JS bundles)
- challenges/ – individual challenge directories (lesson.md, lesson_settings.json, lesson_tests.py, main.py)
- generate-challenge-json.js – Node script that reads challenges/ and emits a single challenges.json

##### README for additional insights
- The generate-challenge-json.js script consolidates lessons into a JSON that the React app imports.
- Running locally involves `npm install`, `npm start`, and for production `npm run build`.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Source
    challengeContent["challenges/ (Raw Challenges)"]:::data
    classroomSettings["classroom_settings.json"]:::data

    %% Build-time Generation
    genScript["generate-challenge-json.js"]:::buildTime

    %% Generated Data
    generatedData["src/challenges.json"]:::data

    %% Frontend Source
    pkg["package.json"]:::buildTime
    publicHTML["public/index.html"]:::frontend
    publicManifest["public/manifest.json"]:::frontend
    entry["src/index.js"]:::frontend
    regSW["src/registerServiceWorker.js"]:::frontend
    app["src/App.js"]:::frontend
    nav["src/Navbar.js"]:::frontend
    mapComp["src/Map.js"]:::frontend
    challengeView["src/ChallengeView.js"]:::frontend
    getStarted["src/GetStarted.js"]:::frontend
    complete["src/CurriculumComplete.js"]:::frontend
    styles["src/styles/"]:::frontend
    eslint[".eslintrc.yml"]:::config

    %% Build Output & Hosting
    buildOutput["build/ (Static Site)"]:::hosting
    staticHost["Static Hosting (GitHub Pages, Netlify, S3)"]:::hosting

    %% Browser & Runtime
    browser["Browser"]:::frontend
    serviceWorker["Service Worker"]:::frontend

    %% Relationships
    challengeContent -->|edits| genScript
    classroomSettings -->|reads| genScript
    genScript -->|generates| generatedData

    generatedData & entry & regSW & app & nav & mapComp & challengeView & getStarted & complete & styles & publicHTML & publicManifest & pkg -->|bundle via Webpack| buildOutput

    buildOutput -->|deploy| staticHost
    staticHost -->|serves| browser
    browser -->|fetches| staticHost

    browser -->|registers| serviceWorker
    browser -->|runs| app
    serviceWorker -->|caches| buildOutput

    %% Click Events
    click challengeContent "https://github.com/angelabauer/python-coding-challenges/tree/master/challenges/"
    click classroomSettings "https://github.com/angelabauer/python-coding-challenges/blob/master/classroom_settings.json"
    click genScript "https://github.com/angelabauer/python-coding-challenges/blob/master/generate-challenge-json.js"
    click generatedData "https://github.com/angelabauer/python-coding-challenges/blob/master/src/challenges.json"
    click pkg "https://github.com/angelabauer/python-coding-challenges/blob/master/package.json"
    click publicHTML "https://github.com/angelabauer/python-coding-challenges/blob/master/public/index.html"
    click publicManifest "https://github.com/angelabauer/python-coding-challenges/blob/master/public/manifest.json"
    click entry "https://github.com/angelabauer/python-coding-challenges/blob/master/src/index.js"
    click regSW "https://github.com/angelabauer/python-coding-challenges/blob/master/src/registerServiceWorker.js"
    click app "https://github.com/angelabauer/python-coding-challenges/blob/master/src/App.js"
    click nav "https://github.com/angelabauer/python-coding-challenges/blob/master/src/Navbar.js"
    click mapComp "https://github.com/angelabauer/python-coding-challenges/blob/master/src/Map.js"
    click challengeView "https://github.com/angelabauer/python-coding-challenges/blob/master/src/ChallengeView.js"
    click getStarted "https://github.com/angelabauer/python-coding-challenges/blob/master/src/GetStarted.js"
    click complete "https://github.com/angelabauer/python-coding-challenges/blob/master/src/CurriculumComplete.js"
    click styles "https://github.com/angelabauer/python-coding-challenges/tree/master/src/styles/"
    click eslint "https://github.com/angelabauer/python-coding-challenges/blob/master/.eslintrc.yml"
    click buildOutput "https://github.com/angelabauer/python-coding-challenges/tree/master/build/"

    %% Styles
    classDef buildTime fill:#add8e6,stroke:#000
    classDef data fill:#ffa500,stroke:#000
    classDef frontend fill:#90ee90,stroke:#000
    classDef hosting fill:#dda0dd,stroke:#000
    classDef config fill:#f0e68c,stroke:#000
```
