Development Guide¶
Repository layout¶
Path |
Purpose |
|---|---|
|
Electron startup, single-instance behavior, deep links, menu. |
|
Typed bridge from renderer to privileged IPC handlers. |
|
Main-process integrations (Ollama, auth, spaces, utility services). |
|
Renderer HTML pages, UI scripts, styles, static assets. |
|
Build helpers (vendor bundling, archive extraction, cleanup). |
|
Sphinx documentation source. |
TypeScript settings¶
src/tsconfig.json enables strict mode and modern nodenext module
resolution. Keep new files consistent with current settings:
strict: truenoUncheckedIndexedAccess: trueexactOptionalPropertyTypes: trueisolatedModules: true
Local development loop¶
From src/:
npm install
npm run watch
In another terminal:
cd src
npm start
Adding a new IPC feature¶
Implement handler in an appropriate
src/node-apis/*.tsmodule.Register channel in module
register()function.Expose a typed preload bridge method in
src/preload.cts.Update global renderer typings in
src/global.d.ts.Consume the method from renderer script.
Add or update docs in IPC API Reference.
Debugging tips¶
Use the View menu action to toggle developer tools.
Check proxy logs using
window.ollama.getServerLogs().Verify data files in
app.getPath("userData")paths listed in Architecture.
Documentation maintenance¶
Build docs locally:
python -m pip install -r docs/requirements.txt
sphinx-build -b html docs/source docs/build/html
When IPC methods, storage paths, or startup flows change, update: