# leonelcents04/simple-file-manager architecture

> Architecture diagram of the GitHub repository leonelcents04/simple-file-manager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/leonelcents04/simple-file-manager
- Repository: https://github.com/leonelcents04/simple-file-manager

## Overview

Simple File Manager is a Windows desktop file manager. The user operates through the renderer; its app state and actions call the safe preload API, which reaches main-process IPC handlers for path validation, directory and drive browsing, and protected text-file operations. Results feed the interface’s file viewer, details, and messages. The graph also preserves documented navigation, menus, dialogs, themes, and keyboard access. Some UI-to-IPC wiring is documented in the README rather than shown in the sampled preload source; unsampled internals are not inferred beyond that evidence.

Main entry points: [`src/renderer/app.js`](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/app.js) (App state and actions), [`src/main/ipc.js`](https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/ipc.js) (IPC handlers), [`src/main/file_ops.js`](https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/file_ops.js) (Text file operations), [`src/renderer/ui/sheets.js`](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/sheets.js) (File dialogs and viewer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app["App state and actions<br/>[app.js]"]
  node_menus["Menus and shortcuts<br/>[menubar.js]"]
  node_contextmenu["Context menu<br/>[contextmenu.js]"]
  node_navigation["Folder navigation<br/>[breadcrumbs.js]"]
  node_driveview["Drive sidebar<br/>[sidebar.js]"]
  node_filelist["File list<br/>[list.js]"]
  node_dialogs["File dialogs and viewer<br/>[sheets.js]"]
  node_details["File details<br/>[details.js]"]
  node_feedback["Toast feedback<br/>[toasts.js]"]
end

subgraph group_bridge["Electron bridge"]
  node_preload["Safe preload API<br/>[preload.cjs]"]
  node_main["Window startup<br/>[main.js]"]
  node_ipc["IPC handlers<br/>[ipc.js]"]
end

subgraph group_filesystem["Filesystem services"]
  node_validation["Name and path validation<br/>[validate.js]"]
  node_scanner["Folder scanner<br/>[fs_scan.js]"]
  node_fileops["Text file operations<br/>[file_ops.js]"]
  node_status["Result and error mapping<br/>[status.js]"]
end

subgraph group_shared["Shared presentation"]
  node_messages["User-facing messages<br/>[messages.js]"]
  node_format["Size and date formatting<br/>[format.js]"]
end

node_user(("User"))
node_disk[("Local files and drives")]

node_user -->|"operates"| node_app
node_app -->|"builds menus"| node_menus
node_app -->|"closes menu"| node_contextmenu
node_app -->|"renders location"| node_navigation
node_app -->|"renders drives"| node_driveview
node_app -->|"renders entries"| node_filelist
node_app -->|"opens dialogs"| node_dialogs
node_app -->|"renders details"| node_details
node_app -->|"shows feedback"| node_feedback
node_app -->|"calls file API"| node_preload
node_main -->|"registers handlers"| node_ipc
node_preload -->|"forwards requests"| node_ipc
node_ipc -->|"resolves input"| node_validation
node_ipc -->|"lists folders"| node_scanner
node_ipc -->|"dispatches operations"| node_fileops
node_scanner -->|"reads entries"| node_disk
node_fileops -->|"reads and writes"| node_disk
node_fileops -->|"checks paths"| node_validation
node_fileops -->|"maps failures"| node_status
node_ipc -->|"returns results"| node_status
node_app -->|"uses messages"| node_messages
node_app -->|"formats display"| node_format
node_dialogs -->|"formats metadata"| node_format
node_dialogs -->|"uses notices"| node_messages

click node_app "https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/app.js"
click node_menus "https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/menubar.js"
click node_contextmenu "https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/contextmenu.js"
click node_navigation "https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/breadcrumbs.js"
click node_driveview "https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/sidebar.js"
click node_filelist "https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/list.js"
click node_dialogs "https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/sheets.js"
click node_details "https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/details.js"
click node_feedback "https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/toasts.js"
click node_preload "https://github.com/leonelcents04/simple-file-manager/blob/main/src/preload/preload.cjs"
click node_main "https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/main.js"
click node_ipc "https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/ipc.js"
click node_validation "https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/validate.js"
click node_scanner "https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/fs_scan.js"
click node_fileops "https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/file_ops.js"
click node_status "https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/status.js"
click node_messages "https://github.com/leonelcents04/simple-file-manager/blob/main/src/shared/messages.js"
click node_format "https://github.com/leonelcents04/simple-file-manager/blob/main/src/shared/format.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_menus,node_contextmenu,node_navigation,node_driveview,node_filelist,node_dialogs,node_details,node_feedback,node_user toneBlue
class node_preload,node_main,node_ipc,node_disk toneAmber
class node_validation,node_scanner,node_fileops,node_status toneMint
class node_messages,node_format toneRose
```

## Components

### User interface

- [App state and actions](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/app.js): `src/renderer/app.js`
- [Menus and shortcuts](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/menubar.js): `src/renderer/ui/menubar.js`
- [Context menu](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/contextmenu.js): `src/renderer/ui/contextmenu.js`
- [Folder navigation](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/breadcrumbs.js): `src/renderer/ui/breadcrumbs.js`
- [Drive sidebar](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/sidebar.js): `src/renderer/ui/sidebar.js`
- [File list](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/list.js): `src/renderer/ui/list.js`
- [File dialogs and viewer](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/sheets.js): `src/renderer/ui/sheets.js`
- [File details](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/details.js): `src/renderer/ui/details.js`
- [Toast feedback](https://github.com/leonelcents04/simple-file-manager/blob/main/src/renderer/ui/toasts.js): `src/renderer/ui/toasts.js`

### Electron bridge

- [Safe preload API](https://github.com/leonelcents04/simple-file-manager/blob/main/src/preload/preload.cjs): `src/preload/preload.cjs`
- [Window startup](https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/main.js): `src/main/main.js`
- [IPC handlers](https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/ipc.js): `src/main/ipc.js`

### Filesystem services

- [Name and path validation](https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/validate.js): `src/main/validate.js`
- [Folder scanner](https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/fs_scan.js): `src/main/fs_scan.js`
- [Text file operations](https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/file_ops.js): `src/main/file_ops.js`
- [Result and error mapping](https://github.com/leonelcents04/simple-file-manager/blob/main/src/main/status.js): `src/main/status.js`

### Shared presentation

- [User-facing messages](https://github.com/leonelcents04/simple-file-manager/blob/main/src/shared/messages.js): `src/shared/messages.js`
- [Size and date formatting](https://github.com/leonelcents04/simple-file-manager/blob/main/src/shared/format.js): `src/shared/format.js`

### Other components

- **User**
- **Local files and drives**

## Connections

- User → App state and actions: operates (evidence: `README.md`)
- App state and actions → Menus and shortcuts: builds menus (evidence: `src/renderer/app.js`)
- App state and actions → Context menu: closes menu (evidence: `src/renderer/app.js`)
- App state and actions → Folder navigation: renders location (evidence: `src/renderer/app.js`)
- App state and actions → Drive sidebar: renders drives (evidence: `src/renderer/app.js`)
- App state and actions → File list: renders entries (evidence: `src/renderer/app.js`)
- App state and actions → File dialogs and viewer: opens dialogs (evidence: `src/renderer/app.js`)
- App state and actions → File details: renders details (evidence: `src/renderer/app.js`)
- App state and actions → Toast feedback: shows feedback (evidence: `src/renderer/app.js`)
- App state and actions → Safe preload API: calls file API (evidence: `README.md`)
- Window startup → IPC handlers: registers handlers (evidence: `src/main/main.js`)
- Safe preload API → IPC handlers: forwards requests (evidence: `README.md`)
- IPC handlers → Name and path validation: resolves input (evidence: `src/main/ipc.js`)
- IPC handlers → Folder scanner: lists folders (evidence: `src/main/ipc.js`)
- IPC handlers → Text file operations: dispatches operations (evidence: `src/main/ipc.js`)
- Folder scanner → Local files and drives: reads entries (evidence: `README.md`)
- Text file operations → Local files and drives: reads and writes (evidence: `src/main/file_ops.js`)
- Text file operations → Name and path validation: checks paths (evidence: `src/main/file_ops.js`)
- Text file operations → Result and error mapping: maps failures (evidence: `src/main/file_ops.js`)
- IPC handlers → Result and error mapping: returns results (evidence: `src/main/ipc.js`)
- App state and actions → User-facing messages: uses messages (evidence: `src/renderer/app.js`)
- App state and actions → Size and date formatting: formats display (evidence: `src/renderer/app.js`)
- File dialogs and viewer → Size and date formatting: formats metadata (evidence: `src/renderer/ui/sheets.js`)
- File dialogs and viewer → User-facing messages: uses notices (evidence: `src/renderer/ui/sheets.js`)
