# maneeshth/yourpetproject architecture

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

- Interactive diagram: https://gitdiagram.com/maneeshth/yourpetproject
- Repository: https://github.com/maneeshth/yourpetproject

## Overview

Desktop Pet is a small Electron companion whose main workflow is to create a transparent, click-through overlay, send cursor positions to the renderer, and animate a selected pet toward the cursor. The tray provides animal selection and quitting. The README documents the intended overlay behavior; the sampled source shows the main-process setup and renderer behavior. The HTML file was not sampled, so its internal rendering details are not expanded.

Main entry points: [`preload.js`](https://github.com/maneeshth/yourpetproject/blob/main/preload.js) (IPC Bridge), [`main.js`](https://github.com/maneeshth/yourpetproject/blob/main/main.js) (App Coordinator), [`pet.js`](https://github.com/maneeshth/yourpetproject/blob/main/pet.js) (Pet Behavior), [`pet.html`](https://github.com/maneeshth/yourpetproject/blob/main/pet.html) (Pet View)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Desktop Runtime"]
  node_app["App Coordinator<br/>[main.js]"]
  node_overlay["Overlay Window<br/>[main.js]"]
  node_cursor["Cursor Polling<br/>[main.js]"]
  node_bridge["IPC Bridge<br/>[preload.js]"]
end

subgraph group_renderer["Pet Renderer"]
  node_view["Pet View<br/>[pet.html]"]
  node_behavior["Pet Behavior<br/>[pet.js]"]
end

subgraph group_interaction["User Interaction"]
  node_tray["Tray Menu<br/>[main.js]"]
end

node_user(("User"))
node_os(("Desktop OS"))

node_app -->|"creates"| node_overlay
node_app -->|"creates"| node_tray
node_app -->|"starts polling"| node_cursor
node_overlay -->|"loads"| node_view
node_overlay -->|"configures preload"| node_bridge
node_cursor -->|"reads position"| node_os
node_cursor -->|"sends cursor IPC"| node_bridge
node_tray -->|"offers controls"| node_user
node_tray -->|"sends pet IPC"| node_bridge
node_bridge -->|"delivers events"| node_behavior
node_behavior -->|"updates pet display"| node_view

click node_app "https://github.com/maneeshth/yourpetproject/blob/main/main.js"
click node_overlay "https://github.com/maneeshth/yourpetproject/blob/main/main.js"
click node_cursor "https://github.com/maneeshth/yourpetproject/blob/main/main.js"
click node_tray "https://github.com/maneeshth/yourpetproject/blob/main/main.js"
click node_bridge "https://github.com/maneeshth/yourpetproject/blob/main/preload.js"
click node_view "https://github.com/maneeshth/yourpetproject/blob/main/pet.html"
click node_behavior "https://github.com/maneeshth/yourpetproject/blob/main/pet.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_app,node_overlay,node_cursor,node_bridge,node_user toneBlue
class node_view,node_behavior toneAmber
class node_tray toneMint
class node_os toneIndigo
```

## Components

### Desktop Runtime

- [App Coordinator](https://github.com/maneeshth/yourpetproject/blob/main/main.js): `main.js`
- [Overlay Window](https://github.com/maneeshth/yourpetproject/blob/main/main.js): `main.js`
- [Cursor Polling](https://github.com/maneeshth/yourpetproject/blob/main/main.js): `main.js`
- [IPC Bridge](https://github.com/maneeshth/yourpetproject/blob/main/preload.js): `preload.js`

### Pet Renderer

- [Pet View](https://github.com/maneeshth/yourpetproject/blob/main/pet.html): `pet.html`
- [Pet Behavior](https://github.com/maneeshth/yourpetproject/blob/main/pet.js): `pet.js`

### User Interaction

- [Tray Menu](https://github.com/maneeshth/yourpetproject/blob/main/main.js): `main.js`

### Other components

- **User**
- **Desktop OS**

## Connections

- App Coordinator → Overlay Window: creates (evidence: `main.js`)
- App Coordinator → Tray Menu: creates (evidence: `main.js`)
- App Coordinator → Cursor Polling: starts polling (evidence: `main.js`)
- Overlay Window → Pet View: loads (evidence: `main.js`)
- Overlay Window → IPC Bridge: configures preload (evidence: `main.js`)
- Cursor Polling → Desktop OS: reads position (evidence: `main.js`)
- Cursor Polling → IPC Bridge: sends cursor IPC (evidence: `main.js`)
- Tray Menu → User: offers controls (evidence: `main.js`)
- Tray Menu → IPC Bridge: sends pet IPC (evidence: `main.js`)
- IPC Bridge → Pet Behavior: delivers events (evidence: `preload.js`)
- Pet Behavior → Pet View: updates pet display (evidence: `pet.js`)
