Skip to main content
FilDOS is an Electron + React + TypeScript app built with electron-vite. It has three layers plus a shared contract, and a deliberately strict boundary between them.

The four layers

The renderer never imports Node or Electron and never touches the disk directly. It calls a small, typed set of preload APIs — window.fsapi, window.watcher, window.tags, window.recents, window.views, window.prefs, window.llm, window.chats, window.graph, and so on — each defined in src/preload/index.ts and typed in src/preload/index.d.ts.

Security model

These three settings are non-negotiable and must never be weakened:
Because the renderer is fully sandboxed, every capability it has is something the preload layer explicitly, and narrowly, exposes.

Main process modules

Renderer state

State is React context, no Redux:
  • state/navigation.tsx — current path, back/forward/up history, sort, view mode, column widths, search query, refresh token (useReducer).
  • state/clipboard.tsx / state/undo.tsx / state/toast.tsx — copy/cut, the undo stack, and notifications.
  • hooks/useFileActions.tsall mutations funnel through here; each runs the IPC call, toasts, refreshes, and pushes an inverse onto the undo stack.
  • hooks/useTags.ts — all tag mutations funnel through here so the sidebar, dots, menus, and info panel stay in sync.
Page views like Recents, Tag Files, Canvas, and Ask AI are history entries — the toolbar Back/Forward arrows traverse them alongside folders.

Repository layout

Next

The IPC Contract

The Result-typed spine that connects renderer to disk.

Data Layer

SQLite via node:sqlite + Drizzle, with zero native deps.