Search documentation
Search the Foldnano user guide, plugin docs and contributor docs

Architecture Overview

Foldnano separates the DNA model, command/history layer, editor session, view context, and viewer components.

Main Areas

AreaResponsibility
src/lib/modelPart, regions, virtual helices, oligos, segments, ends, sequence slots
src/lib/commandsUndoable mutations and history capture
src/lib/components/Editor/contextDocument session and view context
src/lib/components/EditorEditor shell, toolbar, panels, viewers
src/lib/services/storageIndexedDB and GitHub-backed document providers
src/lib/pluginPlugin manifests, runtime coordination, Python bridge
src/routesSvelteKit pages and API proxies

Editor Session Split

EditorDocumentSession owns document state, the history stack, storage manager, GitHub metadata, and tab ownership.

EditorViewContext owns active editor mode, active region/viewer state, strand-view context, UI controllers, selection sets, and derived tab-owner state.

Keep persistence and document lifecycle in the session. Keep transient editor UI state in the view context.

Viewer Responsibilities

  • Strand view is the main routing surface.
  • Helix/lattice and freeform viewers edit virtual-helix placement in a design region.
  • 3D view inspects lab-frame geometry, plane transforms, simulation previews, and 3D exports.

All lab-frame placement should come from part.getVirtualHelixFrame(vh).