A secure desktop application for collaborative construction of IBM Confidential Computing contracts with role-based access control, cryptographic signing, and attestation capabilities.
The IBM Confidential Computing Contract UI is an Electron-based desktop application that enables multiple personas (Solution Providers, Data Owners, Environment Operators, Auditors) to collaboratively build, sign, and verify confidential computing contracts. The application provides a secure environment for managing cryptographic keys, signing contract sections, and maintaining audit trails.
- Role-Based Access Control: Support for multiple personas including Admin, Solution Provider, Data Owner, Auditor, Environment Operator, and Viewer
- Collaborative Contract Building: Multi-user workflow for constructing contracts with section-based assignments
- Cryptographic Operations: RSA-4096 key pair generation, AES-256 encryption, and digital signatures
- Attestation Evidence: Support for attestation key management and evidence verification
- Audit Trail: Comprehensive logging of all contract operations and user actions
- Export & Verification: Contract export with signature verification capabilities
- Key Management: Secure storage and rotation of cryptographic keys
- Digital Signatures: Sign contract sections with RSA-4096 private keys
- Encryption: AES-256 encryption for sensitive data
- Password Management: Secure credential storage with strength validation
- API Token Management: Secure handling of authentication tokens
- IBM Carbon Design System: Modern, accessible UI built with Carbon React components
- Dark/Light Theme: Theme switching support
- Keyboard Shortcuts: Comprehensive keyboard navigation
- Command Palette: Quick access to application features
- Responsive Design: Optimized for desktop environments
- React 19.2.4: UI framework
- IBM Carbon React 1.104.1: Design system and components
- IBM Carbon Charts 1.27.3: Data visualization
- React Router DOM 7.1.3: Client-side routing
- Zustand 5.0.2: State management
- Sass 1.99.0: Styling
- Electron 41.1.1: Cross-platform desktop application framework
- Vite 8.0.3: Build tool and development server
- electron-builder 26.8.1: Application packaging and distribution
- Vite Plugin React 6.0.1: React integration for Vite
- Node.js: >= 25.9.0
- npm: >= 11.12.1
- Operating System: Linux, Windows, or macOS
git clone <repository-url>
cd persona-based-contract-generator-appnpm installRun the Vite development server and Electron in development mode:
npm run devThis command:
- Starts Vite dev server on
http://localhost:5173 - Waits for the server to be ready
- Launches Electron in development mode
To run only the Vite development server:
npm startCompile the React application for production:
npm run buildThis creates optimized production files in the dist/ directory.
Note: The packaging commands automatically run npm run build first, so you don't need to build manually before packaging.
npm run packageThis command will:
- Clean previous builds
- Build web assets with Vite
- Package the Electron application
macOS
npm run package:macAutomatically builds web assets, then generates:
- DMG installer (x64 and arm64)
- ZIP archive (x64 and arm64)
Windows
npm run package:winAutomatically builds web assets, then generates:
- NSIS installer (x64 and ia32)
- Portable executable (x64)
Linux
npm run package:linuxAutomatically builds web assets, then generates:
- AppImage (x64) - Universal Linux package
- DEB package (x64) - Debian/Ubuntu
- RPM package (x64) - Red Hat/Fedora/CentOS
Installing Linux Packages:
# AppImage (recommended - no installation needed)
chmod +x dist-electron/IBM-CC-Contract-UI-*.AppImage
./dist-electron/IBM-CC-Contract-UI-*.AppImage
# DEB package
sudo dpkg -i dist-electron/IBM-CC-Contract-UI-*.deb
# RPM package
sudo rpm -i dist-electron/IBM-CC-Contract-UI-*.rpmBuilt applications are output to the dist-electron/ directory.
persona-based-contract-generator-app/
├── main/ # Electron main process
│ ├── index.js # Main process entry point
│ ├── preload.js # Preload script for IPC
│ └── crypto/ # Cryptographic operations
│ ├── contractCli.js # Contract CLI integration
│ ├── encryptor.js # Encryption utilities
│ ├── keyManager.js # Key generation and management
│ ├── keyStorage.js # Secure key storage
│ └── signer.js # Digital signature operations
├── src/ # React application source
│ ├── App.jsx # Main application component
│ ├── main.jsx # React entry point
│ ├── index.scss # Global styles
│ ├── components/ # Reusable UI components
│ │ ├── AppShell.jsx # Application layout
│ │ ├── DesktopTitleBar.jsx # Custom title bar
│ │ ├── CommandPalette.jsx # Command palette
│ │ ├── ToastManager.jsx # Notification system
│ │ ├── ErrorBoundary.jsx # Error handling
│ │ └── ... # Additional components
│ ├── views/ # Application views/pages
│ │ ├── Home.jsx # Dashboard
│ │ ├── Login.jsx # Authentication
│ │ ├── BuildManagement.jsx # Contract builds
│ │ ├── BuildDetails.jsx # Build details
│ │ ├── UserManagement.jsx # User administration
│ │ ├── AdminAnalytics.jsx # Analytics dashboard
│ │ ├── SystemLogs.jsx # Audit logs
│ │ └── AccountSettings.jsx # User settings
│ ├── services/ # Business logic and API
│ │ ├── apiClient.js # HTTP client
│ │ ├── authService.js # Authentication
│ │ ├── buildService.js # Build management
│ │ ├── cryptoService.js # Crypto operations bridge
│ │ ├── assignmentService.js # Assignment management
│ │ ├── sectionService.js # Section management
│ │ ├── verificationService.js # Signature verification
│ │ └── ... # Additional services
│ ├── store/ # Zustand state management
│ │ ├── authStore.js # Authentication state
│ │ ├── buildStore.js # Build state
│ │ ├── userStore.js # User state
│ │ ├── themeStore.js # Theme state
│ │ ├── uiStore.js # UI state
│ │ └── mockData.js # Mock data for development
│ ├── hooks/ # Custom React hooks
│ │ ├── useFormValidation.js # Form validation
│ │ └── useKeyboardShortcuts.js # Keyboard shortcuts
│ ├── utils/ # Utility functions
│ │ ├── constants.js # Application constants
│ │ ├── formatters.js # Data formatters
│ │ ├── roles.js # Role utilities
│ │ ├── validation.js # Validation helpers
│ │ └── validators.js # Validator functions
│ └── styles/ # Style files
│ └── modern-theme.scss # Theme definitions
├── dist/ # Built web assets (generated)
├── dist-electron/ # Packaged applications (generated)
├── electron-builder.json # Electron builder configuration
├── vite.config.js # Vite configuration
├── package.json # Project dependencies
└── README.md # This file
Configuration is defined in electron-builder.json:
- Application ID:
com.ibm.ccrt.contract-builder - Product Name: IBM CC Contract Builder
- Output directory:
dist-electron/ - Compression: Maximum
- ASAR packaging: Enabled
Configuration is defined in vite.config.js:
- Base path:
./(for Electron compatibility) - React plugin enabled
- Full system access
- User management
- System configuration
- Analytics and reporting
- Create and manage builds
- Define contract sections
- Assign tasks to other roles
- View build statistics
- Contribute data-related sections
- Sign assigned sections
- View assigned builds
- Configure environment sections
- Manage deployment parameters
- Sign environment configurations
- View all contracts and audit trails
- Verify signatures
- Generate compliance reports
- Read-only access to builds
- Read-only access
- View public contracts
- No modification permissions
- All cryptographic operations are performed in the Electron main process
- Private keys are never exposed to the renderer process
- RSA-4096 for asymmetric operations
- AES-256 for symmetric encryption
- Keys are stored securely using OS-level key storage mechanisms
- Support for key rotation and credential management
- Password-protected key export
- Context isolation enabled
- Preload script for secure IPC communication
- Validation of all IPC messages
- Use ES6+ features
- Follow React best practices
- Use functional components with hooks
- Implement proper error boundaries
- Use Zustand for global state
- Keep state minimal and normalized
- Use derived state where possible
- Keep components focused and single-purpose
- Use Carbon components for consistency
- Implement proper accessibility features
The application is configured for optimal build performance:
Compression Settings:
- Uses
normalcompression instead ofmaximumfor faster builds - ASAR packaging enabled for better startup performance
- Parallel builds supported
Vite Optimizations:
- Code splitting with manual chunks for vendor libraries
- ESBuild minification for faster builds
- Pre-bundled dependencies for faster dev server startup
- Sourcemaps disabled in production builds
Tips for Faster Builds:
# Use platform-specific builds instead of building all platforms
npm run package:linux # Only Linux
npm run package:win # Only Windows
npm run package:mac # Only macOS
# For development, use the dev server (much faster)
npm run devTo improve application startup time:
-
First Launch: Initial startup may be slower due to:
- OS security checks (especially on macOS)
- First-time cache generation
- Dependency initialization
-
Subsequent Launches: Should be significantly faster due to:
- Cached resources
- Pre-compiled code
- OS trust establishment
-
Optimization Tips:
- Close unnecessary background applications
- Ensure sufficient RAM (8GB recommended)
- Use SSD storage for better I/O performance
- Keep the application updated
If the development server fails to start:
- Check if port 5173 is already in use
- Clear node_modules and reinstall dependencies
- Verify Node.js and npm versions meet requirements
If packaging fails:
- Ensure all dependencies are installed
- Run
npm run buildfirst to verify web assets compile - Check electron-builder logs in
dist-electron/
If Electron fails to launch:
- Clear Electron cache:
rm -rf ~/.cache/electron - Reinstall Electron:
npm install electron --force - Check console for IPC errors
The project includes GitHub Actions workflows for automated testing and building:
Runs on every push and pull request:
- Installs dependencies
- Runs linting checks
- Executes test suite
- Validates build process
Triggered on version tags (v*):
- Builds for Linux, Windows, and macOS
- Creates platform-specific binaries
- Uploads artifacts to GitHub Releases
- Generates release notes with checksums
Creating a Release:
- Update version in
package.json:
npm version patch # for 1.0.0 -> 1.0.1
# or
npm version minor # for 1.0.0 -> 1.1.0
# or
npm version major # for 1.0.0 -> 2.0.0- Push the tag to GitHub:
git push origin main --tags- GitHub Actions will automatically:
- Build binaries for all platforms
- Generate SHA256 checksums
- Create a GitHub Release
- Upload all artifacts
Manual Release Trigger: You can also manually trigger the release workflow from the GitHub Actions tab.
See .github/workflows/ for workflow configurations.
Apache-2.0
Contributions are welcome. Please ensure:
- Code follows project style guidelines
- All tests pass
- Documentation is updated
- Commit messages are descriptive
For issues and questions:
- Open an issue on GitHub
- Review existing documentation
- Check troubleshooting section
Built with:
- IBM Carbon Design System
- Electron Framework
- React and Vite
- Open source community contributions