# pedal-edu/pedal architecture

> Architecture diagram of the GitHub repository pedal-edu/pedal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pedal-edu/pedal
- Repository: https://github.com/pedal-edu/pedal

## Overview

##### Main Components

a) Core Framework Components:
- Report System (central component)
- Feedback System
- Resolver System
- Environment System
- Tools System

b) Major Tools (represented as modules):
- TIFA (Type Inference Feedback Analysis)
- CAIT (Code Analysis and Inspection Tool)
- Sandbox (Code Execution Environment)
- Assertions
- Questions
- Source Analysis

c) Environment Integrations:
- BlockPy
- Gradescope
- Jupyter
- NBGrader
- Terminal
- VPL

##### Component Relationships

**[Instructor Control Script] → [Report]**
- ↓
**[Tools] → [Feedback Functions] → [Feedback] → [Resolver] → [Environment]**

##### Specific Implementation Details

- Blue: Core Framework Components
- Green: Analysis Tools
- Orange: Environments
- Purple: Extensions
- Gray: Utilities

b) Component Groupings:
- Core Framework (Report, Feedback, Resolver)
- Analysis Tools (TIFA, CAIT, Sandbox, etc.)
- Environments (BlockPy, Gradescope, etc.)
- Extensions (Microbit, Plotting, Turtles)

##### Data Flow Representation

- Submission flow from Environment to Report
- Tool analysis results flowing to Feedback
- Feedback aggregation in Report
- Resolution process to final output

##### Important Details

a) Pipeline Stages:
1. Input/Submission
2. Analysis
3. Feedback Generation
4. Resolution
5. Output

b) Key Subsystems:
- Type checking (TIFA)
- AST analysis (CAIT)
- Runtime analysis (Sandbox)
- Static analysis (Source)

##### Architecture Patterns to Highlight

- Pipeline Architecture
- Plugin System (Tools)
- Environment Abstraction
- Feedback Collection and Resolution

## Diagram (Mermaid)

```mermaid
graph TB
    %% Core Components
    Report["Report System"]:::core
    Feedback["Feedback System"]:::core
    Resolver["Resolver System"]:::core
    Environment["Environment System"]:::core
    Tools["Tools System"]:::core

    %% Tools Section
    subgraph Tools_Layer["Analysis Tools"]
        TIFA["TIFA (Type Analysis)"]:::tool
        CAIT["CAIT (Code Analysis)"]:::tool
        Sandbox["Sandbox (Execution)"]:::tool
        Assertions["Assertions"]:::tool
        Questions["Questions"]:::tool
        Source["Source Analysis"]:::tool
    end

    %% Environments Section
    subgraph Env_Layer["Environments"]
        BlockPy["BlockPy"]:::env
        Gradescope["Gradescope"]:::env
        Jupyter["Jupyter"]:::env
        NBGrader["NBGrader"]:::env
        Terminal["Terminal"]:::env
        VPL["VPL"]:::env
    end

    %% Extensions Section
    subgraph Ext_Layer["Extensions"]
        Microbit["Microbit"]:::ext
        Plotting["Plotting"]:::ext
        Turtles["Turtles"]:::ext
    end

    %% Relationships
    Environment --> Report
    Report --> Tools
    Tools --> Feedback
    Feedback --> Resolver
    Resolver --> Environment

    %% Tool Connections
    Tools_Layer --> Feedback
    Ext_Layer --> Tools
    Env_Layer --> Environment

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef tool fill:#2ecc71,stroke:#27ae60,color:white
    classDef env fill:#e67e22,stroke:#d35400,color:white
    classDef ext fill:#9b59b6,stroke:#8e44ad,color:white

    %% Click Events
    click Report "https://github.com/pedal-edu/pedal/blob/master/pedal/core/report.py"
    click Feedback "https://github.com/pedal-edu/pedal/blob/master/pedal/core/feedback.py"
    click Resolver "https://github.com/pedal-edu/pedal/blob/master/pedal/core/resolver.py"
    click Environment "https://github.com/pedal-edu/pedal/blob/master/pedal/core/environment.py"
    click Tools "https://github.com/pedal-edu/pedal/blob/master/pedal/core/tool.py"
    click TIFA "https://github.com/pedal-edu/pedal/tree/master/pedal/tifa/"
    click CAIT "https://github.com/pedal-edu/pedal/tree/master/pedal/cait/"
    click Sandbox "https://github.com/pedal-edu/pedal/tree/master/pedal/sandbox/"
    click Assertions "https://github.com/pedal-edu/pedal/tree/master/pedal/assertions/"
    click Questions "https://github.com/pedal-edu/pedal/tree/master/pedal/questions/"
    click Source "https://github.com/pedal-edu/pedal/tree/master/pedal/source/"
    click BlockPy "https://github.com/pedal-edu/pedal/blob/master/pedal/environments/blockpy.py"
    click Gradescope "https://github.com/pedal-edu/pedal/blob/master/pedal/environments/gradescope.py"
    click Jupyter "https://github.com/pedal-edu/pedal/blob/master/pedal/environments/jupyter.py"
    click NBGrader "https://github.com/pedal-edu/pedal/blob/master/pedal/environments/nbgrader.py"
    click Terminal "https://github.com/pedal-edu/pedal/blob/master/pedal/environments/terminal.py"
    click VPL "https://github.com/pedal-edu/pedal/blob/master/pedal/environments/vpl.py"
```
