Thank you for your interest in contributing to Scarso Scacco! This document provides guidelines and information for developers who want to contribute to the project.
- Node.js v16 or higher
- npm (comes with Node.js)
- Git
- Code editor (VS Code recommended)
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/sensorario/scarsoscacco.git cd scarsoscacco -
Install dependencies:
npm install
-
Start development:
# Terminal 1: Start Vite dev server npm run dev # Terminal 2: Start Electron npm run electron
scarsoscacco/
├── electron/
│ ├── main.cjs # Main Electron process
│ └── preload.js # IPC bridge
├── src/
│ ├── App.jsx # Main React component
│ ├── App.css # Component styles
│ ├── index.css # Global styles
│ └── main.jsx # React entry point
├── public/ # Static assets
└── package.json # Dependencies and scripts
- Main Process (
electron/main.cjs): Handles Stockfish, Chess.js, IPC - Preload Script (
electron/preload.js): Secure IPC bridge - React App (
src/App.jsx): UI, chessboard, move history - Styling: LinkedIn-inspired theme with Inter font
- Use ES6+ syntax
- Functional components with hooks
- Descriptive variable names
- Comments for complex logic
// ✅ Good
const handleStockfishMove = async () => {
try {
const bestMove = await window.api.stockfish.getBestMove(fen);
// Process move...
} catch (error) {
console.error("Stockfish error:", error);
}
};
// ❌ Bad
const handleMove = async () => {
const move = await window.api.stockfish.getBestMove(fen);
// No error handling
};- Use inline styles for component-specific styling
- Follow LinkedIn color scheme:
#0077B5primary - Use Inter font for consistency
- Responsive design principles
-
Basic functionality:
- Make moves on the chessboard
- Verify Stockfish responds
- Test reset functionality
- Check move history
-
UI/UX:
- Auto-scroll in move history
- Button hover effects
- Responsive layout
-
Cross-platform:
npm run dist:mac npm run dist:win npm run dist:linux
npm run electronThis opens developer tools for debugging.
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Check existing issues to avoid duplication
-
Discuss major changes in issues first
-
Make your changes
-
Test thoroughly:
npm run build npm run electron
-
Check for errors:
- Console errors
- Build warnings
- UI glitches
-
Update version (if needed):
{ "version": "1.1.0" }
- UI Changes: Modify
src/App.jsx - Chess Logic: Update
electron/main.cjs - IPC Communication: Add to
electron/preload.js
// Follow existing pattern
style={{
backgroundColor: "#0077B5",
color: "white",
padding: "12px 24px",
borderRadius: "6px",
fontFamily: "inherit",
}}The version in package.json automatically updates:
- App header display
- Build file names
- Installer names
-
Test your changes:
npm run build npm run dist
-
Check the build works on target platforms
-
Update documentation if needed
-
Write clear commit messages:
git commit -m "feat: add auto-save functionality" git commit -m "fix: resolve Stockfish timeout issue" git commit -m "docs: update installation instructions"
- Clear title and description
- Reference related issues
- Include screenshots for UI changes
- List breaking changes (if any)
- Test instructions for reviewers
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Manual testing completed
- [ ] Build successful
- [ ] No console errors
## Screenshots (if applicable)
[Add screenshots here]Include:
- OS and version
- Node.js version
- Steps to reproduce
- Expected vs actual behavior
- Console errors/logs
- Screenshots
Include:
- Use case description
- Proposed solution
- Alternative solutions
- Additional context
- Small, focused PRs are easier to review
- Respond to feedback promptly
- Be open to suggestions
- Be constructive and helpful
- Focus on code quality and maintainability
- Test the changes locally
- Check for edge cases
- Start small: Look for issues labeled "good first issue"
- Ask questions: Don't hesitate to ask in issues/discussions
- Read existing code: Understand the patterns before making changes
- Test thoroughly: Both development and production builds
- Document your changes: Update README/docs when needed
Contributors will be recognized in:
- Project README
- Release notes
- Contributors page (when available)
- Issues: For bugs and feature requests
- Discussions: For questions and general discussion
- Email: [maintainer-email] for private concerns
Happy coding! ♟️
Together, let's make Scarso Scacco the best chess app it can be! 🎯