Why Contribute?
Discount Calculator is an open source project that benefits thousands of users. By contributing, you:- Help improve a tool that people use daily for shopping and business decisions
- Gain experience working on a real-world project
- Collaborate with other developers in the open source community
- Build your portfolio with meaningful contributions
Getting Started
Fork the Repository
Visit the Discount Calculator repository on GitHub and click the “Fork” button in the top-right corner. This creates your own copy of the project where you can make changes.
Clone Your Fork
Clone your forked repository to your local machine:Replace
YOUR-USERNAME with your GitHub username.Create a Branch
Create a new branch for your contribution:Use descriptive branch names like
feature/add-tax-calculation or fix/rounding-error.Make Your Changes
Make your code changes, following our coding standards and best practices. Test your changes thoroughly to ensure they work as expected and don’t break existing functionality.
Commit Your Changes
Commit your changes with a clear, descriptive message:Write commit messages that clearly explain what changed and why.
Create a Pull Request
Go to the original Discount Calculator repository on GitHub. You’ll see a prompt to create a pull request from your recently pushed branch. Click “Compare & pull request” and provide:
- A clear title describing your changes
- A detailed description of what you changed and why
- Any relevant issue numbers (e.g., “Fixes #123”)
- Screenshots if your changes affect the UI
What Can You Contribute?
Code Contributions
New Features
Add functionality like tax calculations, currency conversion, bulk discount calculations, or saving calculation history. Check the issues page for feature requests.
Bug Fixes
Fix calculation errors, UI glitches, or browser compatibility issues. Look for issues labeled “bug” in the repository.
Performance Improvements
Optimize calculations, reduce bundle size, or improve loading times. Every millisecond matters for user experience.
Accessibility
Improve keyboard navigation, screen reader support, or color contrast. Making the tool accessible to everyone is a priority.
Non-Code Contributions
Documentation
Improve README files, add code comments, create tutorials, or expand this documentation. Clear docs help everyone.
Design
Propose UI improvements, create mockups, or enhance the visual design. Good design makes the tool more enjoyable to use.
Testing
Test the application on different devices and browsers, report bugs, or suggest usability improvements.
Translations
Help translate the interface into other languages, making the tool accessible to non-English speakers worldwide.
Coding Standards
Follow these guidelines when writing code:Code Style
Code Style
- Use consistent indentation
- Write clear, descriptive variable and function names
- Follow the existing code style in the project
- Keep functions small and focused on a single task
Comments
Comments
- Write comments for complex logic or calculations
- Explain why, not what (the code shows what)
- Keep comments up-to-date when code changes
- Use JSDoc format for function documentation
Testing
Testing
- Test your changes thoroughly before submitting
- Test edge cases and error conditions
- Verify your changes work across different browsers
Commits
Commits
- Make small, focused commits
- Write clear commit messages in present tense
- Reference issue numbers when applicable
- Don’t commit unrelated changes together
Pull Request Guidelines
When submitting a pull request:Keep changes focused on a single issue or feature
Include a clear description of what changed and why
Add screenshots for UI changes
Test your changes thoroughly
Update documentation if needed
Respond to reviewer feedback promptly
Code Review Process
After you submit a pull request:- Maintainer Review: A project maintainer will review your code within a few days
- Feedback: You may receive suggestions for improvements or changes
- Iteration: Make requested changes and push them to your branch
- Approval: Once approved, a maintainer will merge your contribution
Getting Help
GitHub Issues
Ask questions or report problems in the GitHub Issues section.
Discussions
Join conversations about features and improvements in GitHub Discussions.