AWS Builder Center
How I Built a Serverless Lead Capture API with AWS Lambda for a Real Event

How I Built a Serverless Lead Capture API with AWS Lambda for a Real Event

I built a simple serverless backend with AWS Lambda, API Gateway, and DynamoDB to capture real leads for a startup idea presented at GO!RN. This article shares the architecture, the decisions behind it, and what I learned from building a real-world solution with almost no infrastructure overhead.

Software Engineer | AWS Certified
Sometimes the best way to learn cloud architecture is not by following a tutorial, but by having a real problem that needs to be solved.
That is exactly what happened when my friends and I participated in Conexão Empreendedora, an entrepreneurship program where we received mentoring on how to validate and launch our first application.
Our idea was Dinly (dinly.tech), a personal finance application designed to combine gamification and artificial intelligence to help young people better organize their finances and work toward their financial goals.
At the end of the program, we had the opportunity to present our idea at GO!RN, one of the biggest entrepreneurship and innovation events in Rio Grande do Norte, Brazil.
But before the presentation, I had one question:
How could we know if people were actually interested in our idea?
My solution was simple: build a landing page where visitors could leave their email addresses if they wanted to learn more about Dinly.
The frontend was straightforward.
The backend was where things got interesting.

The challenge

For a simple lead capture form, I did not want to maintain a traditional backend server.
Creating and managing an EC2 instance would have introduced infrastructure that was unnecessary for such a small application. I also did not want to create and maintain a relational database instance just to store email addresses.
The application only needed to do two things:
  1. Receive an email address from the landing page.
  1. Store it so we could access the leads later.
This looked like a perfect use case for a serverless architecture.

Designing the architecture

I decided to build the backend using three AWS services:
  • Amazon API Gateway for exposing the HTTP API.
  • AWS Lambda for processing requests.
  • Amazon DynamoDB for storing the leads.
The architecture was essentially:
 React frontend → API Gateway → AWS Lambda → DynamoDB 
The frontend was built with React and deployed on Vercel, while AWS handled the entire backend.
One of my favorite parts about this architecture was that there was no server for me to provision, configure, patch, or maintain.
For such a small application, that was exactly what I wanted.

Using Lambda as the backend

The application logic was implemented as an AWS Lambda function using Node.js.
Instead of creating a traditional Node.js server that needed to stay online continuously, Lambda allowed the backend code to execute only when an HTTP request reached the API.
That meant I could focus almost entirely on the application logic.
When someone submitted their email address through the landing page, the request followed this flow:
 Landing Page → POST /lead → API Gateway → Lambda → DynamoDB 
The Lambda function received the request, processed the lead information, and stored it in DynamoDB.
No server deployment was required.

Why DynamoDB was a great fit

For this project, I only needed to store a relatively simple dataset: information about people interested in the application.
Using a relational database would have added unnecessary complexity.
I would have needed to think about things such as:
  • database instances;
  • connections;
  • credentials;
  • networking;
  • availability;
  • capacity.
Instead, I used Amazon DynamoDB.
Because DynamoDB is a managed NoSQL database, I could create a table and start persisting leads without provisioning a database server.
For this type of workload, the simplicity was extremely useful.
It also helped keep the architecture small:
 API Gateway → Lambda → DynamoDB 
Three managed services were enough to create the entire backend.

Exposing the API with API Gateway

To connect the React frontend to the backend, I used Amazon API Gateway.
I created two REST endpoints:

POST /lead

Used by the landing page to register a new lead.
When someone entered their email address, the frontend sent the data to this endpoint.
API Gateway forwarded the request to the Lambda function, which then stored the information in DynamoDB.

GET /lead

Used to retrieve the leads that had already been registered.
This gave me a very simple API:
POST /lead
GET /lead
Despite its simplicity, this architecture gave the application everything it needed: an HTTP API, backend logic, and persistent storage.

The complete architecture

The final solution looked like this:
Dinly Serverless Architecture

What I liked the most was how little infrastructure I actually had to manage.
There was no backend server running 24/7 and no database instance to maintain.
For the traffic generated by our landing page, the AWS usage remained within the free usage available to us, which meant we were able to run the project without infrastructure cost.

Connecting everything to the frontend

With the API running, I connected the endpoints to our React landing page.
From the user's perspective, the experience was extremely simple:
  1. Visit the Dinly landing page.
  1. Learn about the idea.
  1. Enter an email address.
  1. Submit the form.
Behind that small interaction, however, the request was moving through a complete cloud architecture:
 React → API Gateway → Lambda → DynamoDB 
This was one of the things I found most interesting about the project.
A relatively small amount of infrastructure was enough to create a real backend that could be accessed publicly and used during an actual event.

The result: around 40 real leads

When we presented Dinly at GO!RN, people interested in the project could access our landing page and register their emails.
By the end of the event, we had collected around 40 leads from people interested in our idea.
For a simple landing page created to validate an early-stage project, that result was extremely valuable to us.
But from an engineering perspective, the experience was valuable for another reason.
It showed me how serverless technologies can be used to solve real problems without automatically reaching for traditional infrastructure.

What I learned

Before building this project, it would have been easy to think:
"I need a backend, so I need a server."
But that was not actually true.
What I needed was:
  • somewhere to receive HTTP requests;
  • somewhere to execute application logic;
  • somewhere to persist data.
API Gateway, Lambda, and DynamoDB provided exactly those capabilities without requiring me to manage servers directly.
The experience reinforced an important lesson for me:
Architecture does not need to be complex to be useful.
For this project, using EC2, containers, or a traditional relational database would have worked, but it would also have introduced infrastructure that our use case simply did not require.
Serverless allowed me to build what we needed quickly and focus on validating the product rather than operating infrastructure.

Final thoughts

This was a relatively small project, but it became one of my favorite examples of why I enjoy working with AWS.
With only API Gateway, Lambda, and DynamoDB, I was able to create a complete backend API, connect it to a React application, persist real user data, and use the solution during a real entrepreneurship event.
And the most important result was not the architecture itself.
It was that the architecture enabled us to test an idea with real people.
We walked into the event with an application concept.
We left with around 40 people who wanted to hear more about it.
For me, that is where cloud engineering becomes especially interesting: when a small technical solution helps turn an idea into something that can actually be tested in the real world.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article