Thank you for considering contributing to CodeBlocks! This document provides guidelines for contributing to the project.
Please be respectful and constructive in all interactions. We're building this project for learners of all ages and skill levels, so maintain a welcoming and inclusive environment.
When reporting bugs, please include:
- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Browser and OS information
- Screenshots or screen recordings if applicable
- Console errors (check browser DevTools)
Feature requests are welcome! Please:
- Check existing issues to avoid duplicates
- Explain the use case clearly
- Provide examples or mockups if possible
- Consider how it fits with the project's educational goals
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Follow existing code style
- Add tests if applicable
- Update documentation
- Test thoroughly in multiple browsers
- Commit your changes
git commit -m 'Add amazing feature' - Push to branch
git push origin feature/amazing-feature
- Open a Pull Request
- Describe your changes clearly
- Reference any related issues
- Include screenshots/GIFs for UI changes
- Node.js 17+
- npm or yarn
- Docker (optional, for containerized deployment)
- Modern browser (Chrome, Firefox, Safari, or Edge)
-
Clone the repository:
git clone https://github.com/[username]/codeblocks.git cd codeblocks -
Install dependencies:
npm install
-
Start development server:
npm start
The app will be available at http://localhost:5000 with hot reload enabled.
-
Build for production:
npm run build
For containerized development:
docker compose up -d
docker compose logs -f frontendAccess the app at http://localhost:9000
- Use modern JavaScript (ES6+)
- Follow existing patterns in the codebase
- Write clear, descriptive variable names
- Add comments for complex logic
- Keep functions focused and small
- Use meaningful commit messages
codeblocks/
├── app/
│ ├── components/ # React components
│ ├── utils/ # Utility functions and examples
│ ├── styles/ # LESS stylesheets
│ └── index.jsx # Application entry point
├── backend/
│ └── src/ # Backend server (OpenAI integration)
├── docs/ # Documentation
├── examples/ # Example models (JSON)
├── test-scripts/ # API test scripts
└── webpack configs # Build configuration
If modifying the scripting API (this is critical!):
-
Update the API implementation
- Edit
app/components/ScriptEditor.jsx - Maintain backwards compatibility when possible
- Add version guards for breaking changes
- Edit
-
Update documentation
- Update
docs/scripting-api.mdwith new functions/changes - Add code examples demonstrating usage
- Update migration guide if breaking changes
- Update
-
Add examples
- Add examples in
app/utils/examples-*.js - Cover beginner, intermediate, and advanced use cases
- Ensure examples run without errors
- Add examples in
-
Update AI assistant prompt
- Update system prompt in
backend/src/server.js - Ensure AI can help users with new features
- Update system prompt in
-
Add tests
- Create test scripts in
test-scripts/ - Verify functionality works as expected
- Create test scripts in
Before submitting a PR:
-
Manual testing
- Test your changes in the UI
- Try different browsers (Chrome, Firefox, Safari)
- Check mobile responsiveness if UI changes
- Test with different screen sizes
-
Example scripts
- Run example scripts to verify API compatibility
- Ensure beginner examples still work
- Check that your changes don't break existing scripts
-
Console checks
- Check browser console for errors
- Verify no warnings in production build
- Check for memory leaks (use browser DevTools)
-
Build verification
- Run
npm run buildsuccessfully - Test the production build locally
- Verify Docker build works if applicable
- Run
When adding features:
- Update relevant documentation files
- Add code examples to docs
- Update CHANGELOG.md
- Add to README.md if user-facing
- Include inline code comments
- Update API reference if applicable
- Fix typos in documentation
- Add more example scripts
- Improve error messages
- Add unit tests
- Enhance UI accessibility
- Additional brick shapes
- Undo/redo functionality
- Save/load projects
- Share links to creations
- Animation timeline editor
- Collaborative editing
- Open an issue for questions about the project
- Check existing documentation first
- Join discussions on GitHub
Contributors will be:
- Listed in project README
- Credited in release notes
- Appreciated and thanked!
Thank you for contributing to CodeBlocks! 🎉