# rfypych/birthday-timer architecture

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

- Interactive diagram: https://gitdiagram.com/rfypych/birthday-timer
- Repository: https://github.com/rfypych/birthday-timer

## Overview

##### Main Components
- User Interface (UI) Module: Represented primarily by pixel_ui.py, which defines the pixel art styled interface using Tkinter. This layer handles all user interactions like adding, editing, and deleting birthday entries.
- Notification Module: Found in notification.py. This component is responsible for issuing timely system notifications about upcoming birthdays using win10toast.
- Data Storage: Represented by birthdays.json which contains the stored birthday information. This acts as the simple database for the application.
- External Libraries and Dependencies: Represented by requirements.txt (defining Python dependencies including Tkinter and win10toast) and the inherent Python environment.

##### Relationships and Interactions
- The UI Module (pixel_ui.py) is the entry point for user interactions. When a user performs an action (e.g., adding or editing a birthday), the UI passes this information to the Application Core.
- The Application Core (main.py/app.py) processes the input, updates the birthdays.json data store accordingly, and, if a birthday is coming up, communicates with the Notification Module.
- The Notification Module (notification.py) uses win10toast to show notifications on the Windows system.
- The data flow between components is mostly unidirectional. User actions lead to updates in the data store and trigger notifications when appropriate.

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project clearly separates the UI from business logic and notification handling.
- Modular Design: Each module (UI, core logic, notification handling, data storage) is defined in its own file, making the system easier to understand and maintain.
- Event-Driven Flow: The UI events trigger application logic which in turn manipulates data and calls notification functions.

- “User Interface (pixel_ui.py – Tkinter)”
- “Application Core (main.py/app.py – Business Logic & Configurations)”
- “Data Storage (birthdays.json – JSON Database)”
- “Notification Module (notification.py – win10toast)”
- “External Dependencies (Python, Tkinter, win10toast)”

## Diagram (Mermaid)

```mermaid
flowchart TD
    External["External Dependencies (requirements.txt)"]:::external
    UI["User Interface (pixel_ui.py – Tkinter)"]:::ui
    AppCore["Application Core (main.py/app.py – Business Logic & Configurations)"]:::core
    Storage(("Data Storage (birthdays.json – JSON Database)")):::storage
    Notify["Notification Module (notification.py – win10toast)"]:::notify

    External -->|"UtilizedBy"| UI
    External -->|"UtilizedBy"| AppCore
    External -->|"UtilizedBy"| Notify

    UI -->|"UserAction"| AppCore
    AppCore -->|"DataUpdate"| Storage
    AppCore -->|"Notify"| Notify

    click UI "https://github.com/rfypych/birthday-timer/blob/main/pixel_ui.py"
    click AppCore "https://github.com/rfypych/birthday-timer/blob/main/app.py"
    click AppCore "https://github.com/rfypych/birthday-timer/blob/main/main.py"
    click Storage "https://github.com/rfypych/birthday-timer/blob/main/birthdays.json"
    click Notify "https://github.com/rfypych/birthday-timer/blob/main/notification.py"
    click External "https://github.com/rfypych/birthday-timer/blob/main/requirements.txt"

    classDef ui fill:#cce5ff,stroke:#007bff,stroke-width:2px;
    classDef core fill:#d4edda,stroke:#28a745,stroke-width:2px;
    classDef storage fill:#f8d7da,stroke:#dc3545,stroke-width:2px;
    classDef notify fill:#fff3cd,stroke:#ffc107,stroke-width:2px;
    classDef external fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
```
