# diker0k/skoipt_shedule architecture

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

- Interactive diagram: https://gitdiagram.com/diker0k/skoipt_shedule
- Repository: https://github.com/diker0k/skoipt_shedule

## Overview

##### Main components
- Electron Main Process: Represented under the src/main directory (files such as main.ts, menu.ts, preload.ts, util.ts). This process is responsible for creating windows, handling system-level interactions, and bridging the Node.js environment with the renderer.
- Preload Script: Found under src/main/preload.ts and referenced for secure context bridging between the main and renderer.
- Renderer Process: Found under the src/renderer folder with index.tsx, index.ejs, and a collection of React components (organized under components and pages directories). This is where the UI is rendered and controlled by React.
- Webpack & Build Configurations: Clearly visible in the .erb/configs and package.json files. These manage bundling and development/production builds.
- Testing: Located in src/__tests__; include testing frameworks and scripts for unit/integration testing.
- Scripts and Development Tools: Under .erb/scripts, including various helper scripts (like electron-rebuild.js, clean.js, etc.) that are used for building and packaging.

##### Front-end and back-end (Electron main) separation
- Electron architecture: show the main process (Node.js) and its interactions with the renderer process (React).
- Preload script that safely exposes selective Node APIs to the renderer.
- That the renderer is essentially a React-based SPA hosted within an Electron window.
- That Webpack configurations, found in .erb/configs, are used to bundle both the main and renderer processes and manage environment-specific builds (development vs. production).

##### Interactions and data flow
- That API calls, events, or state changes are passed from the renderer to the main process via IPC.

##### Important architectural patterns and technologies
- MVC or Component-based architecture in the renderer: Use labels to show how different React components and pages (such as Home, Calls, News, etc.) interact or form part of the UI.
- Use of Electron’s multi-process model: Clearly separate the Node.js-based main process from the web-based renderer.
- Build & Configuration Management: Indicate the role of Webpack (with multiple config files for production and development) and other scripts that facilitate a reliable build process.
- Testing: Include a note for the testing component that uses Jest or similar (given the __tests__ folder).

## Diagram (Mermaid)

```mermaid
flowchart TB

  subgraph "Electron Main Layer"
    EM["Electron Main Process\n(src/main)"]:::main
    PS["Preload Script\n(src/main/preload.ts)"]:::preload
  end

  subgraph "Renderer Layer"
    RP["Renderer Process\n(src/renderer)"]:::renderer
    RC["React Components & Pages"]:::react
  end

  subgraph "Build & Configurations"
    WB["Webpack & Build Configurations\n(.erb/configs & package.json)"]:::build
    ST["Scripts & Development Tools\n(.erb/scripts)"]:::scripts
  end

  subgraph "Support Assets"
    AS["Assets\n(assets)"]:::assets
    TS["Testing\n(src/__tests__)"]:::tests
  end

  %% Interactions
  EM -->|"creates-window"| RP
  EM <-->|"IPC-bridge"| PS
  RP -->|"sends-IPC"| EM
  
  WB -->|"bundles-processes"| EM
  WB -->|"bundles-processes"| RP
  ST -->|"supports-build"| WB
  
  RP -->|"renders"| RC

  %% Click Events
  click EM "https://github.com/diker0k/skoipt_shedule/tree/main/src/main"
  click PS "https://github.com/diker0k/skoipt_shedule/blob/main/src/main/preload.ts"
  click RP "https://github.com/diker0k/skoipt_shedule/tree/main/src/renderer"
  click WB "https://github.com/diker0k/skoipt_shedule/tree/main/.erb/configs"
  click ST "https://github.com/diker0k/skoipt_shedule/tree/main/.erb/scripts"
  click AS "https://github.com/diker0k/skoipt_shedule/tree/main/assets"
  click TS "https://github.com/diker0k/skoipt_shedule/tree/main/src/__tests__"

  %% Styles
  classDef main fill:#AEDFF7,stroke:#1E81B0,stroke-width:2px;
  classDef preload fill:#F7E1AE,stroke:#B08C1B,stroke-width:2px;
  classDef renderer fill:#C1F7AE,stroke:#379237,stroke-width:2px;
  classDef react fill:#D1AEF7,stroke:#7321B0,stroke-width:2px;
  classDef build fill:#F7C1AE,stroke:#B05D21,stroke-width:2px;
  classDef scripts fill:#F7D8AE,stroke:#B08021,stroke-width:2px;
  classDef assets fill:#E1F7AE,stroke:#3B7B21,stroke-width:2px;
  classDef tests fill:#E1AEF7,stroke:#7B21B0,stroke-width:2px;
```
