Weekend Productivity Challenge: Momentum
Vision & What the App Does
Most productivity tools assume the hard part is organizing your tasks. For me, the hard part was always starting one. Momentum gives some motivation if you say what you have to do.
The app is deliberately tiny. You write a single to-do, "finish the quarterly report," "reply to the client," or "start the gym," and Momentum returns one short, punchy line of motivation aimed at that task. It's framed like a daily paper handing you your "dose of focus": one task in, one push out, and then you go start the block, hehe.
How You Built It
I started from a plain Vite + React + TypeScript front end and a single AWS Lambda function. The first version generated a generic motivational quote, but it felt hollow, a poster on a wall. The key decision was to make the message contextual: the front end now sends the user's task to the Lambda, and the model responds to that exact situation. That one change turned a novelty into something usable.
The biggest challenges were mundane but real. CORS was the first wall; the browser calling a Lambda function URL needed the right preflight handling, so I added explicit OPTIONS responses and CORS headers in the function.
The second was authentication: I initially assumed I'd need a Bedrock API key baked into the code (first time using bedrock and aws), but the cleaner and safer path was to let the Lambda's IAM execution role hold bedrock:InvokeModel permission, with no secrets in the codebase at all.
The third was reliability: model calls can fail, so I wrapped everything in a fallback that returns a local line, keeping the experience unbreakable.
AWS Services Used / Architecture Overview
- Amazon Bedrock (Amazon Nova Micro) generates the tailored motivational line via the Bedrock Converse API. Nova Micro is fast and inexpensive, ideal for short prompts and the free tier.
- AWS Lambda (Python) is the backend. It receives the task, builds the prompt, calls Bedrock, and returns clean JSON with CORS headers.
- Lambda Function URL a direct HTTPS endpoint for the front end, no API Gateway needed.
- IAM an execution role granting
bedrock:InvokeModel plus CloudWatch Logs.
- Vercel Hosting serves the built Vite frontend.
Flow:
Browser (Vite/React) → Lambda function URL → Lambda builds prompt → Amazon Bedrock (Nova Micro) → response returns to the browser and renders as your dose of focus.
What You Learned
I learned how approachable Bedrock is once you stop overthinking it. The Converse API is model-agnostic, so swapping models is a one-line change. The most valuable lesson was architectural humility: IAM roles beat hardcoded keys, and a good fallback matters more than a perfect model call. I also learned that the smallest possible product, done deliberately, can be more useful than a feature-heavy one.
Link to App or Repo
Loading article