
Weekend Productivity Challenge: HabStrack
This weekend I built HabStrack! It uses Bedrock (Claude 4.5 Haiku), Lambda, and DynamoDB to smartly stack your daily tasks onto your existing habit anchors.
Vision & What the App Does
Building consistent habits is a fundamental pillar of personal productivity, yet many individuals fail because they rely entirely on fleeting motivation rather than behavioral design. In Atomic Habits, James Clear popularized "habit stacking"—a psychological strategy where you anchor a desired new behavior directly to an established, automatic daily routine (e.g., "After I pour my morning coffee, I will write down three daily goals"). The friction of starting a new habit drops dramatically because your brain already has a well-worn neural pathway for the anchor habit.
However, many people struggle to spot the ideal anchors within their chaotic routines, leading to poorly paired tasks that fall apart under stress.
HabStrack is an AI-powered productivity application designed to solve this exact problem. It transitions a traditional, flat daily to-do list into an optimized, execution-friendly behavioral roadmap.
- The Onboarding Journey: When a user first enters HabStrack, they complete a targeted questionnaire mapping their daily profile. This includes their daily energy peak (chronotype), hobbies, existing automatic habits (anchors), and targeted habits they want to adopt.

- Dynamic Task Management: The application features an interactive calendar interface where users can organize tasks for the current day or map out future to-dos.

- AI-Assisted Stacking: With the click of a button, HabStrack collects the user's raw daily checklist and processes it alongside their baseline profile. It leverages an advanced LLM to organize individual tasks into clear, contextual "Habit Stacks" tied directly to their natural anchors, complete with a brief psychological justification explaining why the pairing works.

- Fulfillment Tracking: Users cross off completed tasks in a reactive checklist dashboard, turning behavioral theory into a trackable daily metric.

How I Built It
The development process was centered on achieving high execution speed and extreme resource efficiency over the course of a single weekend. I opted for a decoupled full-stack model, building a light, responsive frontend connected to a completely serverless infrastructure.
Key Decisions
- Pure Serverless Python Backend: Instead of spinning up a traditional web framework like FastAPI, I chose a pure Python implementation deployed on AWS Lambda. To bypass the time-consuming process of setting up and configuring an AWS API Gateway, I utilized Lambda Function URLs configured for public access. This allowed me to expose my endpoints directly to the frontend with zero gateway overhead.
- Object-Oriented Database Mapping: I utilized
boto3.resourcerather than the low-levelboto3.clientto interact with the database. This choice eliminated data serialization boilerplate, abstracting typed descriptors so that standard Python dictionaries could be read and written instantly.
- Native Cloud Intelligence: Rather than routing data outside of my cloud environment via external APIs, I committed to keeping the entire data flow native to AWS by implementing Amazon Bedrock.
Challenges I Encountered and Overcame
- The Double-CORS Conflict Block: Upon initial integration, the browser blocked frontend fetch requests to the Lambda Function URL due to a CORS violation. I discovered that because I had turned on the native CORS configuration checkbox in the AWS Lambda console while also explicitly returning CORS headers in my Python code's response dictionary, the headers were duplicating. I resolved this by disabling the infrastructure-level CORS configuration in the AWS Console, leaving my Python code with sole ownership over the response headers.
- The 3-Second Execution Timeout: When executing the AI stacking feature, the backend consistently crashed with a
Status: timeoutlog error. AWS defaults new Lambda functions to a 3-second execution limit. Because network round-trips to an external AI inference engine frequently take between 2 to 5 seconds to process heavy text instructions, the function was getting cut off mid-transit. I resolved this by adjusting the function's General Configuration settings—increasing the timeout limit to 30 seconds and bumping allocated memory to 512 MB to give the Python environment plenty of breathing room.
- Amazon Bedrock Model Validation Exceptions: While attempting to call newer Anthropic Claude models natively via
boto3on-demand throughput, the system threw aValidationException. I learned that AWS limits direct on-demand invocation of specific cutting-edge models to ensure high availability. To overcome this, I researched cross-region capabilities and discovered that by passing an inference profile ARN (prefixed withus.anthropic...) into themodelIdparameter instead of the generic base model ID, AWS could dynamically optimize the request across regions. This bypassed the error and delivered blazing-fast, serverless inferences.
AWS Services Used & Architecture Overview
HabStrack runs an architecture entirely contained within the AWS Free Tier.
plaintext
[ React 18 SPA + Tailwind UI ] (Hosted on AWS Amplify)│▼ (Secure HTTPS Lambda Function URL)[ AWS Lambda Router ] ── (Inference Profile ARN Request) ──► [ Amazon Bedrock (Claude 4.5 Haiku) ]│▼ (Single-Table Key Partition Queries)[ Amazon DynamoDB ]
- AWS Amplify: Used for hosting and deploying our React 18 single-page application directly from a public GitHub repository, utilizing continuous deployment workflows.
- AWS Lambda: Serves as the central backend computing node. It acts as an API monolith router, parsing incoming request paths (e.g.,
/user/profile,/todos,/todos/stack) and routing them to the data layer.
- Amazon DynamoDB: A fully serverless, NoSQL database utilizing a highly scannable Single-Table Design. User configurations map to a static partition key template (
USER#<userId>/PROFILE), while tasks use a specific temporal sort key layout (USER#<userId>/TODO#YYYY-MM-DD#<todoId>). This allows the calendar backend to fetch a user's entire checklist for a specific calendar date with a single query operation.

- Amazon Bedrock (Anthropic Claude 4.5 Haiku): Seamlessly executes the core behavior-science engine. By leveraging IAM policies to attach
AmazonBedrockFullAccessto the Lambda runtime, the function communicates securely with modern foundation models without requiring hardcoded third-party API tokens.
What I Learned
This challenge provided a deep dive into building highly practical, user-facing AI applications under constraints.
- Cross-Region Inference Routing: I gained firsthand experience navigating the scale of enterprise cloud infrastructure. Learning how to look up and leverage an AWS Inference Profile ARN taught me how AWS handles traffic load management across multiple data centers dynamically while keeping execution serverless and fast.
- The Power of Single-Table Design: I learned how to structure a single DynamoDB table to serve radically different access patterns. Designing composite partition and sort keys to fetch calendar data relative to precise ISO dates proved how powerful NoSQL can be when structured correctly.
- Infrastructure Simplification: Working with Lambda Function URLs taught me that full-scale API Gateways aren't always necessary for micro-projects or weekend prototypes. Bypassing that layer allowed me to focus heavily on product logic and user experience rather than cloud infrastructure management.

Link to App or Repo
- Live Application URL: HabStrack Live App
- Public Source Code Repository: HabStrack Public GitHub Repo
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article