Contributing to an open-source project can both be a valuable achievement and a fun experience for you. You can work on simple tasks, like fixing a button that isn't working in the UI, or broader tasks, like adding a whole new feature.
For example, you might know about VLC Media Player, right? But did you know it's an open-source project, also? All its code is available on GitHub, where you can contribute for free. Although it's not easy to jump straight into a pro-level project like this, being able to contribute to something so well-known is a great achievement, especially for a beginner.
Today, I'll show you how to start your open-source journey with some easy steps. Let's get started!
Prerequisite
-
You need to have a GitHub account.
-
Proper Git environment setup is a must.
-
You’ll need VS Code or any other code editor set up.
-
Optional: I recommend using GitHub Desktop for easier work.
Find a Repository to Contribute
How to find a good repository?
- First, you need to know a programming language or stack. For example, if you know JavaScript, you can search for JavaScript on GitHub and find related projects to work on.
- You can use these platforms to find projects you like:
After that, you can search for suitable projects and contribute to the one you think is right for you. Remember, it may take time to find a project you like at first, so be patient.
After selecting a project, take a good look at its README file or code, and learn about how the project works in detail.
How to know a repository is good to contribute?
Meets the definition of open source or not?
- Does the repository have a LICENSE? Usually, there is a file named LICENSE in the main folder of the repository.
Project actively accepts contributions or not?
Check the commit activity of the main branch. You can find detailed information in the Insights tab on the repository's homepage on GitHub.
- When was the last commit made?
- How many total contributors are there for the project?
- What is the commit rate like? (You can see this by clicking on "Commits" in the top bar on GitHub.)
Now, check the project's issues.
- How many total issues are there?
- Do the maintainers respond quickly when a new issue is opened?
- Is there active discussion about the issues?
- Are the issues recent?
- Are the issues being closed after a specific time? (To see closed issues on GitHub, click on the "closed" tab on the Issues page.)
Do the same for the project's pull requests.
- How many total pull requests are there?
- Do the maintainers respond quickly when a new pull request is opened?
- Is there active discussion about the pull requests?
- Are the pull requests recent?
- Are the pull requests being closed after a specific time? (To see closed pull requests on GitHub, click on the "closed" tab on the Pull Requests page.)
Project is welcoming or not?
You can tell if a project is friendly or welcoming by looking at how the project maintainers treat new contributors.
- Do the project maintainers respond helpfully to questions about issues?
- Do they behave friendly in issues, discussion forums, and chats (like IRC or Slack)?
- Are the pull requests reviewed?
- Do the project maintainers thank developers for their contributions?
Today, we have taken a project called Invoice-Generator as an example for beginners. I hope you'll choose even better projects in the future!
Finding the Perfect Issue
You can go to the issues tab to see what issues are there and try to solve them. As a beginner, try to fix an easy issue. You can also explore the entire project on your own to find a new issue and solve it.
For example, this project has a calculation issue where adding two or more items doesn’t give the correct total price. Only the price of one item is being added. So, we can work on fixing this issue.
Understand and Validate the Issue
First, don't jump straight into fixing the issue. Go step-by-step. Make sure you can resolve the issue and that it is valid.
Since this issue hasn't been created yet, we will create it first. To do this:
- Create a new issue.
- Provide the title and description with details (including a screenshot of where the issue is happening, if possible).
- Write a basic document explaining what I expect as a solution and then submit the issue.
The issue has been created. Now, I will ask for permission to be assigned to work on it. I need to go to the issue I created and add a comment.
If the maintainer assigns it to me, I can work on it, and no one else can work on it.
Now, I will wait until I get assigned (Professionally, I should wait).
Fork and Start Contributing
-
When I get assigned, I will start working. First, I will fork (copy) the main repo to my account since I don’t have access to the original repository. Then, I will start working on my copied repo.
-
Now, clone the project to own device using Git clone or GitHub Desktop.
git clone https://github.com/johnuberbacher/invoice-generator.git
-
Go to the folder :
cd invoice-generator
-
To contribute choose the parent project.
-
Open the project in VScode.
-
Now, check the repo's README and look for the contribution guidelines. Follow those guidelines to start working.
Fig: Project is running perfectly in localhost:3000
I have set up the project in my environment, now let’s start working.
You don’t need to understand the whole codebase to resolve an issue. Just check the project from the outside to find an issue, then look at the specific code related to that issue to see if you can work on it.
For example, I checked the invoice generator code and found out why the prices for multiple items are not adding up. After checking, I found the problem in two functions in the InvoiceForm.js file: handleAddEvent(evt) and handleCalculateTotal().
After coming up with my own solution, I will definitely check if the whole project runs correctly. (Obviously, I won't share the solution here.)
Fig: Project is running perfectly
I will go to the project terminal and add my changed code. Since I only changed one file, I will add just that file.
Now, I will make a commit in Git.
Linking PR with Issue
Now I will add my contribution to the main repo. Here are the steps shown in screenshots:
Fig: Mentioning issue no. in description of pull request is a must
Wait for the Maintainer to Merge
Now you need to wait until the project owner reviews your code and merges it. If your code is not accepted (merged), don't be upset. Congratulations on your first work in open-source projects!
Note: I haven't shown any work that you can list as a professional achievement on your CV. My goal is to help you understand how to get started as a beginner. To improve and work better, you will need to explore and learn more on your own. Best of luck on your open-source contribution journey!
Resources :
- Open Source Crash Course - Beginner Guide to Open Source
- First Contributions - Github
- How to Contribute to Open Source
- Build Successful Open Source Projects : use this to track and see your open source contribution dashboard
- Top Hacktoberfest Projects to Contribute to in 2024
- Susmita-Dey/Sukoon: This is a stress-relieving website project made for the hackathon Hackofiesta. This project is under the theme Healthcare. (github.com) : I have already contributed to this project