How ufumzy/flownoteapp works
FlowNote is a desktop note-taking app built as an Electron application with a clear three-process boundary: Electron main process, preload bridge, and React renderer UI. The architecture is optimized around local note editing and window chrome control rather than a client/server backend.
1. Top-level runtime split
• Main process: app lifecycle, native window creation, packaging, and Electron-specific system integration.
• Preload layer: the only intended bridge between Node/Electron capabilities and the browser-like UI.
• Renderer process: the full user-facing application, implemented as a React single-page app.
2. Main process responsibilities
• src/main/index.ts is the entrypoint for Electron startup.
• src/main/lib likely holds window/setup helpers and any main-process utilities.
• This layer is the boundary for native behavior such as BrowserWindow setup, app events, splash/welcome handling, and packaging hooks.
3. Preload as the security boundary
• src/preload/index.ts exposes a limited API surface to the renderer.
• src/preload/index.d.ts provides TypeScript typing for that exposed API.
• This is the architectural boundary preventing direct renderer access to Node/Electron internals.
4. Renderer as the product UI
• src/renderer contains the React application and all note-taking UI.
• src/renderer/src/App.tsx and main.tsx bootstrap the app shell.
• The UI is organized around a custom layout, floating title area, window controls, note list sidebar, editor pane, search, and settings modal.
5. Core note workflow
• The primary interaction flow is: select or create a note, preview it in the sidebar, edit its Markdown/MDX content, and manage it through action buttons.
• MarkdownEditor.tsx is the central editing surface and likely wraps @mdxeditor/editor.
• NotePreviewList.tsx, NotePreview.tsx, SearchInput.tsx, NewNoteButton.tsx, and DeleteNoteButton.tsx form the note-management surface.
6. State management
• The app uses Jotai (src/renderer/src/store) for atomic state.
• src/renderer/src/hooks/useNotesList.tsx and useMarkdownEditor.tsx suggest stateful UI orchestration lives in hooks, not inside individual components.
• store/mocks indicates mocked store data or a development/test fallback path for rendering without real note data.
7. Shared domain layer
• src/shared/constants.ts, models.ts, and types.ts define cross-process contracts and app-wide data shapes.
• This shared layer is important because Electron apps often need consistent types between main, preload, and renderer.
• It likely contains note models, UI constants, and IPC-related types or enums.
8. UI composition and layout
• AppLayout.tsx, DraggableTopBar.tsx, FloatingNoteTitle.tsx, and WindowControls.tsx define the desktop-native shell.
• The app intentionally uses a custom draggable top bar instead of relying on default OS chrome.
• This is a key architectural feature because it changes how the window is drawn and how users interact with the app frame.
9. Settings and customization
• SettingsModal.tsx supports personalization, matching the README’s emphasis on background opacity, font colors, and sizes.
• Styling is handled with Tailwind and local CSS (src/renderer/src/assets/index.css), so visual customization is primarily renderer-side and theme-driven.
10. Static resources and onboarding
• resources/splash.html is a packaging/runtime asset for startup presentation.
• resources/welcomeNote.md suggests the app ships with a starter note or onboarding content.
• These resources support first-run and branding behavior without needing a backend.
11. Build and packaging boundary
• The repo uses Vite for the renderer and Electron tooling for multi-process builds.
• electron.vite.config.ts and electron-builder.yml indicate separate build orchestration for main, preload, and renderer, plus packaged app output for Windows/macOS/Linux.
• This is a desktop-distribution architecture, not a web deployment architecture.
12. What is not present
• There is no server, API layer, or database service visible in the tree.
• The app appears to be a self-contained local desktop client, with all product logic happening inside Electron and the renderer state layer.
For an architecture diagram, the main boxes should be: Electron main process, preload bridge, React renderer shell, note editor/listing UI, Jotai state/hooks, and shared types/constants, with packaging/build tooling as a separate supporting lane.
Main entry points: ActionButtonsRow.tsx Note workspace · main/index.ts Main entry · store/index.ts State store · preload/index.ts Preload bridge
Components 22
Runtime
Electron runtime boundary split across main, preload, and renderer.
- Main entry · Starts Electron, manages app lifecycle, and creates native windows.
src/main/index.ts - Main helpers · Main-process helpers and setup logic.
src/main/lib/index.ts - Preload bridge · Exposes a limited API from Electron to the renderer.
src/preload/index.ts - Bridge types · TypeScript definitions for the preload-exposed API.
src/preload/index.d.ts
Renderer UI
React application, note workflow, and desktop shell.
- App bootstrap · Bootstraps the React renderer application.
src/renderer/src/main.tsx - App shell · Top-level application composition and page routing shell.
src/renderer/src/App.tsx - Layout shell · Custom draggable window layout and frame composition.
src/renderer/src/components/AppLayout.tsx - Top bar · Draggable title area and window control surface.
src/renderer/src/components/DraggableTopBar.tsx - Window controls · Minimize, maximize, and close controls for the desktop window.
src/renderer/src/components/WindowControls.tsx - Note workspace · Primary note-management surface combining list, search, actions, and editor.
src/renderer/src/components/ActionButtonsRow.tsx - Note list · Sidebar preview list for browsing and selecting notes.
src/renderer/src/components/NotePreviewList.tsx - Editor · Central Markdown/MDX editing surface.
src/renderer/src/components/MarkdownEditor.tsx - Settings · Customization modal for appearance and app preferences.
src/renderer/src/components/SettingsModal.tsx - UI hooks · Stateful orchestration for notes and editor behavior.
src/renderer/src/hooks/useNotesList.tsx - State store · Atomic application state for notes and UI.
src/renderer/src/store/index.ts - Mock store · Fallback or development note data for the store.
src/renderer/src/store/mocks/index.ts
Shared Domain
Contracts and types shared across processes.
Support
Packaging assets and build orchestration.
- Splash screen · Packaged startup splash page.
resources/splash.html - Welcome note · Built-in onboarding or seed note content.
resources/welcomeNote.md - Build config · Electron and packaging configuration for app builds.
electron.vite.config.ts
Connections 22
- Main entry → Main helpers: uses · Main startup delegates helper logic to main-process utilities.
- Main entry → Preload bridge: loads · Electron main loads the preload script into renderer windows.
- Preload bridge → Bridge types: defines · Preload implementation is paired with its exposed API typings.
- App bootstrap → App shell: mounts · Renderer entry mounts the application shell.
- App shell → Layout shell: composes · App shell is framed by the custom desktop layout.
- Layout shell → Top bar: includes · Layout includes the draggable title area.
- Layout shell → Window controls: includes · Layout includes native window control buttons.
- App shell → Note workspace: renders · The shell centers on the main note-taking workspace.
- Note workspace → Note list: contains · Workspace includes note browsing and selection.
- Note workspace → Editor: contains · Workspace includes the main editing surface.
- Note workspace → Settings: opens · Workspace can surface app settings and customization.
- UI hooks → State store: orchestrates · Hooks coordinate state access and update flow.
- State store → Mock store: falls back to · Store can use mock data for development or empty-state rendering.
- Note workspace → UI hooks: uses · Note UI relies on hooks for stateful behavior.
- State store → Models: shapes · State uses shared domain models for notes and app data.
- State store → Types: contracts · State and IPC flows rely on shared type contracts.
- Main entry → Types: contracts · Main process shares typed boundaries with preload and renderer.
- Preload bridge → Types: contracts · Preload bridge exposes typed capabilities to the renderer.
- App bootstrap → Constants: uses · Renderer bootstrapping consumes shared constants.
- Main entry → Build config: builds with · Electron entry is packaged through the build configuration.
- Build config → Splash screen: bundles · Build tooling includes the splash asset.
- Build config → Welcome note: bundles · Build tooling includes starter note content.