# aravindharesh/pixelfriend architecture

> Architecture diagram of the GitHub repository aravindharesh/pixelfriend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aravindharesh/pixelfriend
- Repository: https://github.com/aravindharesh/pixelfriend

## Overview

PixelFriend is a macOS water-reminder app. Its workflow is: the main process loads preferences and runs a timed reminder engine; when due, it displays a character animation and a prompt; the user drinks or snoozes, and the app responds and reschedules. The control window configures reminders, while tray controls and macOS activity events provide alternate controls and pause signals. The README is empty, and the HTML view files were not excerpted, so view behavior and documented capabilities beyond the sampled code are not inferred.

Main entry points: [`MacOS/src/main.js`](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/main.js) (Main process), [`MacOS/src/character.js`](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/character.js) (Character animation), [`MacOS/src/preload.js`](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/preload.js) (Renderer IPC bridge), [`MacOS/src/control.js`](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/control.js) (Settings window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["App orchestration"]
  node_main["Main process<br/>[main.js]"]
  node_bridge["Renderer IPC bridge<br/>[preload.js]"]
end

subgraph group_timing["Reminder timing"]
  node_engine["Reminder engine<br/>[engine.js]"]
end

subgraph group_views["App views"]
  node_control["Settings window<br/>[control.js]"]
  node_character["Character animation<br/>[character.js]"]
  node_bubble["Prompt and response<br/>[bubble.js]"]
  node_assets["Reminder videos"]
end

subgraph group_platform["Platform integration"]
  node_settings["Settings file"]
  node_tray["System tray<br/>[main.js]"]
  node_macos["macOS activity and login"]
end

node_user(("User"))

node_main -->|"creates and ticks"| node_engine
node_engine -->|"invokes reminder callback"| node_main
node_main -->|"reads and writes"| node_settings
node_main -->|"loads view"| node_control
node_main -->|"loads view"| node_character
node_main -->|"loads view"| node_bubble
node_control -->|"requests state and actions"| node_bridge
node_character -->|"receives prompts; sends actions"| node_bridge
node_bubble -->|"receives prompts; sends actions"| node_bridge
node_bridge -->|"sends IPC"| node_main
node_main -->|"sends state"| node_control
node_main -->|"sends animation events"| node_character
node_main -->|"sends prompt and response"| node_bubble
node_character -->|"loads animation video"| node_assets
node_user -->|"configures reminders"| node_control
node_user -->|"chooses drink or snooze"| node_bubble
node_user -->|"opens tray controls"| node_tray
node_tray -->|"pauses or triggers"| node_engine
node_macos -->|"signals idle and power events"| node_main
node_main -->|"configures login launch"| node_macos

click node_main "https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/main.js"
click node_engine "https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/engine.js"
click node_control "https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/control.js"
click node_character "https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/character.js"
click node_bubble "https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/bubble.js"
click node_bridge "https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/preload.js"
click node_assets "https://github.com/aravindharesh/pixelfriend/tree/main/MacOS/assets/ReminderVideos"
click node_tray "https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/main.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_bridge,node_user toneBlue
class node_engine toneAmber
class node_control,node_character,node_bubble,node_assets toneMint
class node_settings,node_tray,node_macos toneRose
```

## Components

### App orchestration

- [Main process](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/main.js): `MacOS/src/main.js`
- [Renderer IPC bridge](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/preload.js): `MacOS/src/preload.js`

### Reminder timing

- [Reminder engine](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/engine.js): `MacOS/src/engine.js`

### App views

- [Settings window](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/control.js): `MacOS/src/control.js`
- [Character animation](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/character.js): `MacOS/src/character.js`
- [Prompt and response](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/bubble.js): `MacOS/src/bubble.js`
- [Reminder videos](https://github.com/aravindharesh/pixelfriend/tree/main/MacOS/assets/ReminderVideos): `MacOS/assets/ReminderVideos`

### Platform integration

- **Settings file**
- [System tray](https://github.com/aravindharesh/pixelfriend/blob/main/MacOS/src/main.js): `MacOS/src/main.js`
- **macOS activity and login**

### Other components

- **User**

## Connections

- Main process → Reminder engine: creates and ticks (evidence: `MacOS/src/main.js`)
- Reminder engine → Main process: invokes reminder callback (evidence: `MacOS/src/engine.js`)
- Main process → Settings file: reads and writes (evidence: `MacOS/src/main.js`)
- Main process → Settings window: loads view (evidence: `MacOS/src/main.js`)
- Main process → Character animation: loads view (evidence: `MacOS/src/main.js`)
- Main process → Prompt and response: loads view (evidence: `MacOS/src/main.js`)
- Settings window → Renderer IPC bridge: requests state and actions (evidence: `MacOS/src/control.js`)
- Character animation → Renderer IPC bridge: receives prompts; sends actions (evidence: `MacOS/src/character.js`)
- Prompt and response → Renderer IPC bridge: receives prompts; sends actions (evidence: `MacOS/src/bubble.js`)
- Renderer IPC bridge → Main process: sends IPC (evidence: `MacOS/src/preload.js`)
- Main process → Settings window: sends state (evidence: `MacOS/src/main.js`)
- Main process → Character animation: sends animation events (evidence: `MacOS/src/main.js`)
- Main process → Prompt and response: sends prompt and response (evidence: `MacOS/src/main.js`)
- Character animation → Reminder videos: loads animation video (evidence: `MacOS/src/character.js`)
- User → Settings window: configures reminders (evidence: `MacOS/src/control.js`)
- User → Prompt and response: chooses drink or snooze (evidence: `MacOS/src/bubble.js`)
- User → System tray: opens tray controls (evidence: `MacOS/src/main.js`)
- System tray → Reminder engine: pauses or triggers (evidence: `MacOS/src/main.js`)
- macOS activity and login → Main process: signals idle and power events (evidence: `MacOS/src/main.js`)
- Main process → macOS activity and login: configures login launch (evidence: `MacOS/src/main.js`)
