Skip to content

Commit

Permalink
Merge pull request #458 from mbeps/development
Browse files Browse the repository at this point in the history
Blog and Features for Symphony Bots
  • Loading branch information
mbeps authored Sep 16, 2024
2 parents ccda80b + 07e21ae commit a22d371
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
57 changes: 57 additions & 0 deletions public/projects/symphony-translate-bot/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
- [**Project Reflection: Translate Bot**](#project-reflection-translate-bot)
- [Why This Bot Was Built](#why-this-bot-was-built)
- [Replacing the Old Bot](#replacing-the-old-bot)
- [Issues with the Old Bot](#issues-with-the-old-bot)
- [Advantages of the New Bot](#advantages-of-the-new-bot)
- [Asynchronous Functionality and Scalability](#asynchronous-functionality-and-scalability)
- [Faster Translations and More Languages](#faster-translations-and-more-languages)
- [Challenges](#challenges)
- [Making the Bot Asynchronous](#making-the-bot-asynchronous)
- [Frontend Asynchronous Support](#frontend-asynchronous-support)
- [Backend Asynchronous Development](#backend-asynchronous-development)
- [Learning Asynchronous Programming in Spring Boot](#learning-asynchronous-programming-in-spring-boot)
- [Achieving Full Asynchrony](#achieving-full-asynchrony)
- [Conclusion](#conclusion)


# **Project Reflection: Translate Bot**
This report reflects on the development of the Symphony Translate Bot, a tool designed to make communication easier for people who speak different languages. Built using the Symphony BDK and Spring Boot 3, the bot was created to replace an older, less reliable version. The older bot, which used a custom SDK, was prone to breaking, required frequent maintenance, and lacked proper support from Symphony. The new bot improves on these issues by offering a more stable, modern codebase and adding many new features over the old bot. It also provides faster translation times and better support for users across different chat formats, greatly enhancing user experience and business efficiency.

## Why This Bot Was Built

### Replacing the Old Bot
The new Symphony Translate Bot was built to replace an existing bot that also handled translations. The old bot was not built using the Symphony BDK but a custom legacy SDK. This caused several problems that made it unreliable and difficult to maintain.

### Issues with the Old Bot
The old bot frequently broke down and required constant maintenance to stay operational. Because it wasn’t built with the Symphony BDK, we couldn’t get support from Symphony. Additionally, the code was complex and difficult to work with, making it challenging to add new features or make improvements.

### Advantages of the New Bot
The new bot, built using the Symphony BDK, solved these issues. It had a cleaner and more modern codebase, which made it much more reliable and easier to maintain. With this new framework, we could get full support from Symphony, speeding up development time and reducing the need for constant repairs.

### Asynchronous Functionality and Scalability
One major improvement in the new bot was its ability to handle tasks asynchronously. The old bot processed translation requests one by one, meaning only one person could use it at a time. The new bot could manage multiple requests simultaneously, allowing several users to access translations at once. It could also be used in chat rooms, not just in one-on-one conversations, which made it more flexible for different communication needs.

### Faster Translations and More Languages
The new bot could translate between multiple languages, similar to Google Translate, eliminating the need for separate bots for different languages. It was also much faster, with translation times reduced from 40 seconds to just 4 seconds in some cases. This significantly improved both user and developer experience, while also increasing efficiency for the business.

## Challenges

### Making the Bot Asynchronous
The main challenge in developing the new bot was making it fully asynchronous. Both the Symphony frontend and the translation service needed to work asynchronously to handle multiple requests at the same time. The old bot handled tasks sequentially, which limited the number of users that could interact with it simultaneously.

### Frontend Asynchronous Support
Thanks to the support we could now get from Symphony, making the frontend asynchronous was relatively straightforward. They provided guidance on how to adjust the frontend to process requests asynchronously. However, this left the backend needing to be made asynchronous as well, which proved to be much more difficult.

### Backend Asynchronous Development
The backend required more effort to make asynchronous. The whole application needed to be async, starting from the entry point of the bot, which was resolved fairly quickly. Once the entry point was taken care of, the translation service itself also needed to be made asynchronous. This was a more complex task, as it required restructuring how requests were processed on the backend.

### Learning Asynchronous Programming in Spring Boot
To implement this, I needed to learn how asynchronous programming works in Spring Boot. I spent time watching tutorials, reading documentation, and studying best practices for async development in Spring Boot. After gaining a better understanding, I made another attempt to convert the translation service to be fully asynchronous.

### Achieving Full Asynchrony
After some trial and error, it became clear that the backend translation service was now working asynchronously. This meant the entire stack—from the frontend to the backend—was asynchronous, allowing the bot to handle more requests at once and significantly improving its performance and scalability.

## Conclusion

Overall, the new bot was a significant upgrade over the old one it replaced. Users were much more satisfied with its performance, and the business benefited from reduced maintenance time. This allowed more focus on adding value elsewhere. Additionally, the bot set a strong foundation for future bots to be built using a simpler, more efficient codebase.

8 changes: 8 additions & 0 deletions public/projects/symphony-translate-bot/features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## **New Features Compared to Old Bot**
- Translating messages in rooms
- Selecting between multiple languages using form
- Higher capacity translations
- Rich text

## **Existing Features**
- Translating messages in direct chats
54 changes: 54 additions & 0 deletions public/projects/symphony-webhook-bot/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
- [**Project Reflection: Webhooks Bot**](#project-reflection-webhooks-bot)
- [Why This Bot Was Built](#why-this-bot-was-built)
- [Real-Time Data Updates](#real-time-data-updates)
- [Automating Workflows](#automating-workflows)
- [System Integration](#system-integration)
- [Security Monitoring](#security-monitoring)
- [Replacing Symphony’s Old Solution](#replacing-symphonys-old-solution)
- [Challenges](#challenges)
- [Transition from Legacy SDK to BDK](#transition-from-legacy-sdk-to-bdk)
- [Learning the Symphony BDK](#learning-the-symphony-bdk)
- [Tight Deadline Before GCP Transition](#tight-deadline-before-gcp-transition)
- [Maintaining Functionality](#maintaining-functionality)
- [Conclusion](#conclusion)


# **Project Reflection: Webhooks Bot**

This report reflects on the development of the Webhooks Bot, a tool designed to listen to events via an endpoint and send messages to Symphony chats, whether in direct messages or chat rooms. Built using the Symphony BDK and Spring Boot, the bot was created to provide real-time updates and automate workflows for various teams. It replaced an older solution that was removed when Symphony transitioned from AWS to GCP. This project not only restored vital functionality but also set the foundation for future bots, including the translation bot, by introducing a more modern and reliable codebase.

## Why This Bot Was Built

### Real-Time Data Updates
The primary reason for building the Webhooks Bot was to enable real-time data updates. Webhooks allow for instant notifications when changes or events occur, ensuring that teams have access to the most current information. This reduces the delay in receiving updates and keeps teams informed.

### Automating Workflows
Another key benefit of webhooks is their ability to automate workflows. By triggering specific actions when events occur, manual intervention is reduced. This makes processes more efficient and allows teams to focus on more important tasks.

### System Integration
Webhooks are also effective in integrating various internal systems. They allow data to flow smoothly between different departments, ensuring that information is shared without disruptions. This seamless connection between systems helps improve overall operations.

### Security Monitoring
Webhooks provide enhanced security monitoring as well. They can send instant alerts when suspicious activities or security breaches are detected, enabling teams to respond quickly to potential threats.

### Replacing Symphony’s Old Solution
Symphony previously had a Webhooks solution, but it was removed during their transition from AWS to GCP. Some teams depended on this functionality to receive updates about the systems they were monitoring. When Symphony transitioned, they asked us to build a headless bot to handle this listening and notification functionality. This new bot restored the essential functionality for these teams, ensuring they could continue receiving real-time updates without disruption.

## Challenges

### Transition from Legacy SDK to BDK
One of the main challenges was moving away from the old legacy SDK, which we had been using for all previous bots. The legacy SDK did not support headless bots, which made it unsuitable for building the Webhooks Bot. We had to implement this new bot using Symphony's official BDK, a tool we had no prior experience with.

### Learning the Symphony BDK
Since the BDK was new to us, I had to learn it from scratch. This required understanding a new framework and adjusting our approach, as we could no longer rely on the SDK we had used for a long time. This learning process added complexity to the project, especially with the tight schedule we were working under.

### Tight Deadline Before GCP Transition
The project had to be completed before Symphony's transition from AWS to GCP. This added pressure to the development process, as there was little time to learn the BDK, implement the bot, and ensure it worked as expected. Despite this, we were able to complete the Webhooks Bot on time.

### Maintaining Functionality
The final challenge was ensuring that the new bot offered the same functionality as the old solution. We needed to create a one-to-one replacement that provided real-time updates without losing any features. Successfully doing this allowed us to transition to GCP, save costs, and retain full functionality.

## Conclusion

This experience showed that Symphony's BDK is a significant improvement over the legacy SDK we had been using. The BDK was easier to work with, required less maintenance, and allowed for faster development. It also provided a more reliable codebase with direct support from Symphony. Building the Webhooks Bot set the foundation for future bots, including the translation bot, by proving the effectiveness of this modern framework.

0 comments on commit a22d371

Please sign in to comment.