Doing Less in Your App to Give More to Your Users
The art and science of working smarter, not harder!
Why Doing Less is Important
Open Source projects, whether they be focused on applications, utilities, or systems software, have a number of advantages that are not always as easy to find in the corporate world. Among these are:
- Creativity and expertise
- Technical, geographic, and cultural diversity
- Motivation stemming from a passion for the project
The latter is foremost among these advantages. The old adage that “there are somethings money can’t buy” holds true. Just as salary is a demotivator rather than a motiviator, the passion a team has about the project doesn’t guarantee success, but success is far harder to achieve without it.
However, one area where Open Source projects are lacking is in the area of having a workforce with ample time set available to focus on DevOps. Members of Open Source teams typically contribute their spare time and as a result have day jobs, school, and families which all vie for their time.
As a result Open Source teams don’t have the luxury of “throwing manpower” at problems and day-to-day operations. Instead, they have to work smarter, rather than harder so the time they can contribute to the project is focused on tasks that deliver real value — fixing bugs, adding features, and listening to users.
Spending Your Time Wisely
Most Open Source projects contain pages that give credit to the development team. This is important given that the efforts of the team are often unpaid and are purely the result of a passion for the project. But does it make sense to hard code that information into the app? Especially since adding new members to the team means that app changes will be required. This is time that would be better spent on supporting your users.
As an alternative, consider using the GitHub API to dynamically build the contributor page. The resulting advantages include the fact that no code changes will be required as the team changes and the time spent on maintaining the contributor page can be spent on higher value activities for your users.
The devGaido team recently followed this approach. The remainder of this article describes the technical details of how this was implemented in our React/Redux-based application.
Working Smarter
The GitHub API can be accessed in two “flavors” — REST or GraphQL. Although GraphQL may seem to be the wave of the future, we chose to use REST since our needs were simple. In our case this simple URL, requiring no authentication —
was sufficient to retrieve the following JSON.
Since our project is public on GitHub no additional authentication is required to retrieve this information for the Contributor section of our About page. In fact, the only JSON attributes that are required are the login
, avatar_url
, and html_url
attribute values.
Our application, like most, consists of frontend and backend components. The core technologies we rely on for this are NodeJS, React, Redux, and React Router. The process starts in the backend with the React Router invoking a service function that retrieves and eliminates all but the three attributes mentioned above. These are placed in the Redux Store and made available to the frontend React components in the form of a React prop.
In the frontend the About page component invokes a Contributors component that retrieves the contributor list from the prop and generates HTML, which when rendered contains the contributor avatars and names. When a contributor name is clicked that individuals GitHub profile page is displayed.
Summary
The end result is an About page containing the list of contributors to the project, but is dynamically constructed so no manual maintenance is required as the team changes. Taking this approach allows us to eliminate any manual updates or recurring maintenance to our contributor list so we can concentrate on devoting more time to user requests.
Feel free to check out the code on GitHub.
I hope you find this information useful and I look forward to any questions and comments you might have. Have a good day, afternoon, or evening and go do great things!
What is Chingu?
Come join us at Chingu.io to get out of “Tutorial Purgatory” by joining one of our remote Voyage project teams to build apps, refine “hard” skills, and learn new “soft” skills. We help Developers bridge the gap between what they’ve learned and the skills employers are looking for.