<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Naveen Sundar on Medium]]></title>
        <description><![CDATA[Stories by Naveen Sundar on Medium]]></description>
        <link>https://medium.com/@naveennvrgup?source=rss-8ceca7aa7df5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ie4vH_4zD-LZGOpN.</url>
            <title>Stories by Naveen Sundar on Medium</title>
            <link>https://medium.com/@naveennvrgup?source=rss-8ceca7aa7df5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 20:02:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@naveennvrgup/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Forks and Branches — git ninja]]></title>
            <link>https://medium.com/nitrr-open-source/forks-and-branches-git-ninja-83980a370080?source=rss-8ceca7aa7df5------2</link>
            <guid isPermaLink="false">https://medium.com/p/83980a370080</guid>
            <category><![CDATA[students]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Naveen Sundar]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 18:11:39 GMT</pubDate>
            <atom:updated>2020-04-14T06:47:33.022Z</atom:updated>
            <content:encoded><![CDATA[<h3>Forks and Branches for open-source</h3><h4>Git Ninja Training</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4w9mF8cj3NafYj89JMLhg.png" /></figure><blockquote>This story is part 4 of <a href="https://bit.ly/nitrr_os_1">Open Source 101 Series</a></blockquote><blockquote>Previous story: <a href="https://bit.ly/nitrr_os_3">Git for Open-Source</a></blockquote><p>If you are a beginner to git I highly recommend you to go through our <a href="https://bit.ly/nitrr_os_3"><strong>previous story</strong></a> where we have laid down the basics. It covers repository, remote, commit, push, pull and clone.</p><p>In this story we will explore forks and branches, fine tuned for open-source.</p><h3>Fork — creating your own copy of a repository</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*UowQv3HZ4apmJ-vDxdhjHg.png" /><figcaption><strong>Figure 1: </strong>the fork button in github</figcaption></figure><p>Open source orgs dont allow people to directly commit code to their repos for security concerns. The contributions are welcome traditionally via pull requests. The contributor uses the forked repo to commit code, which later becomes a pull request.</p><h3>Branches — are independent lines of development.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*lHexLRIGvjRxf5AEuHZh1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*eGS_hu8SDAdgU0aamgRg9w.png" /><figcaption><strong>Figure 2:</strong> Feature Branches &amp; <strong>Figure 3:</strong> Isolated work places</figcaption></figure><p><strong>The branches mainly serve two purposes. Those are, provide separate lines of development, for</strong></p><ol><li><strong>different contributors</strong> — Imagine your full day of work being messed up by another contributor’s commit!</li><li><strong>different features</strong> — it acts an isolated place to develop a feature or fix a bug or store a version of the software etc.,</li></ol><blockquote>A repository can have one or more than one branches. The default branch is called “<strong>master</strong>”.</blockquote><blockquote>Usually open-source orgs have a branch called “<strong>dev</strong>” (development). This is the branch where you have to make “<strong>pull request to</strong>” from your “<strong>forked repository feature branch</strong>”.</blockquote><h3>Git commands for branches — cheatsheet:</h3><pre><strong>create new_branch from old_branch<br></strong>git checkout -b new_branch old_branch<br><strong>Ex:</strong> git checkout -b login_ui dev</pre><pre><strong>check current branch name<br></strong>git branch</pre><pre><strong>visit other_branch<br></strong>git checkout other_branch<br><strong>Ex: </strong>git checkout signup_ui</pre><pre><strong>push new_branch to some_remote<br></strong>git push -u some_remote new_branch<br><strong>Ex:</strong> git push -u origin login_ui</pre><pre><strong>pull some_branch from some_remote into current_branch<br></strong>1. git checkout current_branch<br>2. git pull some_remote some_branch<br><strong>Ex:</strong> <br>git checkout dev <br>git pull upstream dev</pre><pre><strong>delete some_branch locally</strong><br>git branch -D some_branch<br><strong>Ex:</strong> git branch -D login_ui</pre><pre><strong>delete some_branch in some_remote<br></strong>git push --delete some_remote some_branch<br><strong>Ex:</strong> git push --delete origin login_ui</pre><pre><strong>merge second_branch into first_branch<br>1. </strong>git checkout first_branch<br><strong>2.</strong> git merge second_branch<br><strong>Ex: <br></strong>git checkout dev<br>git merge bug_fix</pre><pre><strong>add upstream remote to the existing project<br></strong>git remote add upstream &lt;original-project-remote-url&gt;</pre><h3>How to work with branches?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6e21_b6kHDAdxLb4oEP9pQ.png" /><figcaption><strong>Figure 4: </strong>Merging in branches</figcaption></figure><h4>Creation:</h4><ol><li>A branch is created from another branch.</li><li>When a branch is created it shares the past history(previous commits) with the branch it is created from. To be more precise the history until the last commit before the creation.</li></ol><h4><strong>Checkout:</strong></h4><ol><li>It means going to/visit another branch.</li><li>In this operation, the head is shifted from current branch/commit to another branch/commit. Like from dev/23dve2 to bug_fix/23dve2.</li></ol><h4><strong>Divergence of branches:</strong></h4><ol><li>It means the branches being compared have a different history.</li><li>In <strong>figure 4 — part 2</strong> we can see “dev” and “new_feature” have varying commits no we can say them as diverged.</li></ol><h4>Merging:</h4><p>So different people and features have their own branches to commit code. If that’s the case then, <strong>how isolated features will end up as “one piece” in the final production code?</strong></p><p>The answer is we combine the branches together to get the final code. When we combine the branches it is called a merge.</p><p><strong>If commits are to merged “from B” =&gt; “to A”, then:</strong></p><ol><li><strong>If both A and B have any new commits — </strong>The result is 3 way merge. This means in addition to adding commits from B to A, on top of that a merge commit will added. <strong>figure 4 — part 2 : “</strong>new_feature” is merged with “dev”.</li><li><strong>If one of A or B don&#39;t have any new commits — </strong>The result is a fast forward merge. No merge commit this time. <strong>figure 4 — part 3:</strong> “bug_fix” is merged with “dev”</li></ol><h4><strong>Merge conflicts:</strong></h4><p>When other contributors commits in “branch A” change the same part of code as your commits in “branch B”, the git won&#39;t know how to perform the merge. Thus results in a merge conflict. <strong>We will go into detail about how to solve merge conflicts in the upcoming article.</strong></p><h3>Forks and branches are cool, now let us see how everything comes together!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_-lFXX-zl0aAOjteoGci6A.png" /><figcaption><strong>Figure 5:</strong> each circle is a commit</figcaption></figure><p>When you develop software in open-source you are required to manage 3 git trees. You may think that’s quite a lot, actually, it is pretty simple! (also remember that the fellow members of the org are willing to help you). Let&#39;s break down the complexity into small consumable chunks.</p><ol><li><strong>upstream remote — </strong>it is the original repo of the project you are contributing to.</li><li><strong>origin remote — </strong>it is the forked repo.</li><li><strong>local — </strong>this is the cloned git tree on you local machine</li></ol><h4>Project Setup</h4><ol><li>Fork the repo</li><li>clone the forked repo</li><li>add the upstream remote to the existing project</li></ol><h4><strong>why we need to manage 3 trees?</strong></h4><ol><li>We need a git tree locally for committing code. The open-source orgs don&#39;t provide direct access to push code into their original repo. So 3 trees are evident!</li><li><strong>Other people will be making PR to upstream. And the merged PR will result in updated “upstream/dev”.</strong></li><li>Now the issue is how will we get the updated code to “local” and “origin”.</li><li>The issue becomes more complicated when it has merge conflicts with your code.</li></ol><h4>How to get the updated code to the local and fork(origin)?</h4><p>The answer is quite simple, most probably the updated code will be placed in “upstream/dev”. All you need to do is checkout to “dev” in the local git. And pull from “upstream/dev”. After that, you can send the same code to your fork (origin).</p><pre>git checkout dev<br>git pull upstream dev<br>git push origin dev</pre><h4><strong>What if you are already working on a feature in your personal branch?</strong></h4><p>Pull the “upstream/dev” into “personal_branch”. Beware this will create a three way merge commit.</p><pre>git checkout personal_branch<br>git pull upstream dev</pre><h4>Please follow our publication for more git ninja training. Our next article will be on merge conflicts and how to handle them.</h4><h4>ding ding!!!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83980a370080" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nitrr-open-source/forks-and-branches-git-ninja-83980a370080">Forks and Branches — git ninja</a> was originally published in <a href="https://medium.com/nitrr-open-source">NITRR Open Source</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git for Open-Source — 1]]></title>
            <link>https://medium.com/nitrr-open-source/git-for-open-source-1-835b6601210b?source=rss-8ceca7aa7df5------2</link>
            <guid isPermaLink="false">https://medium.com/p/835b6601210b</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Naveen Sundar]]></dc:creator>
            <pubDate>Wed, 08 Apr 2020 17:42:47 GMT</pubDate>
            <atom:updated>2020-04-12T16:07:32.142Z</atom:updated>
            <content:encoded><![CDATA[<h3>Git for Open-Source</h3><blockquote>This story is part 3 of <a href="https://bit.ly/nitrr_os_1">Open Source 101 Series</a></blockquote><blockquote>Previous story: <a href="https://bit.ly/nitrr_os_2">Understanding an open-source project</a></blockquote><p>Open-source software development requires you to think the <strong>git commands in terms of remotes and branches</strong>. Which normally, we dont worry about, since we use one remote and one branch for personal projects.</p><p>Believe me when I say “Yet another git tutorial is the last thing we wanted to create”. People often accumulate bad habits when using git, like messing up the branch history, wierd workarounds to solve conflicts, deleting local codebase + fresh cloning — to list a few. This + next set of articles will help you make better decisions while using git.</p><h3>I recommend you go through this git tutorial after reading the article:</h3><p><a href="https://www.youtube.com/watch?v=3RjQznt-8kE&amp;list=PL4cUxeGkcC9goXbgTDQ0n_4TBzOO0ocPR">Git &amp; GitHub Tutorial for Beginner- Net Ninja Youtube</a></p><h3>Repository — A place to store code</h3><ul><li>Online repository — Like projects in github</li><li>Local repository — The projects in your local machine.</li></ul><h3>Remote — URL of the repository</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*G5wozTLQoGRxiHxKz6lA7Q.png" /><figcaption>remote</figcaption></figure><pre><strong># Example: Remote of mentorship-backend project of anitab-org </strong><a href="https://github.com/anitab-org/mentorship-backend.git"><br>https://github.com/anitab-org/mentorship-backend.git</a></pre><h3>A “commit” in git is the way of saving changes you made to the files.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*peK3Cltn5t_RVZPXQa25vA.png" /><figcaption>An example commit</figcaption></figure><p><strong>Things to note in a commit:</strong></p><ol><li>Commit has a message. It says what is the purpose of the changes.</li><li>The author and timestamp of the commit is noted. So he/she is credited for that piece of code. If somebody steals your code you can argue that you made the commit earlier!</li><li>A unique hash is generated for each commit, to identify the commit.</li><li><strong>A commit stores only the changes in the files and file creation/deletion. Not the entire contents of files. </strong>As we can see that plus+(green lines) are added to the file and minus- (red lines) are deleted from the file. Also we can see that, there is total of +54 and -9 among 5 files included in that commit.</li></ol><h3>How to create a commit?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*XIbMwcAjxC6FsrwhfFlPAA.png" /><figcaption>Commit Procedure</figcaption></figure><ol><li>makes changes in the code</li><li>selected files to be included in the current commit</li><li>create the commit</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*f_KrgBxfJ4l9XqMh.jpg" /><figcaption>Wooof! Thats a lot to take in! You can relax with this cat picture 😃</figcaption></figure><h3>If only changes in files are saved then how do we get the complete codebase?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*y0fteR3BTTJFWYi5DuI3ZA.png" /><figcaption>git branch example</figcaption></figure><ol><li>Git actually forms a <strong>tree</strong> with our commits.</li><li><strong>Git stores our commits in a sequential order called “branch”</strong>. The changes are put “one on top of another” to create the complete codebase. <strong>We can have multiple branches!</strong></li><li>In the above picture you can see that commits are laid on top of each other.</li><li>The tree is rooted in remote named <strong>“origin”</strong>. <strong>We can have multiple remotes!</strong></li><li>We have 3 commits. You notice the top commit is gold colored. Thats because our “head” lies there.</li><li><strong>“Head” is the commit+branch combination on top of which the developer is “currently working on”. </strong>Our head is on top of “commit 3” of branch “master”.</li><li>You can see that selected files and altered files lie on top of “commit 3”. This is because when “staged files” are commited it becomes “commit 4”. Also when we “stage the files” it becomes “selected” and ready to “commited”.</li></ol><h3>push — upload the commits to online repository</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OglcyTHw7Iu15T90El8enQ.png" /><figcaption>push workflow</figcaption></figure><h3>pull — get new commits from online repository</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zxzla99ZyugdUY8tF6APaQ.png" /></figure><h3>clone — creating a copy of online repository in local machine</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*xwnuKVpNfTrt7Deg.png" /><figcaption>clone workflow</figcaption></figure><h3>Git commands</h3><pre><strong>1) create a new git repository</strong><br>git init</pre><pre><strong>2) clone a online repository into local machine</strong><br>git clone &lt;remote-url&gt;</pre><pre><strong>3) add a new remote</strong><br>git remote add &lt;remote-name&gt; &lt;remote-url&gt;</pre><pre><strong>4) staging specific files <br></strong>git add &lt;space separated list of files&gt;</pre><pre><strong>5) staging all files<br></strong>git add .</pre><pre><strong>6) view file changes<br></strong>git status</pre><pre><strong>7) commit the staged files<br></strong>git commit -m &lt;commit message&gt;</pre><pre><strong>8) view commits history</strong><br>git log --oneline</pre><pre><strong>10) push the commits to online repository<br></strong>git push &lt;remote-name&gt; &lt;branch-name&gt;</pre><pre><strong>11) pull the commits from online repository<br></strong>git pull &lt;remote-name&gt; &lt;branch-name&gt;</pre><h4>In the next article we will learn how to use “git branches the right way”. Follow our publication for more open source articles. :)</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=835b6601210b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nitrr-open-source/git-for-open-source-1-835b6601210b">Git for Open-Source — 1</a> was originally published in <a href="https://medium.com/nitrr-open-source">NITRR Open Source</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding an open-source project]]></title>
            <link>https://medium.com/nitrr-open-source/understanding-an-open-source-project-1f2aaa6e80d1?source=rss-8ceca7aa7df5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f2aaa6e80d1</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[college]]></category>
            <category><![CDATA[students]]></category>
            <dc:creator><![CDATA[Naveen Sundar]]></dc:creator>
            <pubDate>Sun, 05 Apr 2020 19:45:27 GMT</pubDate>
            <atom:updated>2020-04-07T10:11:47.352Z</atom:updated>
            <content:encoded><![CDATA[<p>General approach to open source organisations…</p><blockquote>This story is part 2 of <a href="https://bit.ly/nitrr_os_1">Open Source 101 Series</a></blockquote><blockquote>Previous story: <a href="https://bit.ly/nitrr_os_1">Introduction to open-source</a></blockquote><h3>Orgs come in a few flavours: <a href="https://summerofcode.withgoogle.com/organizations/?sp-page=2">(here is a list of orgs)</a></h3><ol><li><strong>Targeted at a specific goal/cause/mission</strong> — <strong>OpenMRS</strong>( The main goal is to create a electronic medical records keeping system), <strong>Zulip</strong>(provides a chat platform).</li><li><strong>Umberalla organisations</strong> — Concentrates on a wider varitey of softwares with multiple smaller organisations under it. Great example will be <strong>AOSSIE</strong>(Australian umbrella organisation for open-source projects).</li><li><strong>Open Source Division of private companies</strong> — For example take <strong>React.js </strong>(yeah that deadly corona virus) is indeed make by <strong>Facebook</strong> a private company.</li></ol><p>I will take a person Dinesh to make you understand an open source project. Dinesh views the list of orgs and likes the mission of <a href="https://github.com/anitab-org">AnitaB.org</a> (an open-source org). He takes these following steps to choose a project, learn about it and make himself ready to contribute.</p><blockquote><a href="https://git-scm.com/"><strong>Git — Version Control System</strong></a></blockquote><blockquote>Allows group of people to collaborate by sharing each other’s code. You can monitor the changes between different versions of your software.</blockquote><blockquote><a href="http://github.com/"><strong>Github — The platform to create software</strong></a></blockquote><blockquote>Github is the platform of choice for many open-source projects. <strong>Github </strong>is a website that provides git as a service. (SaaS — Software as a Service). A place to store/share the source code.</blockquote><blockquote><strong>Git is the software whereas, Github is a service provider that provides Git as a service. Many people get it wrong :(</strong></blockquote><p><strong>Step 1:</strong> Dinesh open the github page for AnitaB.org. Where he is greeted with list of available projects under that organisation.</p><p><a href="https://github.com/anitab-org">AnitaB.org Open Source</a></p><p><strong>Step 2: </strong>Our Dinesh is interested in developing backend servers. So he choose to go with mentorship-backend project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dJYnAY6w4NtXGq84hIrk5Q.png" /><figcaption>mentorship-backend repo</figcaption></figure><p><strong>Step 3: </strong>The first thing to do now will be to introduce your self to the community. Find out which chat platform the org is using and join the chat. AnitaB is using <strong>zulip </strong>in our case.</p><p>A good introduction will have your name, occupation, skillset and project you are interested in.</p><blockquote><strong>Dinesh (in slack):</strong> Hi guys! I am Dinesh, pursuing my undergrad in CSE at NIT Raipur. I have experience in MERN stack. I am willing to contribute to mentorship-backend project.</blockquote><p>The fellow members of the org will be more than happy to guide you if have any doubts or you want to share anything in general. But you have to keep in mind these<strong> unspoken rules</strong>:</p><ol><li><strong>Never ask a GOOGLE-able question</strong>.</li><li>It is considered thoughtful to look in the docs before asking a doubt about the project.</li><li>Respect others — Never trash others ideas or force yours. Exchange ideas as suggestions.</li><li>Avoid “slang words”.</li><li>If you face any errors, always provide enough information for the other person to help you. Like copy-paste the full trace back, instructions to reproduce the bug, screenshots, context of the problem etc.,</li></ol><p><strong>Step 4: </strong>Fork the repo and setup the local development environment. Always the instructions to run the project will be provided in the repo’s README.md file.</p><p><strong>Step 5: </strong>Almost all* orgs will have some sort of way to explain you the features of that project and how its is being implemented. In this particular project it is provided as <a href="https://github.com/anitab-org/mentorship-backend/wiki">Github Wiki</a>. Make sure to read it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oaht1BTVOCwnl2zMJJP21A.png" /><figcaption>github wiki of mentorship-backend project</figcaption></figure><p><strong>Step 6: Get a feel for the project by:</strong></p><ol><li>Running the project locally.</li><li>Playing around with the all features.</li><li>Run the test suite locally.</li><li>Ask for doubts/help in the chat.</li><li>Explore the file structure.</li><li>Hop into files and read important bits of the code. Comments are there to help you :)</li></ol><p><strong>Step 7: </strong>The best way to start contributing is to review the PR’s made by others. A review can be:</p><ol><li>Suggesting an better alternative way to implement the logic.</li><li>Suggesting better name for variables, raising doubts on their logic etc.,</li><li>Running PR locally to check for bugs.</li><li>Confirming that the PR solves the linked Issue is completely.</li><li>Always end the review with comments summarising your analysis. So that it shows — you have made the effort and it will help the other reviewers.</li></ol><p><strong>Step 8: </strong>Now Dinesh has good understanding of the project. He is ready to tackle some issues or create some of his own.</p><blockquote>The next story will be “Working with git in open source”. Please follow our publication for more open source content :)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f2aaa6e80d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nitrr-open-source/understanding-an-open-source-project-1f2aaa6e80d1">Understanding an open-source project</a> was originally published in <a href="https://medium.com/nitrr-open-source">NITRR Open Source</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open Source 101]]></title>
            <link>https://medium.com/nitrr-open-source/open-source-101-6565a8c15bf1?source=rss-8ceca7aa7df5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6565a8c15bf1</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[pull-request]]></category>
            <category><![CDATA[students]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Naveen Sundar]]></dc:creator>
            <pubDate>Sat, 04 Apr 2020 09:15:43 GMT</pubDate>
            <atom:updated>2020-04-04T09:15:43.724Z</atom:updated>
            <content:encoded><![CDATA[<p>An unconventional introduction to open-source…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*c3sn8UF6d6dE3e8v.png" /><figcaption>Examples of open-source software</figcaption></figure><p>In <strong>open-source </strong>people join together and create software for free. The software made is publicly available, which means it can be modified and redistributed by anybody.</p><p><strong>Example of open-source softwares are: vlc media player, mozilla firefox, ubuntu(and all linux), python programming language etc.,</strong></p><blockquote>Many questions may arise in your head — why, how etc. Grab a cup of caffeine and pair of spectacles, the answer lies ahead!</blockquote><h3>Why should I contribute to open-source?</h3><ol><li>Companies consider your open-source contributions seriously. It will make your resume/CV that much more valuable than a pet project.</li><li>You will learn industry best practices and your code quality will improve dramatically.</li><li>You will comes across a lot of different technologies, the skills you acquire can be directly used in a software engineering job.</li><li>It will show that you can work with a lot of people and your communication skills. Which are important traits for any job and have been looked after by all companies.</li><li>You will contribute to a good cause and your work is likely to be used by thousands or millions of people.</li></ol><h3>How open-source software is created?</h3><ol><li>An <a href="https://github.com/anitab-org/mentorship-backend/issues/487"><strong><em>Issue</em></strong></a><strong><em> </em></strong><em>is created</em><strong>.</strong></li><li>The issue is fixed by <a href="https://github.com/anitab-org/mentorship-backend/pull/489"><strong><em>Pull Request</em></strong></a><strong>.</strong></li></ol><blockquote>I am not kidding that’s all it takes. All the other complexity and coding stuff comes under these two steps.</blockquote><h3>What is an Issue?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5Oef5ZtaqNUitQvmAFmAA.png" /><figcaption>Issue — Bug report</figcaption></figure><ol><li>Issue may be one of few things: a new feature request, a bug report, a code remodelling request, a documentation update request etc.,</li><li><strong>Issue is a well defined description of a single problem to be solved</strong>.</li><li>Our example <a href="https://github.com/anitab-org/mentorship-backend/issues/487">Issue #487</a> is a bug report</li><li>Here I asked one of the project maintainer to assign this issue to me. So others wont work on the same issue. Reducing duplicate efforts.</li></ol><h3>What is a Pull Request:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IEZxTprnXzJ42Msfqeugmg.png" /><figcaption>Pull Request (PR) — to fix previous issue.</figcaption></figure><blockquote>A Pull Request(PR) is a piece of code written to fix a particular issue. Since you request to “pull” your code from fork to original, it is named as a “pull request”. These are the steps taken by me to create <a href="https://github.com/anitab-org/mentorship-backend/pull/489">Pull Request #459</a>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*UowQv3HZ4apmJ-vDxdhjHg.png" /><figcaption>Click on fork button to fork the repo</figcaption></figure><h4>Create fork of the repository and setup project in my local machine:</h4><p>Forking a repo means creating your own personal copy of the original repo. I cloned the forked repo into my local machine. Setup the project as the instructions provided.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*iN-aO6FU_WcQ_LES_216hg.png" /><figcaption>Bug fix</figcaption></figure><h4>Finding the bug and fixing it</h4><p>I tried a few ways to find the bug. Finally I discovered that the solution is this 2 lines of code ( LOL ) . Made the fix. Wrote a comment. Made a commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*OV9ps7oUG4jEXf93a3zWPQ.png" /><figcaption>A Unit Testcase (1 of 3) which i wrote for the bug.</figcaption></figure><h4>Write test cases for the fixed bug</h4><p>A <strong>test case</strong> consists of an input to the <strong>code</strong> and an expected output. I am just simulating the scenario and checking whether I get the correct output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*791L6Av4xiY7WgT8e0vfPQ.png" /><figcaption>Run the entire test suite</figcaption></figure><h4>Ensure that my additional code doesn’t break any existing logic!</h4><p>This can be achieved by running the test cases written by the previous developers. Since it ran the tests successfully, now we can safely push the code to the fork.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NY6bu8NBLtbOS-PZQ9oY8A.png" /><figcaption>Comparing changes between fork and original repo</figcaption></figure><h4>Create the pull request</h4><p>We can now compare the changes between our fork and original repo. The changes are made into a PR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ke8t_eZ6X5tu3iRNzk0WXQ.png" /><figcaption>Travis CI in action after PR</figcaption></figure><p><strong>Once the PR is made </strong>Automatically the CI (Continuous Integration pipeline) kicks into action. It checks if the PR code is good or faulty. If it is all good, we will get a green check mark. Then a maintainer of the repo checks the changes. If he/she is satisfied with the code, then the PR will be merged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*DmcIyEs15XUJh5Bnq5SWBg.png" /><figcaption>A successfully merged PR</figcaption></figure><p>This concludes one life cycle of code contribution. we repeat the same cycle with another Issue.</p><h3>Things to take away:</h3><ol><li>Open Source is not a hackathon or a freelance project.</li><li>Things are to be performed is a systematic manner.</li><li>So try to get assigned an “Issue” and break down the complexity into small consumable chunks.</li><li>PR’s will take even 1 or 2 weeks to be merged.</li><li>Patience is key.</li><li>You can work on multiple PR’s at the same time.</li></ol><h4>This article is one of a many part series into open-source. Please follow OUR publication for detailed articles on open source !!!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6565a8c15bf1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nitrr-open-source/open-source-101-6565a8c15bf1">Open Source 101</a> was originally published in <a href="https://medium.com/nitrr-open-source">NITRR Open Source</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serve SPA with Django]]></title>
            <link>https://medium.com/zenithec-techware/serve-spa-with-django-1f492f2857ed?source=rss-8ceca7aa7df5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f492f2857ed</guid>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[hosting]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Naveen Sundar]]></dc:creator>
            <pubDate>Sat, 18 May 2019 07:41:00 GMT</pubDate>
            <atom:updated>2019-05-18T07:41:00.678Z</atom:updated>
            <content:encoded><![CDATA[<p>#poweredByCaffine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJ3Pa5cQI8TErbuWQ2imRA.png" /></figure><p><strong>Level: Intermediate</strong></p><p>This tutorial will guide you on how to set up for serving SPA (Single Page Application like React, Angular, Vue) through Django.</p><p><strong>Django</strong> is awesome for startups and for people who want to get work done under tight deadlines as it comes baked in with most of the basics like authentication, as great ORM, sweet sweet admin panel and much more.</p><p>Combine it with<strong> React.js</strong> the frontend framework of my choice I would say its the sweet spot. This tutorial will work just fine with Angular and Vue as well. Just change the react build with respective ones.</p><p><strong>Prerequisites:</strong></p><ol><li>python3</li><li>node-js</li><li>create-react-app</li></ol><p><strong>Okay, let’s dive into the code:</strong></p><p>Let’s prep the directory. I like to keep the backend and frontend into its separate folders. That’s just my preference.</p><pre>mkdir dogs          <br># dogs not cats, why? coz even dogs deserve love @catsSuck<br>create-react-app frontend<br>mkdir backend</pre><p><strong>Step 1: Build the SPA</strong></p><p>Now its time to build the react app.</p><pre>cd dogs<br>npm run build<br># patience!!! it will take a minute or 2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/188/1*XysBwIE6A-7iAAmG0ab_Vw.png" /><figcaption>the new build folder</figcaption></figure><p>This will compile the JSX, optimizes the HTML and CSS resulting in what is known as bundles. You should notice a folder named <strong>build</strong> has appeared in/frontend/build/.</p><p><strong>Step 2: Prepare the Django</strong></p><p>Let’s create a new Django project for the purpose of the demo.</p><pre>cd ../backend/<br>python3 -m venv env<br>source env/bin/activate<br>pip3 install django<br>django-admin startproject server .</pre><p>Now that Django project is set up open /backend/server/settings.py/ and do these edits.</p><pre># this is to allow our server to serve on localhost</pre><pre><strong>ALLOWED_HOSTS = [&#39;*&#39;]</strong></pre><pre># let the django django know where to look for templates</pre><pre>TEMPLATES = [<br>{<br>&#39;BACKEND&#39;: &#39;django.template.backends.django.DjangoTemplates&#39;,<br><strong>&#39;DIRS&#39;: [&#39;../frontend/build&#39;],</strong><br>&#39;APP_DIRS&#39;: True,<br>&#39;OPTIONS&#39;: {<br>.......</pre><pre># these help django find the static files</pre><pre>STATIC_URL = &#39;/static/&#39;<br><strong>STATICFILES_DIRS = [<br>    os.path.join(BASE_DIR, &quot;../frontend/build/static&quot;),<br>]<br>STATIC_ROOT = &quot;static/&quot;</strong></pre><p>To create a route for SPA chuck these under /backend/server/urls.py .</p><pre>from django.contrib import admin<br><strong>from django.urls import path, re_path<br>from django.views.generic import TemplateView</strong></pre><pre>urlpatterns = [<br> path(‘admin/’, admin.site.urls),<br>      ...other routes ...<strong><br> re_path(‘’, TemplateView.as_view(template_name=”index.html”)),</strong><br>]</pre><p><strong>Step 3: Start the server</strong></p><pre>python manage.py migrate<br>python manage.py collectstatic<br>python manage.py runserver</pre><p>Now if you visit <a href="http://127.0.0.1:8000/">http://127.0.0.1:8000/</a>, you should see the SPA is being served by Django.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z2PKk2Ry9-MjgI0H7wzwCg.png" /><figcaption>SPA being served by Django</figcaption></figure><p>brought to you <a href="https://zenithec.com/">Zenithec Techware</a> [Startup advancingStartups]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f492f2857ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zenithec-techware/serve-spa-with-django-1f492f2857ed">Serve SPA with Django</a> was originally published in <a href="https://medium.com/zenithec-techware">Zenithec Techware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>