# bmelnikov02/vfs-emulator architecture

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

- Interactive diagram: https://gitdiagram.com/bmelnikov02/vfs-emulator
- Repository: https://github.com/bmelnikov02/vfs-emulator

## Overview

VFS Emulator is a small Qt GUI command emulator. Users provide a VFS path and startup-script path at launch; the window runs the script and accepts interactive commands, displaying results in the GUI. The VFS path is reported by `conf-dump` but the sampled runtime does not access the physical VFS. Command handling and script execution are implemented together in `mainwindow.cpp`; the UI layout is represented separately. The startup-script input is supported by the README and source; no additional VFS operations are evidenced.

Main entry points: [`src/mainwindow.cpp`](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp) (Main window), [`src/mainwindow.ui`](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.ui) (Output display), [`src/main.cpp`](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/main.cpp) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Application startup"]
  node_main["Application entry<br/>[main.cpp]"]
  node_script_runner["Script runner<br/>[mainwindow.cpp]"]
end

subgraph group_interface["GUI interface"]
  node_window["Main window<br/>[mainwindow.cpp]"]
  node_ui_layout["Window layout<br/>[mainwindow.ui]"]
  node_command_input["Command input<br/>[mainwindow.ui]"]
  node_output["Output display<br/>[mainwindow.ui]"]
end

subgraph group_commands["Command execution"]
  node_dispatcher["Command dispatcher<br/>[mainwindow.cpp]"]
  node_ls_cd["ls / cd stubs<br/>[mainwindow.cpp]"]
  node_conf_dump["Configuration dump<br/>[mainwindow.cpp]"]
  node_exit_command["Exit command<br/>[mainwindow.cpp]"]
  node_unknown_command["Unknown command<br/>[mainwindow.cpp]"]
end

node_user(("User"))
node_cli_args["Launch arguments"]
node_startup_file["Startup script"]

node_user -->|"provides paths"| node_cli_args
node_cli_args -->|"passes arguments"| node_main
node_main -->|"constructs window"| node_window
node_window -->|"sets up"| node_ui_layout
node_user -->|"enters command"| node_command_input
node_command_input -->|"return pressed"| node_window
node_window -->|"dispatches command"| node_dispatcher
node_window -->|"runs at startup"| node_script_runner
node_script_runner -->|"reads lines"| node_startup_file
node_script_runner -->|"executes each line"| node_dispatcher
node_dispatcher -->|"handles ls / cd"| node_ls_cd
node_dispatcher -->|"handles conf-dump"| node_conf_dump
node_dispatcher -->|"handles exit"| node_exit_command
node_dispatcher -->|"handles other commands"| node_unknown_command
node_ls_cd -->|"appends stub output"| node_output
node_conf_dump -->|"appends paths"| node_output
node_exit_command -->|"closes window"| node_window
node_unknown_command -->|"appends error"| node_output
node_window -->|"appends prompts"| node_output

click node_main "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/main.cpp"
click node_window "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp"
click node_ui_layout "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.ui"
click node_command_input "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.ui"
click node_output "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.ui"
click node_script_runner "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp"
click node_dispatcher "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp"
click node_ls_cd "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp"
click node_conf_dump "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp"
click node_exit_command "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp"
click node_unknown_command "https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp"

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_main,node_script_runner,node_user toneBlue
class node_window,node_ui_layout,node_command_input,node_output toneAmber
class node_dispatcher,node_ls_cd,node_conf_dump,node_exit_command,node_unknown_command toneMint
class node_cli_args,node_startup_file toneIndigo
```

## Components

### Application startup

- [Application entry](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/main.cpp): `src/main.cpp`
- [Script runner](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`

### GUI interface

- [Main window](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Window layout](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.ui): `src/mainwindow.ui`
- [Command input](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.ui): `src/mainwindow.ui`
- [Output display](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.ui): `src/mainwindow.ui`

### Command execution

- [Command dispatcher](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [ls / cd stubs](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Configuration dump](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Exit command](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Unknown command](https://github.com/bmelnikov02/vfs-emulator/blob/main/src/mainwindow.cpp): `src/mainwindow.cpp`

### Other components

- **User**
- **Launch arguments**
- **Startup script**

## Connections

- User → Launch arguments: provides paths
- Launch arguments → Application entry: passes arguments
- Application entry → Main window: constructs window
- Main window → Window layout: sets up
- User → Command input: enters command
- Command input → Main window: return pressed
- Main window → Command dispatcher: dispatches command
- Main window → Script runner: runs at startup
- Script runner → Startup script: reads lines
- Script runner → Command dispatcher: executes each line
- Command dispatcher → ls / cd stubs: handles ls / cd
- Command dispatcher → Configuration dump: handles conf-dump
- Command dispatcher → Exit command: handles exit
- Command dispatcher → Unknown command: handles other commands
- ls / cd stubs → Output display: appends stub output
- Configuration dump → Output display: appends paths
- Exit command → Main window: closes window
- Unknown command → Output display: appends error
- Main window → Output display: appends prompts
