mirror of
https://github.com/Pandipipas/scoreko-electron-dev.git
synced 2026-06-06 05:32:06 +00:00
25 lines
1000 B
Markdown
25 lines
1000 B
Markdown
# Main process architecture
|
|
|
|
## Startup flow
|
|
|
|
1. `src/main/main.ts` loads `appConfig` from `config/runtime-config.ts`.
|
|
2. Creates windows (`windows/window-factory.ts`).
|
|
3. Starts NodeCG with `nodecg/process-manager.ts`.
|
|
4. Waits for HTTP readiness and shows loading -> main dashboard.
|
|
5. On shutdown, runs a single graceful-stop flow to avoid orphan processes.
|
|
|
|
## Main modules
|
|
|
|
- `config/runtime-config.ts`: read/validate env vars.
|
|
- `nodecg/process-manager.ts`: start, readiness, and stop for NodeCG; install/permission/port validation.
|
|
- `windows/window-factory.ts`: window creation and navigation policy.
|
|
- `windows/navigation-security.ts`: internal navigation allowlist and safe external schemes.
|
|
- `errors/error-presenter.ts`: fatal error presentation.
|
|
- `errors/logger.ts`: structured logging (`info/warn/error/debug`).
|
|
|
|
## Principles
|
|
|
|
- Mechanical refactors first.
|
|
- Incremental hardening with conservative fallback.
|
|
- Automated validation via `typecheck`, `build`, `test`, `doctor`, `lint`.
|