An AI-powered Electron desktop application that generates and executes interactive web components using Claude (Anthropic's AI).
- π€ AI Code Generation - Generate complete UI components from natural language prompts
- π Secure Execution - Sandboxed code execution with resource limits
- β‘ Smart Caching - Similarity-based caching for faster responses
- π‘οΈ Enhanced Security - No eval(), CSP enforcement, input validation
- π Production Ready - Comprehensive logging, monitoring, and error recovery
- π¨ Real-time UI Generation - Build dashboards, forms, calculators instantly
- π Dark Mode - Toggle between light and dark themes
- π§ TypeScript Support - Full TypeScript definitions and compilation
- π§ͺ Testing Framework - Jest test suite with mocked Electron environment
- πΎ Encrypted Storage - Secure API key storage with Electron safeStorage
- β‘ Circuit Breaker - Fault tolerance with automatic failure recovery
- π Performance Monitoring - Real-time metrics collection and analysis
- π Request Interceptors - Advanced request/response handling
- π Auto Scheduler - Background cleanup and maintenance tasks
- ποΈ Dynamic Database - AI-powered SQLite database creation and management
- π Data Visualization - Built-in charts, graphs, and data analysis tools
- π Visual Query Builder - No-SQL-knowledge-required database queries
- π Database Analytics - Automatic statistics and insights generation
- Node.js 14.0.0 or higher
- npm or yarn
- Anthropic API key (get from Anthropic Console)
# Clone the repository
git clone <repository-url>
cd Self-Building-Desktop-App
# Install dependencies
npm install
# Start the application
npm start
# Run in development mode with DevTools
npm run dev
# Build for production
npm run build
# Rebuild native modules
npm run rebuild
# TypeScript compilation
npm run compile
# Watch TypeScript files
npm run watch
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Type checking
npm run type-check
The application can be configured via src/config/default.json
:
- Execution limits - Memory, timeout, concurrent executions
- Security settings - Package blocking, prompt validation
- AI parameters - Model, temperature, token limits
- Caching - TTL, similarity thresholds
-
Launch the application
npm start
-
Configure API Key
- Enter your Anthropic API key in the UI
- Or load from a text file
-
Generate Components
- Describe what you want to build in natural language
- Examples:
- "Create a todo list with add/remove functionality"
- "Build a calculator with modern UI"
- "Make an interactive dashboard with charts"
-
Execute Code
- Review the generated code
- Click Execute to run in sandboxed environment
- See results in real-time
-
Database Management
- Click the "ποΈ Database" button to access database features
- Use AI Schema Generator to create databases from natural language:
- "Create a blog system with users, posts, and comments"
- "Build an inventory system for a retail store"
- Manage data through the visual interface
- Create charts and visualizations from your data
-
Advanced Features
- Use the Visual Query Builder for complex database queries
- Export databases as JSON for backup or sharing
- Generate code that works with your database structure
- View automatic statistics and insights
src/
βββ main.js # Main Electron process
βββ preload.js # Secure IPC bridge
βββ renderer/ # UI components
β βββ index.html
β βββ renderer.js
β βββ styles.css
βββ utils/ # Core utilities
β βββ logger.js # Winston logging
β βββ securitySandbox.js # Code sandboxing
β βββ cacheManager.js # Smart caching
β βββ circuitBreaker.js # Fault tolerance
β βββ ipcValidator.js # Input validation
β βββ secureStorage.js # Encrypted storage
β βββ performanceMonitor.js # Metrics tracking
β βββ requestInterceptor.js # Request handling
β βββ scheduler.js # Background tasks
β βββ envConfig.js # Environment config
β βββ secureDOMExecutor.js # Safe DOM operations
βββ config/
βββ default.json # Default settings
- Sandboxed Execution - Code runs in isolated environments
- Resource Limits - CPU, memory, and timeout constraints
- Package Filtering - Blocks dangerous Node.js modules
- Input Validation - All user inputs sanitized
- CSP Enforcement - Content Security Policy in all contexts
- No eval() - Uses Function constructor with sanitized scope
The application uses the Anthropic Claude API for code generation:
- Model: Claude 3.5 Sonnet
- Configurable temperature and token limits
- Automatic retry with exponential backoff
- Smart prompt enhancement for better results
Built-in monitoring includes:
- System resource tracking (CPU, memory, disk)
- Execution statistics and success rates
- Session history and persistence
- Cache performance metrics
- Security event logging
- Check Node.js version:
node --version
(must be >= 14.0.0) - Rebuild native modules:
npm run rebuild
- Check logs in
logs/
directory
- Verify API key is valid
- Check internet connection
- Review error messages for specific issues
- Try simpler prompts
- Check browser console for DOM errors
- Review security sandbox logs
- Ensure code doesn't use blocked APIs
Please read CONTRIBUTING.md for contribution guidelines.
For security concerns, please see SECURITY.md.
MIT License - see LICENSE for details.
- Built with Electron
- Powered by Claude AI
- Logging by Winston
- System monitoring via systeminformation