# stepanbudivsky/hell-and-paradise architecture

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

- Interactive diagram: https://gitdiagram.com/stepanbudivsky/hell-and-paradise
- Repository: https://github.com/stepanbudivsky/hell-and-paradise

## Overview

This appears to be an Electron trading-analysis application: users inspect market candles and technical overlays, review scenario-based long/short analysis, and can evaluate marked trades against historical candles. The tree also indicates interval-specific settings, chart controls, and local candle persistence. The sampled code confirms the MACD worker flow, portions of wave and Fibonacci analysis, pivot-line rendering, scenario-driven UI updates, and Electron candle storage; wiring between several other subsystems is not shown, so those links are omitted.

Main entry points: [`calcFunction/worker.js`](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/calcFunction/worker.js) (MACD worker), [`chart-data.js`](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/chart-data.js) (Market data state), [`index.js`](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/index.js) (Electron shell), [`renderFunction/create-pivot-point-lines.js`](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/renderFunction/create-pivot-point-lines.js) (Pivot levels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_electron["Electron shell<br/>[index.js]"]
  node_candle_store[("Candle files<br/>[index.js]")]
end

subgraph group_market["Market charts"]
  node_chart_data["Market data state<br/>[chart-data.js]"]
  node_chart["Chart series<br/>[main.js]"]
  node_chart_control["Chart controls<br/>[chart-control.js]"]
end

subgraph group_analysis["Technical analysis"]
  node_indicators["Indicator calculations"]
  node_macd_worker["MACD worker<br/>[worker.js]"]
  node_macd_segments["MACD segments"]
  node_markers["Extrema markers"]
  node_wave_analysis["Wave analysis<br/>[analyze-wave.js]"]
  node_fib_analysis["Fibonacci analysis"]
  node_ma_analysis["MA crossing rules<br/>[analyze-ma.js]"]
  node_pivot_lines["Pivot levels"]
end

subgraph group_decisions["Scenarios and trades"]
  node_scenario_data["Scenario definitions<br/>[all-scenarios.js]"]
  node_analysis_ui["Analysis panels<br/>[update-analyze.js]"]
  node_trade_calc["Deal calculator<br/>[deal-calculator.js]"]
  node_backtest["Trade backtest"]
end

subgraph group_config["Controls and settings"]
  node_settings["Program settings"]
  node_line_settings["Overlay controls"]
end

node_user(("Analyst"))
node_binance(("Binance market"))

node_user -->|"selects market view"| node_chart_control
node_chart_control -->|"updates chart state"| node_chart_data
node_chart_data -->|"supplies chart data"| node_chart
node_macd_worker -->|"calculates MACD"| node_indicators
node_macd_worker -->|"finds segments"| node_macd_segments
node_macd_worker -->|"extracts markers"| node_markers
node_wave_analysis -->|"uses crossing rules"| node_ma_analysis
node_fib_analysis -->|"uses crossing rules"| node_ma_analysis
node_analysis_ui -->|"reads scenario text"| node_scenario_data
node_pivot_lines -->|"reads candles"| node_chart_data
node_pivot_lines -->|"reads overlay settings"| node_settings
node_backtest -->|"reads scenarios"| node_scenario_data
node_line_settings -->|"updates settings"| node_settings
node_electron -->|"reads and writes candles"| node_candle_store
node_electron -.->|"sets request origin"| node_binance

click node_electron "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/index.js"
click node_candle_store "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/index.js"
click node_chart_data "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/chart-data.js"
click node_chart "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/main.js"
click node_chart_control "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/chart-control.js"
click node_indicators "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/indecators/ema-macd-rsi-ma-indecator.js"
click node_macd_worker "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/calcFunction/worker.js"
click node_macd_segments "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/indecators/find-macd-segments.js"
click node_markers "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/indecators/find-min-max-dots.js"
click node_wave_analysis "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/analyze/analyze-wave.js"
click node_fib_analysis "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/analyze/analyze-fibanachi.js"
click node_ma_analysis "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/analyze/analyze-ma.js"
click node_pivot_lines "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/renderFunction/create-pivot-point-lines.js"
click node_scenario_data "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/settingsData/all-scenarios.js"
click node_analysis_ui "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/chartLogic/update-analyze.js"
click node_trade_calc "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/deal-calculator.js"
click node_backtest "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/chartLogic/test-deals/backtest-markers.js"
click node_settings "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/program-settings.js"
click node_line_settings "https://github.com/stepanbudivsky/hell-and-paradise/blob/main/menus/global-line-setting-work.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_electron,node_candle_store toneBlue
class node_chart_data,node_chart,node_chart_control toneAmber
class node_indicators,node_macd_worker,node_macd_segments,node_markers,node_wave_analysis,node_fib_analysis,node_ma_analysis,node_pivot_lines toneMint
class node_scenario_data,node_analysis_ui,node_trade_calc,node_backtest toneRose
class node_settings,node_line_settings,node_user,node_binance toneIndigo
```

## Components

### Desktop app

- [Electron shell](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/index.js): `index.js`
- [Candle files](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/index.js): `index.js`

### Market charts

- [Market data state](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/chart-data.js): `chart-data.js`
- [Chart series](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/main.js): `main.js`
- [Chart controls](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/chart-control.js): `chart-control.js`

### Technical analysis

- [Indicator calculations](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/indecators/ema-macd-rsi-ma-indecator.js): `indecators/ema-macd-rsi-ma-indecator.js`
- [MACD worker](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/calcFunction/worker.js): `calcFunction/worker.js`
- [MACD segments](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/indecators/find-macd-segments.js): `indecators/find-macd-segments.js`
- [Extrema markers](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/indecators/find-min-max-dots.js): `indecators/find-min-max-dots.js`
- [Wave analysis](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/analyze/analyze-wave.js): `analyze/analyze-wave.js`
- [Fibonacci analysis](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/analyze/analyze-fibanachi.js): `analyze/analyze-fibanachi.js`
- [MA crossing rules](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/analyze/analyze-ma.js): `analyze/analyze-ma.js`
- [Pivot levels](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/renderFunction/create-pivot-point-lines.js): `renderFunction/create-pivot-point-lines.js`

### Scenarios and trades

- [Scenario definitions](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/settingsData/all-scenarios.js): `settingsData/all-scenarios.js`
- [Analysis panels](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/chartLogic/update-analyze.js): `chartLogic/update-analyze.js`
- [Deal calculator](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/deal-calculator.js): `deal-calculator.js`
- [Trade backtest](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/chartLogic/test-deals/backtest-markers.js): `chartLogic/test-deals/backtest-markers.js`

### Controls and settings

- [Program settings](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/program-settings.js): `program-settings.js`
- [Overlay controls](https://github.com/stepanbudivsky/hell-and-paradise/blob/main/menus/global-line-setting-work.js): `menus/global-line-setting-work.js`

### Other components

- **Analyst**
- **Binance market**

## Connections

- Analyst → Chart controls: selects market view
- Chart controls → Market data state: updates chart state
- Market data state → Chart series: supplies chart data
- MACD worker → Indicator calculations: calculates MACD
- MACD worker → MACD segments: finds segments
- MACD worker → Extrema markers: extracts markers
- Wave analysis → MA crossing rules: uses crossing rules
- Fibonacci analysis → MA crossing rules: uses crossing rules
- Analysis panels → Scenario definitions: reads scenario text
- Pivot levels → Market data state: reads candles
- Pivot levels → Program settings: reads overlay settings
- Trade backtest → Scenario definitions: reads scenarios
- Overlay controls → Program settings: updates settings
- Electron shell → Candle files: reads and writes candles
- Electron shell → Binance market: sets request origin
