How rigo85/internet-speed-monitor-ng works
Project Type and Purpose
• The project is a desktop application built with an Angular frontend integrated with an Electron shell.
• It uses external speed test executables (from Ookla Speedtest) for both Linux and Windows platforms, and it features core business logic along with a data-persistence layer.
• The purpose is to provide a user interface (Angular) for monitoring internet speed, executing platform-specific speed tests (via core/ookla-speedtest), and storing/retrieving test history and settings (via the DB repositories in core/db).
Key Components and Their Directories
a. Frontend (Angular):
• Located under the “src” folder.
• Contains Angular components (e.g., in src/app/components for History, Main, Settings), services (like electron.service.ts), and configuration files (e.g., app.routes.ts, app.config.ts).
• This layer manages the UI, routing, and overall client-side logic.
b. Electron Integration:
• Found in “src-electron-app”, with files such as ElectronApp.ts, main.ts, preload.ts, browserWindowHelper.ts, etc.
• Acts as the bridge between the Angular frontend and native system resources, managing application windows and inter-process communication (IPC).
c. Core Business Logic and Data Handling:
• Located in the “core” directory. Here you have classes like OoklaSpeedTester.ts and Settings.ts that encapsulate the business logic.
• The “core/db” folder holds repositories and data access objects (AppDAO, SettingsRepository, and SpeedTestRepository) that abstract persistence operations.
d. External Executable Integrations:
• Under “core/ookla-speedtest”, there’s a separation between Linux and Windows executables (for example, speedtest on Linux and speedtest.exe on win32) along with their documentation files.
• These binaries represent an integration point to perform actual speed tests using native code.
Architectural Relationships and Interactions
• The Angular frontend communicates with the Electron backend using an electron service (likely via IPC) to offload system-level tasks.
• The Electron main process (and preload scripts) act as controllers to initiate tasks such as running a speed test.
• The core logic (e.g., OoklaSpeedTester) is called either directly via Electron or indirectly through services, executing external binaries based on the operating system.
• The DB repositories in the “core/db” layer are responsible for recording the test results and user settings, thereby enabling historical speed monitoring.
Elements
• Clear labels for each component (Angular Frontend, Electron Main Process, Core Logic, Database Repositories, External Speed Test Modules).