# crtmitchn/timepic architecture

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

- Interactive diagram: https://gitdiagram.com/crtmitchn/timepic
- Repository: https://github.com/crtmitchn/timepic

## Overview

Timepic is a small Windows wallpaper utility. On startup, `index.js` checks the configured date; when eligible, it composes an image and then calls `changewp.js` to set that image as wallpaper for applicable Windows users. The excerpts show the main calls and registry update, but do not establish how the program is launched or whether the named input image exists. The graph omits those uncertain relationships.

Main entry points: [`index.js`](https://github.com/crtmitchn/timepic/blob/master/index.js) (Date check and image composition), [`changewp.js`](https://github.com/crtmitchn/timepic/blob/master/changewp.js) (Per-user wallpaper update), [`config.json`](https://github.com/crtmitchn/timepic/blob/master/config.json) (Date and wallpaper settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Date and image workflow"]
  node_config["Date and wallpaper settings<br/>[config.json]"]
  node_entry["Date check and image composition<br/>[index.js]"]
  node_datefmt["Date formatting"]
  node_source_image["Input image"]
  node_output_image["Generated wallpaper image"]
end

subgraph group_windows["Windows wallpaper update"]
  node_wallpaper_update["Per-user wallpaper update<br/>[changewp.js]"]
  node_registry[("Windows registry")]
  node_windows_refresh["Windows parameter refresh"]
end

node_user(("User"))

node_user -.->|"starts"| node_entry
node_config -->|"supplies settings"| node_entry
node_entry -->|"formats dates"| node_datefmt
node_source_image -->|"reads image"| node_entry
node_entry -->|"writes image"| node_output_image
node_entry -->|"calls after date check"| node_wallpaper_update
node_wallpaper_update -->|"lists and updates"| node_registry
node_wallpaper_update -->|"refreshes settings"| node_windows_refresh

click node_config "https://github.com/crtmitchn/timepic/blob/master/config.json"
click node_entry "https://github.com/crtmitchn/timepic/blob/master/index.js"
click node_wallpaper_update "https://github.com/crtmitchn/timepic/blob/master/changewp.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_config,node_entry,node_datefmt,node_source_image,node_output_image,node_user toneBlue
class node_wallpaper_update,node_registry,node_windows_refresh toneAmber
```

## Components

### Date and image workflow

- [Date and wallpaper settings](https://github.com/crtmitchn/timepic/blob/master/config.json): `config.json`
- [Date check and image composition](https://github.com/crtmitchn/timepic/blob/master/index.js): `index.js`
- **Date formatting**
- **Input image**
- **Generated wallpaper image**

### Windows wallpaper update

- [Per-user wallpaper update](https://github.com/crtmitchn/timepic/blob/master/changewp.js): `changewp.js`
- **Windows registry**
- **Windows parameter refresh**

### Other components

- **User**

## Connections

- User → Date check and image composition: starts
- Date and wallpaper settings → Date check and image composition: supplies settings (evidence: `index.js`)
- Date check and image composition → Date formatting: formats dates (evidence: `index.js`)
- Input image → Date check and image composition: reads image (evidence: `index.js`)
- Date check and image composition → Generated wallpaper image: writes image (evidence: `index.js`)
- Date check and image composition → Per-user wallpaper update: calls after date check (evidence: `index.js`)
- Per-user wallpaper update → Windows registry: lists and updates (evidence: `changewp.js`)
- Per-user wallpaper update → Windows parameter refresh: refreshes settings (evidence: `changewp.js`)
