How 7odaifa-ab/ddns-cloudflare-api works
Project type and purpose
• This is a Windows desktop application built on WPF (.NET 8.0) that implements the MVVM pattern.
• Its purpose is to act as a Dynamic DNS (DDNS) client for Cloudflare: fetching, updating, and logging DNS records.
File structure
• Top-level solution (.sln) and project folder (DDNS_Cloudflare_API)
• MVVM layers:
• Views: Views/Pages & Views/Windows (XAML + code‐behind)
• ViewModels: ViewModels/Pages & ViewModels/Windows
• Models: Models (AppConfig, DataColor)
• Services layer: Services (ApplicationHostService, PageService, ProfileTimerService)
• Helpers: EncryptionHelper, EnumToBooleanConverter
• Resources & Assets: localized strings, images
• Configuration & publishing: Properties/PublishProfiles, app.manifest
• External dependencies: Cloudflare REST API, Wpf.Ui library
README for additional insights
• Confirms MVVM, WPF UI, .NET 8.0
• Describes feature set: fetch/update records, system tray integration, multi-profile management, logging.
a. Main components:
• Desktop App (WPF UI Layer)
• ViewModels Layer (Presentation logic)
• Services Layer (API orchestration, timers)
• Models Layer (configuration, DTOs)
• Local Storage (profiles, logs)
• External Cloudflare API (HTTPS endpoint)
• System Tray / OS interaction
b. Relationships & interactions:
• User clicks UI control → binds to ViewModel command → invokes Service → calls Cloudflare API → returns JSON → Service updates Model → ViewModel exposes data → UI displays it.
• ProfileTimerService polls/updates record on schedule; writes logs.
c. Architectural patterns:
• MVVM separation: UI ↔ ViewModel ↔ Model
• Service abstraction for API calls & application management
• Dependency injection can be called out if used (e.g., constructor injection in ViewModels)
d. Technologies & frameworks:
• .NET 8.0, WPF UI Library (Wpf.Ui)
• JSON (System.Text.Json or Newtonsoft.Json)
• HTTP Client to Cloudflare REST API
• Local file I/O for logs and config (AppConfig.cs)
• XAML + C# code-behind for Views
Elements
• Labels: “UI (Views)”, “ViewModels”, “Services”, “Models”, “Local Storage”, “Cloudflare API”, “OS / System Tray”
• OS events → ApplicationHostService → ViewModel
• Blue rectangles for UI components
• Green for ViewModels
• Orange for Services