Skip to main content
Thank you for your interest in contributing to Discount Calculator! This guide will help you get started with contributing to our open source project.

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

1

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.
2

Clone Your Fork

Clone your forked repository to your local machine:
git clone https://github.com/YOUR-USERNAME/discountcalculator.git
cd discountcalculator
Replace YOUR-USERNAME with your GitHub username.
3

Create a Branch

Create a new branch for your contribution:
git checkout -b feature/your-feature-name
Use descriptive branch names like feature/add-tax-calculation or fix/rounding-error.
4

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.
5

Commit Your Changes

Commit your changes with a clear, descriptive message:
git add .
git commit -m "Add feature: calculate tax on final price"
Write commit messages that clearly explain what changed and why.
6

Push to Your Fork

Push your branch to your GitHub fork:
git push origin feature/your-feature-name
7

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:
  • 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
  • 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
  • Test your changes thoroughly before submitting
  • Test edge cases and error conditions
  • Verify your changes work across different browsers
  • 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
Pull requests that don’t follow these guidelines may be closed until they meet the requirements. This helps maintain code quality and makes reviews easier.

Code Review Process

After you submit a pull request:
  1. Maintainer Review: A project maintainer will review your code within a few days
  2. Feedback: You may receive suggestions for improvements or changes
  3. Iteration: Make requested changes and push them to your branch
  4. Approval: Once approved, a maintainer will merge your contribution
Be patient and receptive to feedback. Code review is a collaborative process that improves code quality.

Getting Help

GitHub Issues

Ask questions or report problems in the GitHub Issues section.

Discussions

Join conversations about features and improvements in GitHub Discussions.

License

By contributing to Discount Calculator, you agree that your contributions will be licensed under the MIT License. This ensures the project remains free and open source.
Start with small contributions like fixing typos, improving documentation, or tackling “good first issue” labels. This helps you get familiar with the project before taking on larger features.
Thank you for contributing to Discount Calculator! Your efforts help make financial calculations accessible to everyone.

Build docs developers (and LLMs) love