Stellar Reflection
In the world of GitHub, the play on the name "Stellar Reflection" should be immediately apparent to developers familiar with the platform. It's often said that it's better to give than receive, and while this sentiment holds truth, there’s something undeniably gratifying about being on the receiving end as well. Personally, every time I receive a star on GitHub, it’s a little burst of joy. It’s a small but significant reminder that someone—another developer, a peer—took the time to appreciate and acknowledge my work.
Amid the hustle and bustle of today’s world, these moments of recognition and appreciation are precious. Inspired by this experience, I decided to create a GitHub App designed to return the favor. The goal? To foster positivity and encourage mutual support within the developer community by automatically starring other people’s repositories in response to receiving a star on your own.
How Stellar Reflection Works
Stellar Reflection is a GitHub App designed to automate the process of returning stars to repositories that have starred yours. Here’s a breakdown of how it functions:
- Installation and Permissions: To get started, users need to install the Stellar Reflection GitHub App. The app requires minimal permissions to function:
- Read access to metadata: This permission is needed to receive webhooks when stars are added to your repositories.
- Read/Write access: This allows the app to star other repositories automatically.
Once you click "Install & Authorize," you’ll be redirected to a page displaying your user information. Although this page is quite basic at the moment, it serves as a placeholder until further improvements are made. The main goal at this stage is to test the utility of the app and gather user feedback.
- Automated Starring Process: After installation, Stellar Reflection listens for webhooks from GitHub indicating when a star is added to your repository. Using the Octokit REST API, the app searches through the public repositories of the user who starred your repo, and automatically stars their repositories in return. Here’s a snippet of the code responsible for this action:
for await (const repos of octokit.paginate.iterator(octokit.repos.listForUser, {
username: starredBy,
type: 'owner'
})) {
this ensures that the kindness of your gesture is reciprocated, creating a cycle of positive reinforcement.
User Interaction: The person who stars your repositories (does not need to have Stellar Reflection installed) should not need to have SR installed but I'm still trying to investigate the validity of the prior statement. See https://github.com/orgs/community/discussions/137113 and https://github.com/orgs/community/discussions/59559#discussioncomment-10480079. None the less, there is the idea of adding additional features for users who initiate stars by installing the App, such as the ability to decide on which of your repos receives reflected stars.
GitHub Discussions to Log Stars
The GitHub GraphQL API is used to keep a log of star events ala the Discussions feature. For each Stellar Reflection user, there is a separate discussion that tracks which users have starred the user's repo and in turn which repos have been starred in reflection.
Thoughts and Feedback
Currently, Stellar Reflection is in its early stages of development. The app is functioning as intended but is very much in the “Ultra Alpha” phase. The redirect page is basic, showing only authenticated user info. Future updates will aim to enhance the user interface and provide a more polished experience, including a dedicated app page with additional features and functionality.
I’m eager to hear from others who find this app useful or who have suggestions for improvements. Your feedback is invaluable as I continue to refine and expand Stellar Reflection. Thank you for taking the time to read about this project. Here’s to spreading a bit more positivity in our coding community!
Would be great to see who else finds this useful. Thanks for reading. Cheers.