The Polaris Electron App provides a user-friendly graphical interface to interact with the Polaris CLI. The app allows you to manage catalogs, principals, and roles directly from a graphical interface, while internally leveraging the Polaris CLI for command execution.
- Catalog Management: Create, list, and delete catalogs.
- Principal Management: List and manage principals.
- Role Management: Manage roles and assign them to principals.
- Configuration: Easily configure CLI path, host, port, client ID, and client secret through the UI.
Before running the Polaris Electron App, ensure you have the following installed:
- Node.js (v14 or later)
- npm (usually installed with Node.js)
- The Polaris CLI installed and accessible on your system
-
Clone the repository:
git clone https://github.com/yourusername/polaris-electron-app.git
-
Navigate to the app's directory:
cd polaris-electron-app
-
Install the required dependencies:
npm install
To start the app in development mode:
-
Ensure your Polaris CLI path and configuration is properly set.
-
Start the Electron app:
npm start
This will open the app in development mode and automatically launch the React development server.
To build the app for production:
npm run build
This will create a production-ready build in the build/
directory. You can then package the app using Electron Builder for various platforms:
npm run electron-pack
- Start the app:
npm start
- Build the app:
npm run build
- Package the app:
npm run electron-pack
You can configure the following parameters through the app interface:
- CLI Path: The path to your Polaris CLI binary.
- Host: The hostname of the Polaris server.
- Port: The port number for connecting to the Polaris server.
- Client ID: The client ID for token-based authentication.
- Client Secret: The client secret for token-based authentication.
You can also define these configurations via environment variables by adding a .env
file in the root of your project:
REACT_APP_POLARIS_CLI_PATH=/path/to/polaris/cli
REACT_APP_POLARIS_HOST=localhost
REACT_APP_POLARIS_PORT=8181
REACT_APP_POLARIS_CLIENT_ID=your-client-id
REACT_APP_POLARIS_CLIENT_SECRET=your-client-secret
- List Catalogs: Display a list of available catalogs from the Polaris CLI.
- Create Catalog: Add new catalogs by specifying their name, type, storage type, and base location.
- Delete Catalog: Remove existing catalogs from the system.
- List Principals: Display a list of all principals available in the system.
- Create Principals: Add new principals via the interface.
- List Roles: View all principal roles.
- Assign Roles: Assign roles to principals directly through the interface.
The app uses a preload script (preload.js
) to securely expose the runCommand
API to the renderer process (React). This API allows the React app to invoke CLI commands via Electron’s IPC (Inter-Process Communication).
The main process (electron.js
) listens for CLI command invocations from the renderer process, executes the commands using Node.js's child_process.exec()
, and returns the output back to the React UI.
The app interacts with the Polaris CLI, an open-source platform for managing data catalogs, principals, and roles. You must install the Polaris CLI on your system before using this Electron app.
To install the Polaris CLI, follow the installation instructions in the Polaris CLI GitHub repository.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.