AWS Builder Center

Building a Simple Real-Time To do App with AWS Blocks

I built a simple real-time Todo App to learn how AWS Blocks can be used to create a full-stack application. In this article, I’ll share how I used authentication, DynamoDB, APIs, optimistic locking, and real-time updates, along with what I learned while developing and testing the application locally.

Build a Real-Time To do App with AWS Blocks

While learning full-stack development, I wanted to understand how authentication, APIs, databases, and real-time updates work together. So, I built a simple Real-Time To do App using TypeScript and AWS Blocks.

What I Built

The app allows users to create an account, sign in, and manage their own todos. Users can create, edit, complete, and delete todos. I also added real-time updates, so changes made in one browser tab can appear in another tab without refreshing the page.
For authentication, I used AuthBasic, and for storing todo data, I used DistributedTable, which stores the data in DynamoDB. I also used Zod to validate the data before saving it.

How It Works

The basic flow is:
 User → Frontend → AWS Blocks API → Backend → DynamoDB 
When a user creates or updates a todo, the request goes to the backend. The backend checks the user's authenticated session before working with the data. This was important because I wanted each user to see and manage only their own todos.
I also added optimistic locking using a  version  field. This helped me understand how applications can handle two updates happening at nearly the same time without accidentally overwriting data.
Another interesting part was the real-time feature. When a todo changes, the update is broadcast to connected tabs, so the user doesn't need to refresh the page to see the latest changes.

Local Development

One thing I liked about AWS Blocks was being able to develop the application locally. I could test the main features without needing to connect to AWS every time I made a change.
I used:
npm run dev
npm run test:e2e
I also added tests for authentication, CRUD operations, update conflicts, and real-time functionality.

What I Learned

This project helped me understand how different parts of a full-stack application connect together. I got practical experience with authentication, user-specific data, DynamoDB, API operations, optimistic locking, and real-time updates.
The project is simple, but building it step by step helped me understand these concepts much better. AWS Blocks also made the development process easier because I could start locally, test the application, and then deploy it to AWS.
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