# zhangjiarui530/openeduecnu architecture

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

- Interactive diagram: https://gitdiagram.com/zhangjiarui530/openeduecnu
- Repository: https://github.com/zhangjiarui530/openeduecnu

## Overview

##### Project Type & Purpose
- The project (named “OpenEduECNU”) appears to be an educational tool aimed at assisting with courseware generation and handling chat-based queries related to coursework. It is structured as a multi-functional application with two main operational modes:
- A “chat_question” module that likely handles interactive dialogue, Q&A, and potentially tutoring functions via a Streamlit UI.
- A “courseware” module that appears to focus on processing educational materials, including generating course outlines, PPTs, and handling file creation and text extraction (e.g., extracting high frequency words).
- The README simply instructs users to run run.py, implying a unified entry point that orchestrates these functionalities.

##### Analyzing the File Structure
- Top-level Files & Directories:
- run.py: Serves as the main entry point.
- LICENSE and README.md: Standard project documentation.
- .idea: IDE configuration files (not central to the architecture).
- pic: Contains images (perhaps for UI or documentation).
- class_assistant Directory:
- Contains two clearly separated submodules: “chat_question” and “courseware”.
- In “chat_question”: Files such as OpenEduECNU1.py, dialogue.py, question.py, and localApp.py point to components that manage interactive chat-based educational sessions. It also includes a .streamlit folder, indicating a Streamlit-based user interface.
- In “courseware”: Here you have files like OpenEduECNU2.py, courseware.py, creat_file1.py, creat_pptx.py, extract_high_freq_words.py, outlineGenerate.py, pptGenerate.py, and again a localApp.py with its own Streamlit configuration. This module is clearly focused on generating and processing course materials.
- “docs” directory: Contains supporting documents (PDFs, DOCX files) of course materials, possibly serving as source or reference material.
- “result” subdirectory (under courseware): Holds generated output files (e.g., teaching outlines and PPTs) that are created by the application’s processes.

a. Main Components:
– Entry Point: run.py, which initiates the application.
– Chat Module: Under class_assistant/chat_question including components like:
- OpenEduECNU1.py (configures or acts as a controller for chat functionalities)
- dialogue.py and question.py (logic for handling conversation and queries)
- localApp.py paired with Streamlit configuration (UI layer)
– Courseware Module: Under class_assistant/courseware including components like:
- OpenEduECNU2.py (serving a role similar to the chat module’s file but for courseware)
- courseware.py and various utility scripts (creat_file1.py, creat_pptx.py, extract_high_freq_words.py, outlineGenerate.py, pptGenerate.py)
- localApp.py (UI layer for courseware functionalities) with its own Streamlit settings
– Supporting Data/Documents:
- “docs” directory for static educational resources
- “result” directory (within courseware) for dynamically generated documents (teaching outlines and PPTs)
– Configuration/Deployment Elements:
- Presence of .streamlit folders within each module (indicates UI-specific configuration)
- .idea folder (development environment configuration, noted but not essential for the production architecture)

b. Relationships & Interactions:
– Within the courseware module, indicate internal data flows among:
- Input handling (e.g., file uploads or document fetches from the “docs” directory)
- Processing routines (text extraction, outline and PPT generation scripts)
- Output storage to the “result” directory.
– Highlight any shared or common libraries/frameworks being used (especially the reliance on Streamlit for UI).

c. Architectural Patterns & Design Principles:
– Note that the project embodies a modular design, subdividing functionalities into distinct components (chat vs. courseware).
– There is a clear separation between presentation (Streamlit-based UI) and business logic (the various processing scripts and controllers).

d. Relevant Technologies/Frameworks:
– Python is clearly the main programming language.
– Streamlit configuration files (in the .streamlit directories) indicate that the UI is built using the Streamlit framework.
– Other Python libraries (implied by file names such as pptGenerate.py) might include libraries for text processing, generating presentations, and handling document manipulation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Run["run.py"]:::entry

    subgraph "Chat Module"
        chatUI["Chat UI (Streamlit)"]:::ui
        chatConfig["Chat Streamlit Config"]:::config
        chatCon["Chat Controller"]:::controller
        chatDia["Dialogue Logic"]:::processing
        chatQ["Query Handler"]:::processing
    end

    subgraph "Courseware Module"
        courseUI["Courseware UI (Streamlit)"]:::ui
        courseUIConfig["Courseware Streamlit Config"]:::config
        courseCon["Courseware Controller"]:::controller

        subgraph "Processing Utilities"
            cwEngine["Engine (courseware.py)"]:::processing
            cwFileCreator["File Creator (creat_file1.py)"]:::processing
            cwPPTCreator["PPT Creator (creat_pptx.py)"]:::processing
            cwTextExtractor["Text Extractor (extract_high_freq_words.py)"]:::processing
            cwOutlineGen["Outline Generator (outlineGenerate.py)"]:::processing
            cwPPTGen["PPT Slide Generator (pptGenerate.py)"]:::processing
        end

        docs["Input: Docs"]:::storage
        result["Output: Courseware Results"]:::storage
    end

    %% Global Flow
    Run -->|"initiate"| chatUI
    Run -->|"initiate"| courseUI

    %% Chat Module Flow
    chatUI --> chatConfig
    chatUI --> chatCon
    chatCon --> chatDia
    chatCon --> chatQ

    %% Courseware Module Flow
    courseUI --> courseUIConfig
    courseUI --> courseCon
    courseCon --> cwEngine
    cwEngine --> cwFileCreator
    cwEngine --> cwPPTCreator
    cwEngine --> cwTextExtractor
    cwEngine --> cwOutlineGen
    cwEngine --> cwPPTGen
    docs --> cwTextExtractor
    cwPPTGen --> result

    %% Click Events
    click Run "https://github.com/zhangjiarui530/openeduecnu/blob/main/run.py"
    click chatCon "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/chat_question/OpenEduECNU1.py"
    click chatDia "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/chat_question/dialogue.py"
    click chatQ "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/chat_question/question.py"
    click chatUI "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/chat_question/localApp.py"
    click chatConfig "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/chat_question/.streamlit/config.toml"
    click courseCon "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/courseware/OpenEduECNU2.py"
    click courseUI "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/courseware/localApp.py"
    click courseUIConfig "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/courseware/.streamlit/config.toml"
    click cwEngine "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/courseware/courseware.py"
    click cwFileCreator "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/courseware/creat_file1.py"
    click cwPPTCreator "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/courseware/creat_pptx.py"
    click cwTextExtractor "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/courseware/extract_high_freq_words.py"
    click cwOutlineGen "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/courseware/outlineGenerate.py"
    click cwPPTGen "https://github.com/zhangjiarui530/openeduecnu/blob/main/class_assistant/courseware/pptGenerate.py"
    click docs "https://github.com/zhangjiarui530/openeduecnu/tree/main/class_assistant/docs"
    click result "https://github.com/zhangjiarui530/openeduecnu/tree/main/class_assistant/courseware/result"

    %% Styles
    classDef entry fill:#f9f,stroke:#333,stroke-width:2px;
    classDef ui fill:#ccf,stroke:#333,stroke-width:2px;
    classDef controller fill:#fc9,stroke:#333,stroke-width:2px;
    classDef processing fill:#cfc,stroke:#333,stroke-width:2px;
    classDef storage fill:#ffd,stroke:#333,stroke-width:2px;
    classDef config fill:#efe,stroke:#333,stroke-width:2px;
```
