# 0402anhhuy/oscarmovies architecture

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

- Interactive diagram: https://gitdiagram.com/0402anhhuy/oscarmovies
- Repository: https://github.com/0402anhhuy/oscarmovies

## Overview

##### Project Type & Purpose
- The project is a Python-based MVC application with a primary focus on managing movie data contained in a CSV file (oscar.csv).
- The README “OscarMovies” suggests that it’s likely a movie management or analysis tool related to cinematic awards.

##### Analyzing the File Structure
- Directories:
- Controller: Contains specific controllers to add, edit, delete, and chart movie information.
- Model: Contains a data model that loads or processes movie data from the CSV file.
- View: Contains the UI components that interact with users.
- Data: Holds static data (oscar.csv) that acts as the persistent data store.
- main.py: Acts as the application’s entry point, likely orchestrating the initialization and integration of the MVC components.
- This structure highlights a clear separation of concerns consistent with the MVC design pattern.

##### Components
a. Main Components:
- View:
- Represented by UI.py in the View directory.
- Handles user input and display output.
- Controller:
- Includes AddMovieController, ChartMovieController, DeleteMovieController, EditMovieController.
- Coordinates data flow between the View and the Model.
- Model:
- Represented by LoadDataModel.py.
- Manages data manipulation, loading, and possibly business rules.
- Data:
- The oscar.csv file, which serves as the source of movie data.
- Entry Point:
- main.py, which ties the components together.

b. Relationships & Interactions:
- The UI (View) captures user interactions and passes them to the appropriate Controller.
- The Controllers process the commands and interact with the Model to load, update, or modify data.
- The Model reads from and writes to the Data source (oscar.csv) as required.
- main.py is used to bootstrap the application, initializing the View, Controller, and Model, and establishing the necessary communication paths among them.

##### Architectural Patterns & Technologies
- MVC Pattern: Clear separation of user interface, business logic, and data.
- Python is the underlying technology.
- File-based data storage via the CSV file.
- The use of controllers for different operations (add, delete, edit, chart) follows a modular approach to handling application logic.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Entry Point
    Main("main.py (Entry Point)"):::entrypoint

    %% View Layer
    subgraph "View Layer"
        UI("UI (View)"):::view
    end

    %% Controller Layer
    subgraph "Controller Layer"
        Add("AddMovie Controller"):::controller
        Edit("EditMovie Controller"):::controller
        Delete("DeleteMovie Controller"):::controller
        Chart("ChartMovie Controller"):::controller
    end

    %% Model Layer
    subgraph "Model Layer"
        Model("LoadData Model"):::model
    end

    %% Data Layer
    subgraph "Data Layer"
        Data("oscar.csv (Data Source)"):::data
    end

    %% Connections
    Main -->|"initializes"| UI
    UI -->|"sends request"| Add
    UI -->|"sends request"| Edit
    UI -->|"sends request"| Delete
    UI -->|"sends request"| Chart
    Add -->|"invokes"| Model
    Edit -->|"invokes"| Model
    Delete -->|"invokes"| Model
    Chart -->|"invokes"| Model
    Model -->|"reads/writes"| Data
    Model -->|"updates"| UI

    %% Click Events
    click UI "https://github.com/0402anhhuy/oscarmovies/blob/main/View/UI.py"
    click Add "https://github.com/0402anhhuy/oscarmovies/blob/main/Controller/AddMovieController.py"
    click Edit "https://github.com/0402anhhuy/oscarmovies/blob/main/Controller/EditMovieController.py"
    click Delete "https://github.com/0402anhhuy/oscarmovies/blob/main/Controller/DeleteMovieController.py"
    click Chart "https://github.com/0402anhhuy/oscarmovies/blob/main/Controller/ChartMovieController.py"
    click Model "https://github.com/0402anhhuy/oscarmovies/blob/main/Model/LoadDataModel.py"
    click Data "https://github.com/0402anhhuy/oscarmovies/blob/main/Data/oscar.csv"
    click Main "https://github.com/0402anhhuy/oscarmovies/blob/main/main.py"

    %% Styles
    classDef view fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef controller fill:#FFA500,stroke:#000,stroke-width:2px;
    classDef model fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef data fill:#D3D3D3,stroke:#000,stroke-width:2px;
    classDef entrypoint fill:#FF6961,stroke:#000,stroke-width:2px;
```
