machine learning

Toadbook Hackathon Project

Discover how Metal Toad's team utilized AWS services and ML to create a simple social network platform at their latest hackathon. Explore the innovative infrastructure and application structure in this detailed post.

At every hackathon Metal Toad's heads disponibilizes three days for the Metal Toad's crew to brainstorm and execute projects, making the presentation in the last day. Working collegs build teams and start to work together to achive this chalange.

This year's first hackathon was based on ML (Machine Learning) projects. And our team came up with the idea of building a social network platform using ML (Machine Learning) to match users by their hobbies. The focus of ML (Machine Learning) in this project is help to better find correlations between the users and their hobbies.

And below we will tell more about it!

As the demand for intelligent and scalable web applications continues to grow, developers are increasingly turning to cloud services to meet these requirements. In this context, the combination of AWS CloudFront, API Gateway, and AWS Neptune emerges as a potent solution for building and scaling web applications with advanced machine learning capabilities.

This introduction sets the stage for understanding how these AWS services work together synergistically to empower developers to create intelligent applications that leverage machine learning algorithms to extract insights from highly connected data stored in Neptune's graph database. Through this integrated approach, developers can drive innovation, enhance user experiences, and propel business growth in today's rapidly evolving digital landscape.


This project was elaborated with the intent of showing how machine learning can be potentially used to find hidden correlations between user data and make more tuned correlations between them.
In our use case it was used to match and connect users according to their hobbies' interests, inside a social network platform.


  • Albert Marttinen - DevOps Engineer
  • André Pinto - Engineering Team Lead
  • Bruno Nascimento - DevOps Engineer
  • Guilherme Santos - Software Engineer
  • Kevin Ishii - Software Engineer


In this section we are going to view the Toadbook infrastructure diagram, AWS used resources and why we chose this stack.

Infrastructure Diagram


AWS Resources Description

  • AWS CloudFront is a CDN (Content Delivery Network) that speeds up distribution of static and dynamic web content worldwide.When content is requested by a user, the request is routed to the edge location that provides the lowest latency possible to reach best performance.
  • AWS S3 bucket is a storage resource that can be set to host static websites content too.
  • AWS API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.
  • AWS Lambda is an event-driven, serverless computing resource that makes it possible to run code without the need of provisioning or managing servers.
  • AWS Neptune database is a fast, reliable, fully managed and secure graph database easy to integrate with ML to help find hidden correlations in graphs with billions of relationships.

Why This Stack

The chosen stack, comprising CloudFront and API Gateway among other AWS resources, offers a robust infrastructure for efficiently delivering web content and managing APIs. CloudFront accelerates the distribution of both static and dynamic web content, enhancing user experience through reduced latency and improved performance. API Gateway simplifies API management tasks, enabling seamless creation, deployment, and monitoring of APIs with built-in security features. Lambda event-driven is designed to work with AWS services like API Gateway and Neptune, making it easy to execute code in response to HTTP requests through API Gateway or to react to database changes. Neptune supports powerful and expressive graph query languages such as Gremlin and SPARQL, enabling complex traversals and the ability to uncover insights from the interconnected data.


The application follows a microservices architecture, leveraging various AWS services to ensure scalability, reliability, and security. Each component of the application is designed to perform a specific function, allowing for easier development, deployment, and maintenance.

Used Languages

The application is developed using a combination of programming languages, including but not limited to JavaScript and Python. Each language is chosen based on its suitability for specific tasks within the application, ensuring optimal performance and maintainability.

Application Description

The Toadbook social network application is built on a sophisticated and scalable technology stack designed to offer a seamless user experience and efficient data management. At the core of the front-end development, we leverage Next.js, a powerful React framework that enables features such as server-side rendering and static site generation. This choice ensures fast load times and a dynamic user interface, essential for engaging social interactions online.

The front-end is hosted on Amazon S3 (Simple Storage Service), known for its robustness and high availability. S3 serves as an optimal hosting solution for our static assets, ensuring they are delivered quickly to users worldwide with minimal latency. This setup benefits from S3's scalability and reliability, providing a solid foundation for our application's user interface.

Interaction with the back-end is facilitated through AWS API Gateway, a fully managed service that allows us to create, publish, maintain, monitor, and secure APIs at any scale. This gateway acts as the entry point for the application's API calls, routing them to the appropriate services and ensuring a secure and efficient data flow between the front-end and back-end.

The back-end logic is executed in AWS Lambda, a serverless compute service that runs our Python code in response to HTTP requests via the API Gateway. This serverless architecture enables us to run code without provisioning or managing servers, focusing instead on building and deploying scalable application features. Lambda functions are triggered by API calls, executing business logic and communicating with our database.

Data storage and management are handled by Amazon Neptune, a fast, reliable, and fully managed graph database service optimized for storing billions of relationships and querying the graph with millisecond latency. Neptune supports highly connected data sets, making it an ideal choice for a social network application where relationships and interactions between users are complex and multifaceted.

Together, these components form a robust and scalable architecture that supports the dynamic and data-intensive nature of social networking. This setup not only ensures a smooth and responsive user experience but also provides the flexibility to evolve and grow the application as user needs and technologies change


In conclusion, the combination of AWS CloudFront, API Gateway, Lambda, and Neptune, integrated with ML, provides a robust, scalable, and cost-effective solution for processing, analyzing graph-based data and delivering content. This architecture allows for real-time insights into complex datasets, making it ideal for applications ranging from social networking to fraud detection and beyond.

By integrating machine learning models with AWS Neptune, developers can unlock new insights from their data and create intelligent applications that adapt to user behavior in real-time. With features like Neptune ML, which enables seamless integration of machine learning workflows with graph data, developers can train and deploy ML models directly within the database environment.

Moving forward, continuous optimization and refinement of machine learning algorithms will be essential to extract valuable insights and drive innovation in the application. By harnessing the power of AWS services like Neptune, developers can build scalable, intelligent applications that deliver exceptional user experiences and drive business growth.


Similar posts

Get notified on new marketing insights

Be the first to know about new B2B SaaS Marketing insights to build or refine your marketing function with the tools and knowledge of today’s industry.