Thank you for your interest in contributing to Compose Booster! This document provides guidelines and instructions for developers who want to contribute to or work with the codebase.
- Development Setup
- Project Structure
- Development Workflow
- Testing
- Building
- Code Style
- Submitting Changes
- Node.js 16+ (Download)
- npm or yarn
- OpenRouter API key (Get one here)
- Git
-
Clone the repository
git clone https://github.com/lestephen/compose-booster.git cd compose-booster -
Install dependencies
npm install
-
Start in development mode
npm start
-
Configure your API key
- Open the app
- Go to File → Settings (or press Ctrl/Cmd + ,)
- Enter your OpenRouter API key
- Click "Test Key" to verify
- Click "Save Settings"
Test the application without consuming API credits:
Windows (PowerShell):
$env:MOCK_API="true"
npm startWindows (CMD):
set MOCK_API=true
npm startmacOS/Linux:
MOCK_API=true npm startcompose-booster/
├── src/
│ ├── main/ # Electron main process
│ │ ├── windows/ # Window managers
│ │ ├── services/ # Core services (API, Config, Menu)
│ │ ├── ipc/ # IPC handlers and channels
│ │ └── config/ # Default configuration
│ │
│ ├── preload/ # Preload scripts (security bridge)
│ │ ├── preload.ts # Main window preload
│ │ └── settingsPreload.ts
│ │
│ ├── renderer/ # Renderer processes (UI)
│ │ ├── main/ # Main application window
│ │ │ ├── components/
│ │ │ ├── index.html
│ │ │ ├── renderer.ts
│ │ │ └── styles.css
│ │ └── settings/ # Settings window
│ │ ├── components/
│ │ └── tabs/
│ │
│ └── shared/ # Shared types and constants
│
├── tests/ # Test files
├── scripts/ # Build and utility scripts
├── assets/ # Application icons and resources
├── forge.config.ts # Electron Forge configuration
├── vite.*.config.ts # Vite build configs
└── package.json
- Electron 39.2.6 - Cross-platform desktop framework
- TypeScript 4.5.4 - Type-safe development
- Vite 5.4.21 - Fast build tool and dev server
- Electron Forge - Build and packaging
- electron-store - Encrypted configuration storage
- Axios - HTTP client for API calls
npm start # Start in development mode
npm test # Run tests
npm run test:ui # Run tests with UI
npm run package # Package the application
npm run make # Create distributable
npm run icons # Regenerate application icons
npm run lint # Run ESLint- Renderer changes (HTML, CSS, TS in
renderer/) → Auto-reload ✅ - Main process changes (TS in
main/) → Requires manual restart⚠️
For detailed architecture and patterns, see CLAUDE.md.
Quick guide:
- Update types in
src/shared/types.ts - Add IPC channels in
src/main/ipc/channels.ts - Implement handler in
src/main/ipc/handlers.ts - Expose via preload in
src/preload/preload.ts - Use in renderer components
# Run all tests
npm test
# Run tests with UI
npm run test:ui
# Run tests once (CI mode)
npm run test:run
# Run with coverage
npm run test:coverage- Unit tests:
tests/directory - Integration tests: Test IPC communication and service integration
- Mock mode: Use
MOCK_API=truefor testing without API costs
- Use Vitest for testing
- Mock Electron APIs when necessary
- Test core services (apiService, configService)
- Validate type definitions
npm run packageCreates a package in the out/ directory.
Windows:
npm run makeCreates installer in out/make/squirrel.windows/x64/
macOS:
npm run make -- --platform=darwinNote: macOS builds require Apple Developer account for signing.
To regenerate application icons from SVG source:
npm run iconsIcons are generated from assets/icons/icon.svg:
- PNG files:
assets/icons/png/(multiple sizes) - Windows .ico:
assets/icons/win/icon.ico
- Strict typing - Avoid
any - Interfaces over types for objects
- Readonly for immutable properties
- Error handling - Always use try/catch
- Files: camelCase (e.g.,
apiService.ts) - Classes: PascalCase (e.g.,
ApiService) - Functions/Variables: camelCase (e.g.,
getConfig) - Constants: UPPER_SNAKE_CASE (e.g.,
IPC_CHANNELS) - Interfaces: PascalCase (e.g.,
AppConfig)
- Semantic HTML5 elements
- CSS classes: kebab-case (e.g.,
.quick-action-btn) - CSS variables for theming (defined in
:root) - Mobile-first responsive design (even for desktop)
All source files must include the MPL 2.0 license header. See LEGAL_HEADER.txt for templates.
Add headers automatically:
python scripts/add_license_headers.py-
Test thoroughly
- Run all tests:
npm test - Test in both development and built modes
- Test on both Windows and macOS if possible
- Run all tests:
-
Check code style
- Run linter:
npm run lint - Follow naming conventions
- Add license headers to new files
- Run linter:
-
Update documentation
- Update README.md if user-facing changes
- Update CLAUDE.md if architecture changes
- Add comments for complex logic
-
Fork the repository
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Follow code style guidelines
- Add tests for new features
- Update documentation
-
Commit your changes
git commit -m "Add feature: your feature description Detailed explanation of changes..."
-
Push to your fork
git push origin feature/your-feature-name
-
Create a Pull Request
- Provide clear description of changes
- Reference any related issues
- Include screenshots for UI changes
When reporting bugs, include:
- Description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment (OS, Electron version, etc.)
- Screenshots if applicable
- Error messages from console
When requesting features:
- Use case - Why is this needed?
- Proposed solution - How should it work?
- Alternatives considered
- Architecture Guide: CLAUDE.md
- Implementation Roadmap: IMPLEMENTATION_PLAN.md
- Troubleshooting: TROUBLESHOOTING.md
- Testing Guide: TESTING.md
- Distribution Strategy: DISTRIBUTION_STRATEGY.md
- Electron Documentation: https://www.electronjs.org/docs
- TypeScript Handbook: https://www.typescriptlang.org/docs/
By contributing to Compose Booster, you agree that your contributions will be licensed under the Mozilla Public License 2.0 (MPL-2.0).
See LICENSE for details.
Thank you for contributing to Compose Booster! Your efforts help make this tool better for everyone.
If you have questions, feel free to:
- Open an issue on GitHub
- Check existing documentation
- Review the codebase
Happy coding! 🚀