How digimezzo/knowte works
Main Components
• Electron Main Process:
– Files like main.js, main.ts, electron-builder.config.js, and related deployment scripts represent the Electron layer.
– This process is responsible for launching the application, creating application windows, handling inter-process communication, and managing native integrations.
• Angular Renderer Process (Frontend):
– Located in the src folder (specifically, src/app and its subfolders), this is where the Angular application resides.
– It is organized into multiple components (e.g., notes, collections, dialogs, toolbars) that build up the UI.
– Services (under src/app/services) manage business logic like file access, persistence, search, appearance, update management, and spell-checking.
• Shared/Utility Libraries and Common Code:
– The src/app/common directory includes core utilities, application-specific constants, logging, input/output handlers, UI helpers, and scheduling components.
• Assets and Styling:
– The src/assets and src/css directories hold images, internationalization files (i18n for multiple languages), and CSS/SCSS styling files that support the UI.
• Build and Deployment:
– Directories like build, deployment, and configuration files (.github/workflows, package.json, angular.json, tsconfig.json) represent the build/test/deployment pipelines and packaging configurations for multiple OS targets (Windows, Linux, macOS).
Relationships and Interactions
• The Electron main process initializes the application and creates one or more renderer windows.
• The Angular application (renderer process) communicates with application services (e.g., appearance.service, collection.service, file.service) to execute business logic.
• The Angular UI is composed of numerous components that interact with each other; for instance, note components use dialogs for editing or confirmations, and common modules share utilities like logging and theme management.
• The services layer abstracts file system operations and persistence, enabling the Angular UI to store and load notes without needing a separate backend server.
• Build scripts and deployment configurations (in the build/ and deployment/ directories) manage packaging and distribution using Electron Builder and other tools.
Architectural Patterns and Design Principles
• Layered Architecture:
– Separation between the Electron shell (main process) and the Angular frontend (renderer process) for a clear demarcation of concerns.
• Component-Based UI:
– Angular’s component architecture breaks the UI into reusable pieces (e.g., dialogs, menus, note editors, collections).
• Service-Oriented Business Logic:
– Angular services and common modules handle data processing, I/O, and application state independently of the UI.
• Modularization:
– The project organizes specific functionalities into dedicated directories (e.g., appearance, collection, search, etc.), promoting maintainability and scalability.
Relevant Technologies and Tools
• Electron: For desktop application packaging and native integration.
• Angular: For building the frontend UI using a component/service architecture.
• Typescript: For stronger type safety and modular development.
• Node.js and NPM: For dependency management and running build/deployment scripts.
• Testing: Jest (see jest.config.js) is used to run tests, indicating testable design.
• Clear Labels: For each component—Electron main process, Angular renderer (further broken down into components, services, and common utilities), assets, and build/deployment infrastructure.
• From the Electron main process to the Angular renderer (initiating window creation and inter-process communication).
• From UI components to services (showing event handling or API calls within the renderer).
• From services to file system or storage components (indicating I/O operations).
• From build and deployment tools to the application packaging output.
• Angular UI components (group them visually).
• Service layers, utilities, and external build tools.