NodeDriveFS is the native macOS companion client for NodeDrive.
While the core NodeDrive repository handles the Node.js/Express server, file storage, and web interface, NodeDriveFS bridges that server directly into your macOS operating system. By leveraging Apple's File Provider framework, it mounts your remote NodeDrive instance as a virtual drive in the macOS Finder, allowing you to browse, edit, and manage your remote files exactly as if they were local files on your Mac.
- Native Finder Integration: Mounts a virtual drive named "NodeDrive" directly in the Finder sidebar.
- The Perfect Companion: Designed specifically to consume the API endpoints (folder enumeration, file fetching, uploading, moving, and deleting) exposed by your NodeDrive Express backend.
- On-Demand Fetching: Uses Apple's
NSFileProviderReplicatedExtensionto only download file contents when you actually open them, saving local disk space. - Menu Bar App: A lightweight, unobtrusive menu bar accessory app for quick configuration of your server URL and authentication tokens.
- Secure Authentication: Connects to your backend securely using a JSON Web Token (JWT) generated by your NodeDrive server.
The project consists of two main components:
- NodeDriveFS (Host App): A SwiftUI-based macOS app that runs in the menu bar. It manages the user interface for configuration (Server URL and JWT) and uses
NSFileProviderManagerto register or remove the File Provider domain. - NodeDrive (Extension): An App Extension running in the background. It conforms to
NSFileProviderReplicatedExtensionand communicates directly with your NodeDrive backend to synchronize file metadata and contents.
Both components share data securely using Apple's App Groups (e.g., group.com.bryce.NodeDriveFS).
- macOS 11.0 or later.
- Xcode 14 or later.
- A running instance of the NodeDrive backend server.
Because File Provider Extensions run in a separate process from the main app, they share configuration data via App Groups. You must change the default App Group to one registered to your Apple Developer account:
- Open
NodeDriveFS.xcodeprojin Xcode. - In the Project Navigator, select the NodeDriveFS target, go to Signing & Capabilities, and update the App Groups section to your unique identifier (e.g.,
group.com.yourname.NodeDriveFS). - Repeat step 2 for the NodeDrive extension target.
- Open
NodeDriveFS/Config.swiftand update theappGroupIdentifiervariable to match your new App Group ID. - Ensure the Entitlements files (
NodeDrive.entitlementsandNodeDriveFS.entitlements) reflect this new App Group string.
- Select the NodeDriveFS scheme in Xcode.
- Build and run the project (
Cmd + R). - The app will launch as an accessory and place a network drive icon in your macOS Menu Bar.
Once the macOS app is running, you need to pair it with your NodeDrive backend.
- Click the NodeDrive icon in your macOS Menu Bar and select Show Settings.
- In the Server field, enter the base URL where your NodeDrive instance is hosted (e.g.,
http://127.0.0.1:3000or your production domain). - To get your JWT, you can click the "Get JWT" link in the macOS app (which redirects to
<your-server-url>/jwt), or generate it from your NodeDrive backend using the provided authentication setup scripts. - Paste the JWT into the app and click Save Configuration.
- Open a new Finder window. You will now see NodeDrive listed in the sidebar under "Locations". Click on it to start browsing your remote file system natively!
If you need to unmount the drive or connect to a different NodeDrive server, open the NodeDrive Settings from the menu bar and click Clear Local Data. This will safely terminate the extension, wipe the local cache, and remove the virtual drive from Finder.
I do not know Swift very well and this was largely vibe coded. If anyone wants to make improvements, please do.