### Public Lab welcomes and encourages community contributions to our open source software! This page is intended to: 1. List software projects that Public Lab has incubated and provide links to source code. 2. Collect software development guidelines and best practices for Public Lab projects. 3. Help newcomers figure out how and where to start contributing! ## Getting started For an excellent overview of contributing to open source projects in general, check out [How to contribute to an open source project on Github](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). Quick tips for getting involved with the Public Lab codebases: 1. **Set up a GitHub account and install git.** If you're not familiar with git, a popular version control software, you can try it out at https://try.github.io. Speaking of GitHub...right now, all of Public Lab's open source code is located on GitHub, a website which hosts git repositories. Setting up a GitHub account is the first step to getting involved with Public Lab's code (and lots of other code). 2. **[Join](http://publiclab.org/wiki/mailing-lists) the Public Lab [developers mailing list](https://groups.google.com/forum/#!forum/plots-dev)** ## Contribution Guidelines Public Lab software is written in many languages, and each project may have its own guidelines for contributors. These broad guidelines should serve as general principles to guide your approach to a new Public Lab codebase. ### Contributing using git Check out this article on [GitHub flow](https://guides.github.com/introduction/flow/index.html), a routine that works great on all git projects and makes Public Lab development super smooth. ### A sample git workflow Let's say that a developer and PublicLab community member named Susan decides that she wants to add a feature to `plots2` (PublicLab.org). Here's what Susan's workflow might look like: 1. Susan [forks](https://help.github.com/articles/fork-a-repo/) the [publiclab/plots2](https://github.com/publiclab/plots2) repo on GitHub. 2. Susan [clones](http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository#Cloning-an-Existing-Repository) the forked repository susan/plots2. This downloads a copy of Susan's version of plots2 to her computer. 3. She creates a branch for the new feature (a *feature branch*). Let's say that Susan wanted users to be able to tag maps. She might then create and checkout a new branch called `add-map-tags` with: `git checkout -b add-map-tags`. 4. Susan develops the new feature in the `add-map-tags` feature branch, making commits (and running tests) as she goes. 5. When Susan is done developing the new feature, she switches back to the master branch of her own repository: `git checkout master`, and then pulls the latest version of plots2 down from the `publiclab repo` with `git pull https://github.com/publiclab/plots2.git master`. 6. Susan applies her new feature on top of the latest version of plots2: From the `add-map-tags` branch, she runs `git rebase master`. **This is the great strength of doing development in a feature branch - it allows Susan to merge her changes into the latest public version of plots2 on her own computer and to [resolve any conflicts]( https://help.github.com/articles/resolving-a-merge-conflict-from-the-command-line/) locally.** Back in `master` (`git checkout master`), Susan runs `git merge add-map-tags --ff-only` to bring her master branch up to date. 7. After rebasing, Susan's local master branch contains the latest version of plots2 with her new feature added on top. The new feature is ready, so Susan [submits a pull request on GitHub](https://help.github.com/articles/using-pull-requests/). 8. Susan discusses her code with others. After any questions or change requests have been resolved, Susan's request is merged in, and her contribution becomes part of PublicLab.org! A few notes - some git best practices that will make all of our lives easier: * Remember to pull from `master` before you start working. This helps keep your local repository in sync with the code that everyone else is working on. If you've forgotten to, [see below for how to recover without losing your work](#Rewinding+the+master+branch). * Always do development in a feature branch (again, [see below](#Rewinding+the+master+branch) if you've forgotten). This makes it much easier for project maintainers to merge your contributions into the trunk. The name of your branch is displayed when it is merged in to the main trunk, which means that it serves as built-in documentation for your feature. This works great when you give your feature branches descriptive names! Some example branch names: * donation-button-redesign * markdown-package-update * fix#44 (fixes GitHub issue #44 in this repository) * Open a pull request early! In fact, feel free to open a pull request as soon as you start working on a new feature or bugfix. GitHub's pull request pages make it easy to see progress that's been made on an issue, and it's a great way to start an open and ongoing discussion with the project's maintainers and other contributors about your work. For some additional tips for different scenarios, such as if you've forgotten to make your commits in a named feature branch and need to rewind your master, [see below](#Additional+workflows) ## Public Lab Software
Project | Description | Source Code |
---|---|---|
publiclab.org | This very website! | github:publiclab/plots2 |
MapKnitter | Assemble aerial images into maps. | github:publiclab/mapknitter |
spectral-workbench.js | JavaScript library for DIY spectrometry and data manipulation. | github:spectral-workbench.js |
Spectral Workbench | Database and sharing platform for DIY spectrometry, which uses the above spectral-workbench.js library. | github:spectral-workbench |
Leaflet.Illustrate | Leaflet plugin built for MapKnitter. Enables text annotations on Leaflet maps. | github:manleyjster/Leaflet.Illustrate |
Leaflet.DistortableImage | Leaflet plugin built for MapKnitter. Enables images to be distorted. | github:publiclab/Leaflet.DistortableImage |
Infragram | Analyze plant health with infrared imagery. | github:p-v-o-s/infragram-js |
MapMill | Upload and collaboratively rank large batches of aerial imagery. | github:publiclab/mapmill |