[idea] Docker 03/14: Move sidecar boot and its watchers out of index.ts
Author: AnishSarkar22Created Oct 1, 2026Updated Oct 1, 2026
Labelsenhancementhelp wantedrefactordesktopdocker
Which part? Desktop app
What would you like?
Step 3 of 14 of #2100: running SurfSense in Docker. Depends on #2102; start once it is merged.
Make starting the sidecars reusable without Electron, so the container can run the same code.
Design: Docker proposal, The supervisor, shared with Electron
What to change
- Move
bootSidecars()fromsurfsense_local/electron/src/main/index.tstoelectron/src/main/sidecars/boot.ts. It takes its paths, the packaged flag and the secret as a context instead of readingapp,process.resourcesPathorsafeStorage. - Move each watcher to its own file in
sidecars/:watch-generation-preset.ts,watch-audio-models.ts,watch-image-model.ts. index.tsbuilds the context from Electron and calls them. The crash notice to the window stays inindex.ts, passed in as the crash handler.
Done when
-
pnpm test,pnpm typecheckandpnpm devwork as before. - No file in
electron/src/main/sidecars/importselectron. - The watchers have tests of their own.
Scope: code and tests only. Don't edit docs/ or AGENTS.md, except to fix a link this change breaks; the maintainers update the docs when the Docker work ships.
Why would it help?
Each step leaves something that runs, so the Docker image is built and reviewed one piece at a time.
Source: MODSetter/SurfSense