Browser security prevents any web application from reading or writing to the user’s real file system without explicit permission dialogs. NEX OS takes a different approach entirely: it implements a complete Virtual File System (VFS) that lives entirely in React state, managed byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/shadownrx/windows/llms.txt
Use this file to discover all available pages before exploring further.
FileSystemProvider and consumed through the useFileSystem() hook. From the perspective of every application running inside NEX OS — File Explorer, Notepad, the Terminal, the NEX Runtime package manager — this in-memory tree behaves identically to a real disk. Files can be created, read, updated, and deleted, folders can be navigated, and recursive deletions correctly clean up all descendants.
The VirtualFile Interface
Every item stored in the VFS is represented by a VirtualFile object. The location field acts as the directory path, and the combination of location + name + extension forms the full virtual path.
There is no separate “folder” type in the
VirtualFile interface. Folders are represented implicitly by the path segments in location. The createFolder method creates a sentinel entry that File Explorer uses to display the directory, but actual content lives in files.FileSystemContextType Methods
useFileSystem() exposes the following API surface. All mutations trigger a React state update, causing subscribed components to re-render with the new file tree.
| Method | Parameters | Description |
|---|---|---|
createFile | location, name, ext | Creates a new VirtualFile at the given path and returns its generated id. Used by Notepad on Save, by NEX Runtime when scaffolding package.json, and by File Explorer’s New File context menu. |
updateFileContent | id, content | Replaces the content field of the file with the given id. The only mutation that modifies an existing file’s body — used by Notepad, VS Code, and the NEX Runtime installer. |
navigate | path: string | Updates currentPath in context, causing File Explorer to display the contents of the new directory. |
openFile | file: VirtualFile | Reads the file’s extension and content, then calls openWindow from WindowManagerContext with the appropriate application (e.g., .txt → Notepad, .nex → NEX Runtime launcher). |
createFolder | name: string | Creates a new folder entry at the current path. Subsequent files created inside it reference this path in their location field. |
deleteFile | path: string | Removes the file or folder at the given path. If the target is a folder, all files and subfolders beneath it are deleted recursively — no orphaned entries remain in the files array. |
getFileContent | path: string | Resolves a full virtual path and returns the file’s content string, or a Buffer equivalent for binary representations. Used by the NEX Runtime to read package.json before installing dependencies. |
Reactive Properties
| Property | Type | Description |
|---|---|---|
files | VirtualFile[] | The complete flat array of all virtual files. Components filter this array by location to display directory contents. |
currentPath | string | The path currently open in File Explorer, updated by navigate(). |
Default Directory Tree
FileSystemProvider initialises with a pre-populated directory tree that mirrors a standard Windows file system layout. This tree is created in React state at provider mount time — no disk reads occur.
C:/Users/Default/ by default. The NEX Runtime places scaffolded projects under whatever path the Terminal’s current working directory points to.
.nex Executables
.nex files are the virtual equivalent of .exe binaries on Windows. They are stored in the VFS as regular VirtualFile entries with extension: 'nex', but their content field carries a JSON metadata block called nexPayload that tells the OS which application to launch and with what initial props.
.nex file is encountered, the system reads this payload and calls openWindow with the resolved app component from the app registry — no network request, no binary execution. Three entry points can trigger a .nex launch:
Double-click in File Explorer
FileExplorer.tsx calls openFile(file) from useFileSystem(). The context detects the .nex extension, parses nexPayload from content, and calls openWindow on WindowManagerContext with the correct app id, title, icon, and content component.Win+R Run Dialog
The Run dialog calls
resolveNex(input) from NexRuntimeContext. This method accepts both explicit names (notepad.nex) and implicit names (notepad), appending .nex automatically and searching C:/Program Files/NEX/ to find and launch the matching executable.Using the VFS in an Application — Notepad Example
The following example is the canonical pattern for an app that reads and writes VFS files. The component is completely decoupled from the file system implementation — it receives afileId prop and uses useFileSystem() to resolve the content.
Security Model
The VFS is fully sandboxed within the browser tab’s JavaScript heap. This sandboxing is a security feature, not a limitation. It means:- Applications cannot read sensitive files from the user’s machine
- Malicious
.nexexecutables cannot escape the browser sandbox - The OS can be safely embedded in any web page or iframe
- TypeScript’s strict mode catches type mismatches in file paths at compile time, before any runtime errors can occur