# gwangmu/mini-excel architecture

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

- Interactive diagram: https://gitdiagram.com/gwangmu/mini-excel
- Repository: https://github.com/gwangmu/mini-excel

## Overview

##### Project type and purpose
- This is a C++ “mini-Excel” desktop application (terminal‐based for Linux, console for Windows) intended as an educational lab project for an Object-Oriented Programming course.
- The goal is to implement a spreadsheet: cells can contain constants, formulas, references, and built-in functions (e.g., Add, Average).

##### File structure
- Two parallel skeletons:
- skeleton-linux/
– src/UI: ArrayView, Label, MenuStrip, TextBox, UIManager, …
– include/UI: corresponding headers + gterm.h (terminal drawing library)
– main.cpp
– Makefile
- skeleton-vs/
– UI/: identical UI class files for Visual Studio
– Assn3.sln / .vcxproj files
– Debug binaries and object files
- No external microservices or databases: it’s a standalone desktop app.
- Core domain objects (in VS Debug folder): CCell, CExpression, CConstant, CFunction, CReference, CSheet, CValueFactory, CUtil, and error handling (CError).

##### README for additional insights
- Confirms: the skeleton gives you the class “guts” and you must implement a fully-functional spreadsheet.
- Notes: Linux version uses ncurses (gterm), Windows version uses console APIs.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::external
    subgraph "Application Entry"
        Main["main.cpp"]:::entry
    end

    subgraph "UI Layer"
        UIManager["UIManager"]:::ui
        UIObject["UIObject"]:::ui
        ArrayView["ArrayView"]:::ui
        ColorLabel["ColorLabel"]:::ui
        Label["Label"]:::ui
        LabeledStrip["LabeledStrip"]:::ui
        MenuStrip["MenuStrip"]:::ui
        TextBox["TextBox"]:::ui
        UICallback["UICallback"]:::ui
    end

    subgraph "Core Engine"
        CSheet["CSheet"]:::core
        CCell["CCell"]:::core
        CExpression["CExpression"]:::core
        CConstant["CConstant"]:::core
        CReference["CReference"]:::core
        CFunction["CFunction"]:::core
        CAdd["CAdd"]:::core
        CAverage["CAverage"]:::core
        CValueFactory["CValueFactory"]:::core
        CUtil["CUtil"]:::core
        CError["CError"]:::core
    end

    subgraph "OS / Terminal Library"
        Gterm["gterm (ncurses)"]:::ext
    end

    User -->|"keyboard/mouse"| UIManager
    Main -->|"initializes"| UIManager
    UIManager -->|"dispatchInput()"| UIObject
    UIObject -->|"setCellExpression()"| CSheet
    CSheet -->|"holds cell"| CCell
    CCell -->|"expr ptr"| CExpression
    CExpression -->|"evaluate()"| CConstant
    CExpression -->|"evaluate()"| CReference
    CExpression -->|"evaluate()"| CFunction
    CFunction -->|"exec()"| CAdd
    CFunction -->|"exec()"| CAverage
    CSheet -.->|"evaluation result"| UIObject
    UIManager -->|"draw calls"| Gterm

    click UIManager "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/UIManager.h"
    click UIObject "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/UIObject.h"
    click ArrayView "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/ArrayView.h"
    click ColorLabel "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/ColorLabel.h"
    click Label "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/Label.h"
    click LabeledStrip "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/LabeledStrip.h"
    click MenuStrip "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/MenuStrip.h"
    click TextBox "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/TextBox.h"
    click UICallback "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/UICallback.h"
    click Gterm "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/include/UI/gterm.h"
    click Main "https://github.com/gwangmu/mini-excel/blob/master/skeleton-linux/src/main.cpp"
    click CSheet "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CSheet.obj"
    click CCell "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CCell.obj"
    click CExpression "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CExpression.obj"
    click CConstant "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CConstant.obj"
    click CReference "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CReference.obj"
    click CFunction "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CFunction.obj"
    click CAdd "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CAdd.obj"
    click CAverage "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CAverage.obj"
    click CValueFactory "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CValueFactory.obj"
    click CUtil "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CUtil.obj"
    click CError "https://github.com/gwangmu/mini-excel/blob/master/skeleton-vs/Assn3/Debug/CError.obj"

    classDef ui fill:#ADD8E6,stroke:#000;
    classDef core fill:#90EE90,stroke:#000;
    classDef ext fill:#FFA500,stroke:#000;
    classDef entry fill:#D3D3D3,stroke:#000;
    classDef external fill:#FFFFFF,stroke:#000;
```
