Work Product: Google Summer of Code 2021 with Postman

Arjun Garg
5 min readAug 23, 2021

--

I spent the summer of ’21 working on the project App-Relations-Discovery with AsyncAPI Initiative at Postman under Google Summer of Code’21.

Let me first brief you a little bit about the AsyncAPI Initiative.

AsyncAPI Initiative aims to set an industry standard for messaging APIs by providing a set of open source tools and features to improve the current state, by easily building and maintaining your event-driven architecture in the world of APIs so that it can be referred to as a single source of truth.

Project Description 📜

Title

App Relations Discovery

Synopsis

App-Relations-Discovery aka cupid aims to be a library capable of abstracting and analyzing relationships between a set of AsyncAPI documents to get information of applications described by those files and visualizing the architecture by generating output formats following mermaid, plantUML, and React Flow syntax.

Mentors ❤️

I feel fortunate to have Lukasz Gornicki as my mentor and want to thank Maciej Urbańczyk, not only for their comprehensive and outstanding reviews but most importantly due to their unique ways of explaining an underlying logic. You have helped and supported me to become a better software developer and a passionate open-source contributor.

Community

I am blessed to get such great support from the network we have in AsyncAPI which always boosted me to work harder and to contribute more. Everyone was encouraged to put out their thoughts and suggestions not only on the project I am working on but in the community discussions as well which made it more engaging and brought me closer to the community.

My mentor also gave me the liberty to drive the project in a way that fits best according to me and learn from it. We made good use of the time in the community bonding period and made significant progress on preliminary tasks which helped to set a clear vision and the faster development of the project.

Repository 📂

asyncapi/app-relations-discovery

Features:

  1. Relationships Identification: This library is responsible for identifying relations between the AsyncAPI documents to get information about applications described by those files:
  • If services subscribe or publish to the same channel.
  • If one service subscribes to a channel that the other one publishes to.
  • If there are services that are subscribed to channels that no one publishes to.
  1. Additional Data: Along with the relationships, extracting metadata.including such as messages, Schemas, etc.
  2. Extensibility: This library is extendable in a way that one can provide an additional plugin for it, so the output would not be our custom format but any diagram syntax.

How will this project benefit the community?

  • Being an independent library, it can be reused by developers in their tools. For example, they can visualize entire architecture and data flows.
  • This library would help to envision the robustness of the application being delivered.
  • It will help to determine how the system architecture will get affected if one of the services gets removed/failed and its impact on other services.

Technical Details

This library takes AsyncAPI files as an array input for which the user wants to discover the relations between them. It then validates and parses the given array of AsyncAPI files and generates the output in desired passed syntax. In the process, for every different server, it assigns a slug having the server’s URL and protocol and then maps channels with the same server. Following, it maps the service information with the channel’s name as per if the service is subscribing/publishing to a given channel. In the sub/pub Map of default output syntax, it provides service name and the metadata of the service including but not limited to description, payload, headers, bindings, extensions.

Default Output Syntax

Default Output syntax

👨🏾‍💻 Work Done 🚀

feat: initial structure+first approach (#3)

chore: implement function to generate mermaid class diagram (#7)

chore: add metadata to default output syntax (#10)

feat: pivot mermaid output from classDiagram to flowchart (#11)

feat: support plantUML classDiagram syntax (#13)

feat: change output channel to pure JSON and add unit tests (#20)

feat: add support for reactFlow (#24)

docs: update Readme and add the script to generate API docs

Currently working on integrating the library in the AsyncAPI CLI. For more details check this issue.

Sample Output generated based on Flight Notification Service:

Mermaid Flowchart Syntax

mermaid flowchart syntax generated by cupid for FlightService architecture
Visualization for FlightService architecture in mermaid live editor

PlantUML classDiagram Syntax

Visualization for FlightService architecture in plantUML live editor
PlantUML classDiagram syntax generated by cupid for FlightService architecture

React Flow Nodes

Future Development Opportunities

  • Supporting more output formats syntax.
  • Integrating it into AsyncAPI studio for making it more accessible without having users manually code it manually.
  • After integrating reactFlow in the studio, allow the user to create relationship flows manually and reverse engineer it to get the AsyncAPI specification files.

Closing Notes 👨🏾‍🎓

I would like to say a huge thanks to Postman and AsyncAPI Organisation. All of this would never have been possible without the support of the AsyncAPI community, all of the mentors have been really helpful and supportive. They provided super fast reviews, were always just a ping away and were super supportive.

With the AsyncAPI community growing continuously, I feel responsible for the projects I contribute to. I would like to work on the implementation of future development opportunities and help to maintain the project by helping other people navigate around and contribute to this project. Also, I would love to contribute to other projects of the AsyncAPI organization and help them turn their vision into a reality.

I would also like to invite all of you to join the AsyncAPI revolution and help in transforming the future of event-driven architecture.

AsyncAPI Slack Workspace

--

--