# daylamtayari/microsoft-to-do-export architecture

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

- Interactive diagram: https://gitdiagram.com/daylamtayari/microsoft-to-do-export
- Repository: https://github.com/daylamtayari/microsoft-to-do-export

## Overview

##### Main Components
- User Input/CLI Module – This is where the executable prompts the user for an access token, output format, and output path.
- API Communication Module – Represented by the API.java file, this component handles interactions with Microsoft’s Graph API (using the token provided) to fetch task lists and tasks.
- Data Parsing & Mapping Module – The Parser.java will be responsible for converting received raw JSON data into internal data models.
- Data Models – Represented by Task.java and Lists.java, these components hold information about tasks and task lists.
- Export Module – The Export.java file contains the functionality to format the data into various export types: Todoist CSV, human readable text, and raw JSON.
- Application Entry Point – Main.java controls the overall workflow of the application and glues together the various components.
- Configuration/Manifest – The META-INF/MANIFEST.MF contains configuration metadata for the application’s execution.

##### Relationships and Interactions
- The application starts at Main.java. This module is responsible for:
- Taking user input (access token, export format, output path).
- Calling the API module to authenticate and fetch task data.
- API.java will perform the necessary API communication and pass back the JSON data.
- The Parser.java takes this JSON and processes it into objects defined in Task.java and Lists.java.
- Once the data is structured into the application’s models, Export.java is invoked. It ensures the output is written in the desired format.
- The overall flow is sequential: User Input → API Communication → Parsing → Data Modeling → Exporting to the desired file format.

##### Architectural Patterns and Design Principles
- Modularization – Even though it’s a small project, the separation of concerns is clear: each Java class/module focuses on a specific functionality.
- Command-line flow control – The Main class orchestrates the entire application.
- Data abstraction – Using separate classes for tasks and lists makes the system more maintainable and clear.
- Single Responsibility Principle – For example, API.java handles API calls only, Parser.java handles conversion, and Export.java handles data formatting and file output.

##### Technologies, Frameworks, and Libraries
- Java is the core language used.
- Standard Input/Output for user interactions.
- Microsoft Graph API via HTTP requests (likely using Java’s built-in support or an HTTP library not explicitly shown here).
- The export formats (CSV, JSON, human-readable text) are generated using basic Java libraries.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Interaction"
        U["User (CLI Input)"]:::cli
    end

    subgraph "Application Flow"
        M["Main (Entry Point - Main.java)"]:::main
        A["API Communication (API.java)"]:::api
        P["Parser (Parser.java)"]:::parser
        subgraph "Data Models"
            T["Task.java"]:::model
            L["Lists.java"]:::model
        end
        E["Export Module (Export.java)"]:::export
    end

    subgraph "Configuration"
        C["Configuration (MANIFEST.MF)"]:::config
    end

    %% Flow Connections
    U -->|"provides_token,format,output_path"| M
    C -->|"loads_metadata"| M
    M -->|"calls_API"| A
    A -->|"returns_JSON"| M
    M -->|"sends_JSON"| P
    P -->|"maps_to_objects"| T
    P -->|"maps_to_objects"| L
    M -->|"triggers_export"| E

    %% Click Events
    click M "https://github.com/daylamtayari/microsoft-to-do-export/blob/master/src/Main.java"
    click A "https://github.com/daylamtayari/microsoft-to-do-export/blob/master/src/API.java"
    click P "https://github.com/daylamtayari/microsoft-to-do-export/blob/master/src/Parser.java"
    click T "https://github.com/daylamtayari/microsoft-to-do-export/blob/master/src/Task.java"
    click L "https://github.com/daylamtayari/microsoft-to-do-export/blob/master/src/Lists.java"
    click E "https://github.com/daylamtayari/microsoft-to-do-export/blob/master/src/Export.java"
    click C "https://github.com/daylamtayari/microsoft-to-do-export/blob/master/src/META-INF/MANIFEST.MF"

    %% Styles
    classDef cli fill:#f9e79f,stroke:#d35400,stroke-width:2px;
    classDef main fill:#f4d03f,stroke:#b7950b,stroke-width:2px;
    classDef api fill:#85c1e9,stroke:#2874a6,stroke-width:2px;
    classDef parser fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef model fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
    classDef export fill:#f5b7b1,stroke:#c0392b,stroke-width:2px;
    classDef config fill:#d7bde2,stroke:#8e44ad,stroke-width:2px;
```
