#Dev Log#Medication Promise#Alexa#AWS#Caregiving
Building Medication Promise Without Pretending a Home Prototype Was a Product
The engineering story of turning a working Alexa medication log into an honestly scoped single-household MVP: wrong AWS regions, a failed Amplify deployment, reminder safety, and the limits of automation.
The first version of Medication Promise did something useful in a real home. At five times each day, Alexa announced a medication reminder. After taking it, a family member could say that the morning, noon, evening, 8 p.m., or 9 p.m. medicine had been taken. The same record appeared in a small web app.
That is a better starting point than a slide deck. It is also a dangerous point at which to start calling something a product.
The prototype knew one household, one medication, one schedule, and one DynamoDB partition. It worked because the assumptions in the code matched the home around it. Our recent development work was not mainly about adding features. It was about discovering every hidden assumption, preserving what already worked, and refusing to make the system sound safer or more general than it was.
This is the engineering log of that transition.
Medication Promise is an in-development logging and household support tool, not a medical device. It does not decide whether a medicine should be taken or replace instructions from a doctor or pharmacist.
The hardest kind of legacy system: one that is already helping someone
Greenfield projects let you change the data model, rename an intent, or clear a test table without much emotional weight. Medication Promise was different. The DynamoDB table already contained real records, and the Alexa routine had already become part of a household’s day.
That changed the standard for every modification. A technically cleaner rewrite was not automatically a better choice if it removed the reminders people depended on. A generic public-facing message was not automatically better if it silently broke the familiar home workflow. Even a simulation could be destructive: testing the reminder-setup intent would delete the skill’s existing reminders before recreating them.
So the first job was reconstruction. We traced the Alexa skill, Lambda function, DynamoDB table, web API, deployment history, and interaction model as one system. We wrote session notes as we went because several failures came from facts that were easy to forget and expensive to rediscover.
The most important fact was surprisingly mundane: the resources did not all live where we first thought they did.
The region that looked right was wrong
The household is in Japan, so ap-northeast-1 looked like the natural AWS region. Some defaults in the project reflected that assumption. The actual medication table and Alexa Lambda, however, were in us-east-1.
The result was the classic misleading failure: the application said the table did not exist. The table existed, contained data, and was healthy. We were simply asking the wrong region.
The final web architecture deliberately spans both regions. The Next.js application runs near its users in Tokyo, while its server-side code reads the existing DynamoDB table in Northern Virginia through an explicit DYNAMODB_REGION=us-east-1 setting. Keeping the region explicit is less elegant than pretending the infrastructure is uniform, but it preserves the data that already exists.
We found a second AWS authentication trap during the same migration. The web code manually constructed credentials from an access key and secret. That can work on a developer laptop, but a Lambda execution role also uses a session token. By supplying only two-thirds of the credentials, the application bypassed the AWS SDK’s working default credential chain and produced UnrecognizedClientException.
The fix was deletion, not addition: stop manually injecting credentials and let the SDK use the execution environment’s complete temporary credentials. This is the sort of bug that feels like an IAM-policy problem until you inspect what the application is actually sending.
When the preferred hosting service did not support the framework
The web application uses Next.js 16. Our first hosting path was AWS Amplify because it offered the shortest route from repository to managed deployment. The build completed, but Amplify’s managed SSR pipeline did not recognize the framework version correctly and failed to produce the deployment manifest it expected.
We could have downgraded Next.js to fit the host. Instead, we changed the host to fit the application.
The working deployment uses OpenNext and SST to provision CloudFront, Lambda, and S3. That gave us a little more infrastructure to understand, but it kept the server-rendered pages and API routes intact. It also made the security boundary visible: the server Lambda received only the DynamoDB permissions and environment settings it needed.
The migration produced its own sequence of small corrections: excluding generated SST files from lint and TypeScript checks, separating the web deployment permissions from the Alexa deployment role, and preserving a clean path for local development. Eventually the anonymous CloudFront hostname became kusuri.veai.jp, while the product introduction remains under the main veai.jp site.
That domain split is intentional. The public site can explain the work and its limitations. The application can keep its own authentication cookies, deployment lifecycle, and access controls without changing the main site’s CloudFront behavior.
A household password is a gate, not an account system
Before this work, knowing the web URL was effectively enough to reach the records. For a household prototype containing medication history, that was not an acceptable public boundary.
We added a shared access-code gate for the current household. A successful login creates an HMAC-signed, HTTP-only, Secure, SameSite Strict cookie. Protected pages redirect to login, and every record and settings API checks authentication independently. We added same-origin checks, input validation, conditional updates, length limits, and explicit client error handling. The site also sends noindex metadata and blocks crawlers.
These changes made the current deployment safer. They did not make it multi-user.
All web and Alexa records still resolve to one fixed household partition. A shared code cannot isolate one family from another, recover individual accounts, revoke one person’s access, or prove that a request belongs to a particular Alexa user. Calling this public authentication would be inaccurate.
We therefore wrote the limitation into the architecture and the product language: this is a single-household MVP. A wider beta requires per-household identities, separated data partitions, Alexa account linking, cross-household access tests, and a deletion and recovery process. The honest label is part of the implementation, not a marketing footnote.
The medication name was not just a configuration value
The original Alexa reminders named levodopa directly and used wording close to an instruction to take it. That made sense inside the home where the medication and schedule were already known. It was wrong as a default for anyone else.
We removed the hard-coded name and changed the reminder language from a medication instruction to a scheduled-time notice: check the medication plan, then use the skill to record what happened. For the existing household, the familiar medication name can still be configured without becoming a universal default.
Next we added a protected settings screen for the medication name and five reminder times. The settings are stored beside the household’s records in DynamoDB. When the user asks Alexa to set reminders, the Lambda reads the current settings, removes reminders previously created by the skill, and creates the new daily schedule.
This sounds like a normal settings feature. It exposed an important product distinction: saving a time on the web does not magically update a reminder already registered with Alexa. The user must ask the skill to recreate the reminders. We chose to make that step explicit rather than imply synchronization that does not exist.
Alexa automation was real, but not quite the automation in the instructions
The interaction model was initially one of the remaining manual steps. The obvious plan was to configure the Alexa Skills Kit CLI once and then run a targeted deploy command on every change.
Authentication and skill discovery worked. The exact command we expected did not: the installed ASK CLI version did not support the documented-looking deploy --target interaction-model workflow we had planned around.
The lower-level SMAPI commands did work. We fetched the current Japanese model, compared it with the repository copy, pushed the model with set-interaction-model, waited for each build stage to succeed, updated the manifest permissions, and ran a non-destructive launch simulation against the real skill.
That distinction matters. “The developer tool can automate Alexa” is true, but only after identifying which layer actually works for the installed version. It can update models, manifests, and Lambda code. It cannot grant reminder permission on a person’s Echo, hear what a physical device says in a room, or safely infer whether deleting and recreating live reminders is acceptable.
Our automated tests cover configuration parsing, default safety language, reminder behavior, API authentication, validation, and settings conversion. Our production smoke tests verify redirects, unauthorized responses, authenticated settings reads and writes, and a launch request that does not change data. We intentionally left the final reminder test to a human with the Echo because the test itself changes household state.
What “MVP” means now
Medication Promise now has a working voice path and a working web path:
- Alexa can record five medication timings into the same table the web app reads.
- Alexa can create daily reminders from household settings.
- The web app can record, edit, delete, review, and export monthly PDF records.
- The household can change the medication label and reminder schedule from a protected settings screen.
- The application is deployed at its own domain behind a private access gate.
It is an MVP for one household because that is the scope we have actually verified. It is not yet a service for arbitrary households.
The next engineering milestone is not another visible feature. It is identity: shared VEAI accounts, per-household data boundaries, and a trustworthy link between an Alexa user and the correct household. After that comes an invitation-only beta, not an immediate public launch.
The lesson from this project is not that prototypes are bad. The home prototype taught us the right interaction faster than a product specification could have: reminders at familiar times, a short phrase after taking medicine, and a record the family can see later. The mistake would have been to confuse evidence that one workflow is valuable with evidence that the system is ready for everyone.
Good care software needs both kinds of work: the small, human observation that starts the project, and the less glamorous engineering that makes its boundaries true.
Medication Promise is an open development project from VEAI LAB. Its source, tests, and deployment notes are available in the public repository. The implementation combines Alexa Skills Kit, AWS Lambda, DynamoDB, Next.js, OpenNext, SST, CloudFront, and S3. If you are building a voice interface around real household routines, the most useful review question may be the simplest one: which assumptions are still living only in your house?

Thanks for reading — built with care, for caregivers.