# kyome22/runcat365 architecture

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

- Interactive diagram: https://gitdiagram.com/kyome22/runcat365
- Repository: https://github.com/kyome22/runcat365

## Overview

##### Project Type and Purpose
- This is a Windows desktop application (C#/.NET 9.0) that displays a cute running cat animation in the Windows Taskbar and optionally an endless runner “game” window.
- It also contains a secondary project for packaging the app for the Microsoft Store, plus a small static “docs” site for documentation.

##### High-Level Components
A. Solution (“RunCat365.sln”)
1. RunCat365 (Desktop App)
- Program.cs: Application entry point.
- EndlessGameForm.cs: Main WinForms UI for the endless runner game.
- ContextMenuManager/ContextMenuRenderer/CustomToolStripMenuItem: Tray/context-menu support.
- CPURepository, MemoryRepository, StorageRepository: System-metric collectors.
- ByteFormatter, FPSMaxLimit, GameStatus: Business-logic/utilities.
- Cat, Runner, Road, Theme: Animation/game objects and styling.
- LaunchAtStartupManager: Windows startup integration.
- App.config/App.manifest: Configuration and Windows compatibility.
2. WapForStore (AppX Packaging)
- Wapproj + Package.appxmanifest + StoreAssociation + build scripts.
- Produces MSIX/AppX for submission to Microsoft Store.
B. docs Folder (Static Site)
- HTML/CSS/images for project documentation.

##### Relationships & Data Flow
- Repositories periodically query Windows APIs for CPU/memory/disk usage.
- Business logic modules (ByteFormatter, FPSMaxLimit) process raw data into display metrics.
- UI components (EndlessGameForm, Runner, Road, Cat) consume metrics and render frames.
- Packaging project (WapForStore) references the build output of RunCat365 and wraps it in an AppX container.
- Documentation site is independent and served via docs/index.html.

##### Architectural Patterns & Principles
- Modular separation of concerns:
- Data Collection (Repositories)
- Core Logic (Formatters, GameStatus, Limits)
- Presentation (Forms, Renderers, Themes)
- Integration (ContextMenu, LaunchAtStartup)
- Build-time packaging separated into its own project (WAP).

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "RunCat365.sln"
    subgraph "Desktop App"
      direction TB
      subgraph "Data Layer"
        direction TB
        CPURepo["CPURepository"]:::data
        MemRepo["MemoryRepository"]:::data
        StorageRepo["StorageRepository"]:::data
      end
      subgraph "Business Logic Layer"
        direction TB
        ByteFmt["ByteFormatter"]:::logic
        FPSLim["FPSMaxLimit"]:::logic
        GameStat["GameStatus"]:::logic
      end
      subgraph "Presentation Layer"
        direction TB
        EndlessForm["EndlessGameForm"]:::ui
        Cat["Cat"]:::ui
        RunnerObj["Runner"]:::ui
        RoadObj["Road"]:::ui
        ThemeObj["Theme"]:::ui
        ContextMgr["ContextMenuManager"]:::ui
        ContextRend["ContextMenuRenderer"]:::ui
        CustomMenu["CustomToolStripMenuItem"]:::ui
      end
      subgraph "Integration Layer"
        direction TB
        LaunchMgr["LaunchAtStartupManager"]:::inten
        AppConfig["App.config"]:::inten
        AppManifest["App.manifest"]:::inten
      end
      BuildOutput["Build Output"]:::artefact
    end
    subgraph "Store Packaging"
      direction TB
      Waproject["WapForStore.wapproj"]:::pack
      AppxManifest["Package.appxmanifest"]:::pack
      StoreAssoc["Package.StoreAssociation.xml"]:::pack
      BuildScript["rm-wap-for-store.sh"]:::pack
      ImagesPkg["Images"]:::pack
    end
  end
  Docs["Documentation Site"]:::ext
  winapi["Win32 Tray API"]:::ext
  msstore["Microsoft Store"]:::ext

  CPURepo -->|"Poll CPU Usage"| ByteFmt
  MemRepo -->|"Poll Memory Usage"| ByteFmt
  StorageRepo -->|"Poll Disk Usage"| ByteFmt

  ByteFmt -->|"Format Data"| EndlessForm
  FPSLim -->|"Limit FPS"| EndlessForm
  GameStat -->|"Game State"| EndlessForm

  EndlessForm -->|"Render Frame"| Cat
  EndlessForm -->|"Render Frame"| RunnerObj
  EndlessForm -->|"Render Frame"| RoadObj
  EndlessForm -->|"Apply Theme"| ThemeObj

  EndlessForm -->|"Show Context Menu"| ContextMgr
  ContextMgr -->|"Render Menu"| ContextRend
  ContextRend -->|"Use Item"| CustomMenu

  EndlessForm -->|"Init Startup"| LaunchMgr
  EndlessForm -->|"Load Config"| AppConfig
  EndlessForm -->|"Load Manifest"| AppManifest

  EndlessForm -->|"Produce Build"| BuildOutput
  BuildOutput -->|"Package Output"| Waproject
  Waproject -->|"Wrap in AppX"| AppxManifest
  Waproject --> StoreAssoc
  Waproject --> BuildScript
  Waproject --> ImagesPkg

  ContextMgr -->|"Uses"| winapi
  Waproject -->|"Submit Package"| msstore

  Docs -->|"Static Site"| docs

  classDef data fill:#ffeeba,stroke:#ccb53b
  classDef logic fill:#cce5ff,stroke:#337ab7
  classDef ui fill:#d4edda,stroke:#3c763d
  classDef inten fill:#f5c6cb,stroke:#a71d2a
  classDef pack fill:#f0e68c,stroke:#b5a642
  classDef ext fill:#e2e3e5,stroke:#6c757d
  classDef artefact fill:#d6d8db,stroke:#1b1e21

  click CPURepo "https://github.com/kyome22/runcat365/blob/main/RunCat365/CPURepository.cs"
  click MemRepo "https://github.com/kyome22/runcat365/blob/main/RunCat365/MemoryRepository.cs"
  click StorageRepo "https://github.com/kyome22/runcat365/blob/main/RunCat365/StorageRepository.cs"
  click ByteFmt "https://github.com/kyome22/runcat365/blob/main/RunCat365/ByteFormatter.cs"
  click FPSLim "https://github.com/kyome22/runcat365/blob/main/RunCat365/FPSMaxLimit.cs"
  click GameStat "https://github.com/kyome22/runcat365/blob/main/RunCat365/GameStatus.cs"
  click EndlessForm "https://github.com/kyome22/runcat365/blob/main/RunCat365/EndlessGameForm.cs"
  click Cat "https://github.com/kyome22/runcat365/blob/main/RunCat365/Cat.cs"
  click RunnerObj "https://github.com/kyome22/runcat365/blob/main/RunCat365/Runner.cs"
  click RoadObj "https://github.com/kyome22/runcat365/blob/main/RunCat365/Road.cs"
  click ThemeObj "https://github.com/kyome22/runcat365/blob/main/RunCat365/Theme.cs"
  click ContextMgr "https://github.com/kyome22/runcat365/blob/main/RunCat365/ContextMenuManager.cs"
  click ContextRend "https://github.com/kyome22/runcat365/blob/main/RunCat365/ContextMenuRenderer.cs"
  click CustomMenu "https://github.com/kyome22/runcat365/blob/main/RunCat365/CustomToolStripMenuItem.cs"
  click LaunchMgr "https://github.com/kyome22/runcat365/blob/main/RunCat365/LaunchAtStartupManager.cs"
  click AppConfig "https://github.com/kyome22/runcat365/blob/main/RunCat365/App.config"
  click AppManifest "https://github.com/kyome22/runcat365/blob/main/RunCat365/App.manifest"
  click Waproject "https://github.com/kyome22/runcat365/blob/main/WapForStore/WapForStore.wapproj"
  click AppxManifest "https://github.com/kyome22/runcat365/blob/main/WapForStore/Package.appxmanifest"
  click StoreAssoc "https://github.com/kyome22/runcat365/blob/main/WapForStore/Package.StoreAssociation.xml"
  click BuildScript "https://github.com/kyome22/runcat365/blob/main/WapForStore/AppPackages/rm-wap-for-store.sh"
  click ImagesPkg "https://github.com/kyome22/runcat365/tree/main/WapForStore/Images"
  click Docs "https://github.com/kyome22/runcat365/blob/main/docs/index.html"
```
