We’ve thoroughly studied the front end, back end, and AWS architecture for Thoughtful Automation — a platform that helps businesses automate their processes. We had to learn what wasn’t working correctly and implement all possible improvements.
TA automates repetitive clicks so people can shift their focus to value-adding activities. For example, a team member needs to draw up approximately 120 invoices a week. It can take a person 2-3 days to do. And with TA, the company can automate this work and have it done within a few hours without any manual labor, saving them money and time of their employees.
Learn more about them here: https://www.thoughtfulautomation.com/
Their backend was built as an express server stored in 1 lambda, which caused many problems in runtime, so we decided autoto rewrite it from scratch, separating logic and lambdas for different processes. The same fate came upon the frontend and AWS architecture as they’ve failed to meet the client’s requirements.
So, as we’ve decided to completely re-do the backend, we chose to do it with Typescript to ensure backend work stability with a type-safe approach. We’ve also added VPC configurations for databases to improve the overall security and rebuilt the Postgres database to raise data manipulation speed.
The frontend was initially build using JavaScript, so we’ve also decided to rewrite it with Typescript to improve stability with the type-safe approach.
For the AWS architecture, we’ve used serverless for better CI/CD managing. So it was re-done by sticking to the microservices best practices and divided into separate AWS Lambdas parts. And we’ve also rebuilt rhe serverless configuration in a way that ensures errorless deployment.
We’ve used AWS Lambdas to get updates from the bots every second and updated database logs for it. We’re planning to add WebSockets API Gateway to make it even “more real-time.”
For the scheduling job, we were considering different approaches and decided to use AWS Step Functions, which can invoke functions at some specific time in the future. It helped us make scheduling as accurate as possible.
For this task, the most critical moments were database structure and indexing. So we’ve designed the database structure so that any incoming request, instead of iterating through all data, used only the needed piece of data.
After our refactoring phase, the TA execution speed has improved dramatically. Backend response time and the frontend loading time decreased to <50 ms and <2 seconds for the main info pages for the first load. Also, we’ve fixed the AWS Lambda cold starts to handle any backend request in less than a second.
Moreover, we’ve made sure to improve security protection by:
Adding VPC configurations for databases
Creating better Auth handling
Restructuring the database and credentials storage
After creating the additional features, TA’s services have raised in value. Now it’s possible to navigate through a large number of bot logs, job executions, and so on. Also, we‘ve addressed all the primary needs of their users, which allowed our client to promote their product as a highly effective service.