Thank you for your interest in contributing to GrindMap! We welcome contributions from everyone.
Please be respectful and constructive in all interactions with other contributors.
- Check if the bug has already been reported in Issues
- If not, create a new issue with:
- Clear title and description
- Steps to reproduce the bug
- Expected vs actual behavior
- Screenshots (if applicable)
- Your environment (OS, browser, Node.js version, etc.)
- Check existing feature requests in Issues
- Create a new issue describing:
- The problem you're trying to solve
- Your proposed solution
- Alternative approaches you've considered
- Example usage (if applicable)
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/GrindMap.git - Create a feature branch:
git checkout -b feature/YourFeatureName - Make your changes - be clear and focused
- Test your changes thoroughly
- Commit with a clear message:
git commit -m 'Add descriptive commit message' - Push to your branch:
git push origin feature/YourFeatureName - Open a Pull Request against the
masterbranch
- Node.js (v14 or higher)
- npm or yarn
- Git
git clone https://github.com/Yugenjr/GrindMap.git
cd GrindMap
npm install# Start development server
npm start
# Run tests
npm test
# Build for production
npm run buildPlease use clear and descriptive commit messages:
feat: Add new featurefix: Fix a bugdocs: Update documentationstyle: Format coderefactor: Refactor code without changing functionalitytest: Add or update tests
- Update the README.md if adding/changing features
- Add tests for new functionality
- Ensure all tests pass:
npm test - Follow the code style of the project
- Request reviews from maintainers
- Respond to feedback and make requested changes
- Use consistent indentation (2 spaces)
- Use meaningful variable and function names
- Add comments for complex logic
- Follow ES6+ standards
- Keep functions small and focused
To ensure high-quality contributions and maintain code reliability, follow these guidelines for testing and code quality checks.
- Backend Tests: Navigate to the
backenddirectory and runnpm test. This executes Jest tests configured inbackend/jest.config.json, which includes unit and integration tests for Node.js components. - Frontend Tests: Navigate to the
frontenddirectory and runnpm test. This runs Jest tests for React components and utilities. - Ensure all tests pass before submitting a pull request. Use
npm run test:watchfor continuous testing during development.
- Use Jest as the primary testing framework for both backend and frontend.
- Unit Tests: Test individual functions, modules, or components in isolation. Place test files alongside source files or in
__tests__directories, following patterns like**/__tests__/**/*.jsor**/?(*.)+(spec|test).jsas defined inbackend/jest.config.json. - Integration Tests: Test interactions between components, such as API endpoints or scraper services.
- Backend-Specific Testing:
- For scraping services in
backend/src/services/scraping/, use Jest mocks to simulate external dependencies (e.g., network requests or browser interactions) to ensure reliability and avoid real API calls during testing. - Example: Mock Puppeteer or HTTP requests in scraper tests to test error handling, data parsing, and security without hitting live endpoints.
- Test API security by mocking authentication and verifying input validation.
- For scraping services in
- Reference
backend/jest.config.jsonfor configuration details, including coverage collection fromsrc/**/*.js(excludingserver.js) and output formats (text, lcov, html).
- Use ESLint to enforce code style and catch potential issues.
- Running Linter: Run
npx eslint .in the respective directory (backend or frontend) to check for linting errors. - Fixing Issues: Use
npx eslint . --fixto automatically resolve fixable problems. - Reference
backend/.eslintrc.jsonfor backend ESLint configuration, which extendseslint:recommendedand includes rules for unused variables, equality checks, console usage, const preference, camelcase, consistent returns, magic numbers, line length, duplicate imports, and template literals. - Ensure code passes linting checks before committing.
- Test Coverage: Pull requests must include test coverage reports generated by Jest (e.g., via
npm test -- --coverage). Aim for adequate coverage, especially for new features and critical paths. - Security Audits: Run
backend/security-audit.shto perform comprehensive security checks, including npm audit, outdated package detection, and license compliance. Address any critical or high-severity vulnerabilities before merging. - Reviewers will check for adherence to these practices during pull request reviews.
- 🐛 Bug Fixes: Help fix existing issues
- ✨ New Features: Implement requested features
- 📚 Documentation: Improve README and guides
- 🎨 UI/UX: Enhance user interface
- 🧪 Testing: Write unit and integration tests
- 🌐 Localization: Translate to other languages
For help with common debugging issues, setup problems, and troubleshooting tips, please refer to our Contributor Debugging Playground. This guide covers:
- Environment setup troubleshooting
- Frontend and backend debugging techniques
- Scraper debugging tips
- Database issue resolution
- Development tools and best practices
- Check Discussions for common questions
- Open an Issue if you're stuck
- Reach out to the maintainers
- Refer to Contributor Debugging Playground for debugging help
Contributors will be recognized in:
- The project's README
- Release notes
- GitHub contributors page
Thank you for contributing to GrindMap! 🎉