Files
scoreko-electron-dev/docs/architecture.md
T
Pandipipas 41e4e91c4b feat: enhance NodeCG runtime management and packaging
- Update .gitignore and .prettierignore to exclude additional cache and configuration files.
- Revise README.md for clarity on build processes and runtime behavior.
- Improve architecture documentation to reflect changes in startup flow and module responsibilities.
- Modify troubleshooting guide to address common runtime issues and installation steps.
- Enhance ESLint configuration to ignore more directories.
- Update package.json scripts for better build and distribution processes.
- Introduce build-scoreko-bundle.mjs for building the Scoreko bundle.
- Implement prepare-nodecg-runtime.mjs for managing NodeCG runtime installation and updates.
- Add runtime-provisioner.ts to handle user-specific NodeCG runtime provisioning.
- Create tests for runtime provisioning to ensure correct behavior.
- Refactor process-manager.ts and main.ts to integrate new runtime management logic.
2026-05-09 17:45:36 +02:00

1.2 KiB

Main process architecture

Startup flow

  1. src/main/main.ts loads appConfig from config/runtime-config.ts.
  2. Copies the packaged NodeCG runtime from app resources to user data when needed (nodecg/runtime-provisioner.ts).
  3. Creates windows (windows/window-factory.ts).
  4. Starts NodeCG with nodecg/process-manager.ts.
  5. Waits for HTTP readiness and shows loading -> main dashboard.
  6. On shutdown, runs a single graceful-stop flow to avoid orphan processes.

Main modules

  • config/runtime-config.ts: read/validate env vars.
  • nodecg/runtime-provisioner.ts: install/refresh the managed runtime in the writable user data folder.
  • 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.