GSoC 2021 @CCExtractor Development | Project Beacon

GSoC 2021 @CCExtractor Development | Project Beacon

Hey! A lot of exciting things happened this Summer 2021, and here I'm to talk about one of the amazing project I worked on. I spent the last 10 weeks working as a Student Developer under CCExtractor Development organization for the Google Summer of Code 2021.

And honestly, calling it "work" would be an exaggeration. After all, I really had a fun time getting a chance to work on such a fascinating project idea.

This project is a flutter build native interface to ease the group traveling (or hiking). By using this, the group leader would be able to share his location with the entire crew, and in case if someone loses contact with the group, he can quickly get in the right place by following the beacon.

Final Look

Untitled design.png

Project Overview

  • Pre-GSoC and Community Bonding:

    During the pre-GSoC and community bonding period, I worked on finalizing the UI of the application, for which I would like to thank Roshni Prajapati who helped me with the designs. Also, I prepared an application as a proof of concept using firebase as a backend tool, but later it was decided to have a well-written and deployed backend server so I worked with backend developer Aadi Bajpai to finalize the schema.
  • Phase-I:

    The tech-stack for backend is GraphQL, NodeJS, and MongoDB, since GraphQL was new to me, so I learned about it as UI for the application was ready. After the first patch of backend queries was built, I started integrating it. The playground link can be found on: beacon.aadibajpai.com/graphql. For the phase-I, I worked on adding the following functionalities:
    • Authentication: Login, Signup, and Login as a guest using provided GraphQL queries and mutation. Each user info is saved on the local database for which I used Hive so that authToken can be retrieved faster and if connectivity is lost that data can be consumed. When a user logs out, user data is also removed from the local database.
    • Create Beacon: Guest user (Guest user refers to an anonymous user for which we don't have details like name, email) won't be able to create a hike.
    • Join Beacon using shortcode or shared URL: Join Beacon using shortcode was easier to implement as I just had add mutation for it. For join beacon using shared URL, I used uni_link. For joining using shared link, user may or may not be logged in.
    • Added validators for email, password, expiry DateTime, etc., and worked on enhancing the UI.
  • Phase-II:

    Phase-II was the main and crucial part of the journey as I'd to implement the core features. For the phase II, I worked on adding the following functionalities:
    • Location update from leader using stream subscription, for this I used geolocator
    • Modified the main screen to display the list of users' beacon and nearby beacons so that users can navigate back to the hike screen.
    • Fetching real-time location updates for the followers using GraphQL subscription. (For this, I used Web Socket Stream Subscription). To display the route, I used the flutter_polyline_points package.
    • Fetching real-time updates of who joined the beacon (again using web socket stream subscription) and notifying leader when a new user joins the hike using overlay_support.
    • Displaying marker for each and every user (leader's marker is red in color, and others are yellow)
    • Create and display landmarks: Any user can create landmarks and it would be displayed to all. (Landmark marker color is purple)
    • Added app icon

Contributions Summary

  • Started this project from scratch
  • 50+ commits
  • ~14,000 lines of code

What's left to do?

There still remain a few requirements and features that my mentor Carlos Fernandez Sanz proposed and according to me as well those features would enhance the usability of the application. I intend to contribute to this project after GSoC and work on these features but contributions are welcomed too:

  • State of the Hike Screen shouldn't get affected when connectivity is lost: For this, I am using Hive to store data in the local database so that when connectivity is lost, saved data can be consumed.
  • Share route if beacon is active: Whenever new location is fetched from beaconLocation subscription, it gets stored in route list. This can be used to share route if beacon is active.
  • Switch leader: The main issue with implementing this is there might be a case when new leader isn't active for this we need to update the location of each and every user and when beacon is relayed using provided mutation, beacon location should also be changed to the location of that user (if location is null then that might lead to process failure).
  • Oauth: The present authentication process might be cumbersome for few so adding Oauth feature would enhance the user experience (Backend needs to be modified for this)
  • Preschedule Beacon: Again in this case too, beacon location should be pre-specified; otherwise, it might lead to process failure. Notification scheduler feature of flutter_local_notifications can also be used to inform user when Hike has started.
  • N beacon one group: That's one of the crucial part of the application. Also, the backend isn't ready for this.

What I learned?

Brainstorming to resolve errors, the solution to which was not even available on StackOverflow, gave me a new perspective to solve them by reverse engineering my way back to the root cause of the error which includes reading the source code of the internal libraries used.

The amount of knowledge and experience I have gained during this Google Summer of Code is incomparable, how a project is maintained and how developers work together to deliver solutions. And I got to develop a love for open source through my work with project Beacon!

Moreover, GraphQL, NodeJS, and MongoDB, were some of the major things I planned to eventually learn and finally got the chance during this project as it was the part of backend tech stack and my main project revolved around integrating GraphQL queries, mutations, and subscriptions.

Acknowledgements

Special thanks to Ritik Harchani who was my mentor, for helping me whenever I faced any problem in completing this project. I would also like to thank the organization admin and my primary mentor Carlos Fernandez Sanz for giving me this opportunity and also clearing my queries on time. I strongly intend to continue contributing to CCExtractor Development.

Special thanks to Abhilash Chandran who helped me in debugging and putting in effort and time, and Shivansh Saini for guiding me in applying and getting through the whole program. Open-source developers like them help in the growth of the community which as a result motivates us to contribute more. I would also like to acknowledge the help I got from other developers of the community, Pratik Baid and Aadi Bajpai, who were always available whenever needed.

Also, thanks to Google for this amazing program.