# moxer-mmh/timetracker architecture

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

- Interactive diagram: https://gitdiagram.com/moxer-mmh/timetracker
- Repository: https://github.com/moxer-mmh/timetracker

## Overview

##### Main Components

A. User Interface Layer (Views)
- Three sub-components:
- Daily View (time entry interface)
- Holidays View (calendar management)
- Reports View (balance summaries)

B. Controller Layer (Application Logic)
- A container labeled "Controllers" in the middle
- Three controllers:
- Daily Controller
- Holidays Controller
- Reports Controller

C. Model Layer (Data Layer)
- Include:
- Time Entry Model
- Holiday Model
- Database Handler

D. Utility Components
- Include:
- Logger
- Helpers

##### Component Relationships

- Views → Controllers (User actions)
- Controllers → Models (Data operations)
- Controllers → Views (Updates/Responses)
- Models → Database (Data persistence)
- All components → Utils (Utility access)

##### External Dependencies
- A container for "External Libraries"
- Tkinter (GUI framework)
- TkCalendar (Calendar widget)
- SQLite (Database)

##### Additional Elements

A. Storage:
- Local storage path connection

B. Main Entry Point:
- Main.py as the application entry point
- Connections to all layers

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        DV["Daily View"]
        HV["Holidays View"]
        RV["Reports View"]
    end

    subgraph CTRL["Controller Layer"]
        DC["Daily Controller"]
        HC["Holidays Controller"]
        RC["Reports Controller"]
    end

    subgraph DATA["Model Layer"]
        TEM["Time Entry Model"]
        HM["Holiday Model"]
        DB["Database Handler"]
    end

    subgraph UTIL["Utility Components"]
        LOG["Logger"]
        HELP["Helpers"]
    end

    subgraph EXT["External Dependencies"]
        TK["Tkinter"]
        TKCAL["TkCalendar"]
        SQL["SQLite"]
    end

    MAIN["main.py"]

    %% UI to Controllers
    DV --> DC
    HV --> HC
    RV --> RC

    %% Controllers to Models
    DC --> TEM
    HC --> HM
    RC -.-> TEM
    RC -.-> HM

    %% Models to Database
    TEM --> DB
    HM --> DB
    DB -.-> SQL

    %% Controllers to Views
    DC -.-> DV
    HC -.-> HV
    RC -.-> RV

    %% Main connections
    MAIN --> DV
    MAIN --> HV
    MAIN --> RV
    MAIN --> DC
    MAIN --> HC
    MAIN --> RC

    %% External Dependencies
    DV --> TK
    HV --> TK
    RV --> TK
    HV --> TKCAL

    %% Utility Connections
    LOG --- DV
    LOG --- HV
    LOG --- RV
    LOG --- DC
    LOG --- HC
    LOG --- RC
    HELP --- DC
    HELP --- HC
    HELP --- RC

    %% Click Events
    click DV "https://github.com/moxer-mmh/TimeTracker/blob/main/views/daily_view.py"
    click HV "https://github.com/moxer-mmh/TimeTracker/blob/main/views/holidays_view.py"
    click RV "https://github.com/moxer-mmh/TimeTracker/blob/main/views/reports_view.py"
    click DC "https://github.com/moxer-mmh/TimeTracker/blob/main/controllers/daily_controller.py"
    click HC "https://github.com/moxer-mmh/TimeTracker/blob/main/controllers/holidays_controller.py"
    click RC "https://github.com/moxer-mmh/TimeTracker/blob/main/controllers/reports_controller.py"
    click TEM "https://github.com/moxer-mmh/TimeTracker/blob/main/models/time_entry.py"
    click HM "https://github.com/moxer-mmh/TimeTracker/blob/main/models/holiday.py"
    click DB "https://github.com/moxer-mmh/TimeTracker/blob/main/models/database.py"
    click LOG "https://github.com/moxer-mmh/TimeTracker/blob/main/utils/logger.py"
    click HELP "https://github.com/moxer-mmh/TimeTracker/blob/main/utils/helpers.py"
    click MAIN "https://github.com/moxer-mmh/TimeTracker/blob/main/main.py"

    classDef ui fill:#e1f5fe,stroke:#01579b
    classDef controller fill:#e8f5e9,stroke:#1b5e20
    classDef model fill:#fff3e0,stroke:#e65100
    classDef util fill:#f5f5f5,stroke:#424242
    classDef ext fill:#f3e5f5,stroke:#4a148c
    classDef main fill:#fce4ec,stroke:#880e4f

    class DV,HV,RV ui
    class DC,HC,RC controller
    class TEM,HM,DB model
    class LOG,HELP util
    class TK,TKCAL,SQL ext
    class MAIN main
```
