dd-timer/CLAUDE.md

2.9 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Minuteur Dragodinde is a Windows desktop app (Electron) for managing Dragodinde breeding timers in Dofus 3. French-language UI.

Commands

  • Dev: npm start (runs electron .)
  • Build: npm run build (produces NSIS installer in dist/)
  • Build scripts: build.bat (auto-elevates to admin) or build.ps1 for Windows

No test framework or linter is configured.

Architecture

Single-page Electron app with no bundler. All source code lives in 4 files:

  • main.js — Electron main process: window management, system tray, native notifications, ntfy push notifications (mobile), auto-update via Gitea Releases API, IPC handlers
  • preload.js — Context bridge exposing window.electronAPI (alarm, notifications, ntfy, version, update channels)
  • src/index.htmlMonolithic ~2200-line file containing all HTML, CSS, and JS in one file. This is the entire renderer process.
  • icon.png — App icon (256x256)

Renderer architecture (src/index.html)

All application logic is in <script> tags inside index.html. Key concepts:

  • State object S: Central state with enclos array, activeId, settings. Persisted to localStorage.
  • Enclos: Up to 6 independent pens, each holding up to 10 Dragodindes (DDs). Enclos and DDs are drag-and-drop reorderable.
  • Gauges: 6 gauge types (baffeur, caresseur, foudroyeur, abreuvoir, dragofesse, mangeoire/XP) with tier-based progression rates (tiers 1-4 based on gauge level thresholds at 40k/70k/90k).
  • Timer system: Per-enclos timers with snapshot-based calculation. elapsed() computes time since start, gaugeAfter()/gainedIn()/timeToGain() compute gauge progression.
  • Rendering: Imperative DOM manipulation via render() function — no framework.
  • Dashboard/Stats views: Special activeId values ('dashboard', 'stats') for overview and statistics pages.

IPC channels

Main→Renderer: app-version, play-alarm-sound, update-available, update-downloading, update-progress, update-ready, update-error Renderer→Main: trigger-alarm, show-notification, send-ntfy, focus-window, install-update, get-version

Auto-update flow

Checks Gitea Releases API on startup (after 3s) and hourly. Downloads NSIS Setup .exe to temp, launches with /S (silent), then quits app.

Dev vs packaged mode

When !app.isPackaged, userData is stored in MinuteurDragodinde-DEV (isolated from installed app) and a DEV badge is injected into the UI.

Key conventions

  • All UI text is in French
  • No external JS dependencies in renderer — everything is vanilla JS
  • CSS uses custom properties defined in :root (color theme: dark purple/gaming aesthetic)
  • Electron config: contextIsolation: true, nodeIntegration: false, backgroundThrottling: false