The Electron-based desktop application for Specif AI facilitates local file system integration for all generated documents, providing a seamless user experience across platforms.
- 📂 Local File System Integration.
- 📄 Document Management.
- 🚀 Cross-Platform Support.
- Node.js >= 20.x
- npm >= 9.6.7
To install the necessary dependencies, run the following command:
npm install
-
Enable Development Features: In
app.js
, uncomment the following lines to enable hot-reloading and open developer tools for debugging:mainWindow.webContents.openDevTools(); require('electron-reload')(__dirname, { electron: path.join(__dirname, "node_modules", ".bin", "electron"), forceHardReset: true, hardResetMethod: 'exit' });
-
Build Angular UI Application:
- Navigate to the
ui/
directory and install all necessary npm packages using the command below:npm install
- Then, navigate back to the
electron
directory and build the Angular application to prepare it for integration with Electron. This will copy the build files to theelectron/ui
directory:npm run build:ui
- To automatically rebuild and reflect changes in the Electron application when making changes to
ui/
, run:npm run watch:ui
- Navigate to the
-
Start the Application: Once the Angular UI is compiled and the build files are copied to the Electron directory, launch the Electron application:
npm run serve:electron
Note: Ensure the Angular UI build (step 2) is completed before starting step 3.
-
Disable Development Features: Ensure that developer tools are disabled in production to prevent exposure of sensitive information. Comment out the development-specific lines in
app.js
:// mainWindow.webContents.openDevTools(); // require('electron-reload')(__dirname, { // electron: path.join(__dirname, "node_modules", ".bin", "electron"), // forceHardReset: true, // hardResetMethod: 'exit' // });
-
Configure Code Signing:
- Default: Enabled for macOS.
- Disable: Remove the following from
package.json
to disable:"appId": "<your app id>", "forceCodeSigning": true
- Certificate Configuration: Set up the certificate in
build-assets/build-mac.sh
. - Notarization: Update
package.json
for Mac application notarization:{ "notarize": { "teamId": "<team id>" } }
- Enforcement: Ensure code signing is enforced by verifying the configuration in
package.json
andbuild-assets/build-mac.sh
.
-
Build the Application: Execute the build script:
./build-assets/build-mac.sh
This script compiles the application into a distributable format, ready for deployment.
Please read our Contributing Guidelines for details on submitting patches and the contribution workflow.
-
Issue: Application fails to start.
- Solution: Ensure all dependencies are installed and the Angular UI is built before starting the Electron app.
-
Issue: Code signing errors occur.
- Solution: Verify the certificate configuration in
build-assets/build-mac.sh
andpackage.json
.
- Solution: Verify the certificate configuration in
-
Issue: If you encounter an issue such as "Port Error: Port 49153 is already in use by another application" while running Electron, follow these steps to resolve it:
-
Check for processes running on the port:
Use the following command to identify the process using the port:
lsof -ti:<port-number> #For MAC users sudo lsof -i :<port-number>
-
Kill the process:
Terminate the process using the command below, then re-run the Electron app:
kill -9 <process-id> #For MAC users sudo kill -9 <process-id>
-