Thank you for your interest in contributing to Peep! This document provides guidelines and information for contributors.
-
Fork and Clone
git clone https://github.com/YOUR_USERNAME/peep.git cd peep -
Install Dependencies
npm install
-
Build the Project
npm run build
- Native Module:
npm run build:native- Builds the Rust native module - TypeScript:
npm run build:ts- Compiles the Electron main process, preload script, and shared modules - Renderer:
npm run build:renderer- Builds the React frontend with webpack - Everything:
npm run build- Builds all components
npm startFor development with hot reload on the renderer:
# Terminal 1
npm run dev:renderer
# Terminal 2
npm run build:ts && electron .- Use TypeScript for all new code
- Follow the existing code style
- Use meaningful variable and function names
- Add comments for complex logic
- Follow Rust naming conventions
- Use
cargo fmtbefore committing - Add documentation comments for public functions
- Use functional components with hooks
- Keep components focused and reusable
- Extract complex logic into custom hooks
To add a new system metric:
-
Native Module (
native/src/lib.rs):- Add a function to collect the metric
- Export it in the
mainfunction
-
Main Process (
src/main/main.ts):- Add an IPC handler for the metric
- Call the native function
-
Preload Script (
src/main/preload.ts):- Expose the IPC method to the renderer
-
React Component:
- Create a new component in
src/renderer/components/ - Add it to the dashboard in
App.tsx
- Create a new component in
- In
native/src/lib.rs:
fn get_temperature_info(mut cx: FunctionContext) -> JsResult<JsObject> {
// Implementation
}
// In main:
cx.export_function("getTemperatureInfo", get_temperature_info)?;- In
src/main/main.ts:
ipcMain.handle('get-temperature', async () => {
return native.getTemperatureInfo();
});- In
src/main/preload.ts:
getTemperature: () => ipcRenderer.invoke('get-temperature')- Create
src/renderer/components/TemperatureMonitor.tsx
Currently, the project uses manual testing. When running:
npm startVerify:
- CPU usage is displayed and updates
- Memory usage is accurate
- Process list loads
- Process killing works (be careful!)
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Build and test:
npm run build && npm start - Commit with a clear message
- Push and create a pull request
- Describe your changes in detail
The primary development platform. All features should work here.
When adding Linux support:
- Test on Ubuntu, Fedora, and Arch
- Handle different desktop environments
- Update build scripts for
.deb,.rpm,.AppImage
When adding Windows support:
- Test on Windows 10 and 11
- Handle administrator permissions for process killing
- Update build scripts for
.exeinstaller
- The native module should use minimal CPU (< 2%)
- Memory usage should stay under 150MB
- UI updates should not block the main thread
- Use debouncing for frequent updates
- Never expose unsafe operations without user confirmation
- Validate all IPC inputs
- Use context isolation in Electron
- Keep dependencies updated
Releases are automated via GitHub Actions. When a version tag is pushed, the CI/CD pipeline will:
- Build for both Intel (x64) and Apple Silicon (arm64) Macs
- Create
.dmgand.zipartifacts for each architecture - Publish a GitHub Release with all artifacts
-
Update the version in
package.json:npm version <major|minor|patch> # Example: npm version 1.1.0
-
Push the tag to GitHub:
git push origin v1.1.0
-
The GitHub Actions workflow will automatically:
- Build the application for all supported platforms
- Create a draft release with generated release notes
- Attach all build artifacts
Follow Semantic Versioning:
- MAJOR: Breaking changes or major new features
- MINOR: New features, backwards compatible
- PATCH: Bug fixes, backwards compatible
For beta or alpha releases, use pre-release tags:
npm version 1.1.0-beta.1
git push origin v1.1.0-beta.1These will be marked as pre-releases on GitHub.
- Open an issue for bugs
- Start a discussion for feature ideas
- Ask questions in pull requests
Be respectful and constructive. We're all here to build something great together.
By contributing, you agree that your contributions will be licensed under the MIT License.