DEV Community

Humayoun Baig
Humayoun Baig

Posted on

Marigold: Hacktoberfest Weekend Challenge

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

I built Marigold for my wife.
The weeks after birth are full of two problems that get treated badly online: pain, and the pressure to “drop the baby weight.” Her back, pelvis, incision or perineum, neck, and wrists take a daily beating from feeding and carrying. At the same time, a lot of apps answer that with a calorie target. That is a bad answer if she is healing, and a worse one if she is feeding a baby with her body.
Marigold is a private recovery companion. Each day she logs sleep, energy, mood, where it hurts, bleeding, and a few symptoms that should never be coached through. An open-weight model on our computer writes a short plan from a fixed catalog:

  • one gentle movement that matches how far she is from birth, whether a clinician has cleared more than daily life, and what hurts today
  • meals that keep her fed, including a snack when she is nursing, pumping, or running on empty
  • two comfort steps for the loudest pain
  • a plain instruction to call a clinician when the check-in says so Weight can be written down. It is not allowed to be the loudest thing in the room. If the number is falling faster than about a pound a week while she is still feeding the baby with her body, Marigold tells her to eat the snack and keep the walks easy. Her notes stay in the browser on that machine. There is no account. ## Demo There is no hosted demo. The model is the point, and it runs at home.
git clone https://github.com/HumayounBaig/marigold.git
cd marigold
npm install
ollama serve
ollama pull qwen2.5:3b
npm run dev
Enter fullscreen mode Exit fullscreen mode

Open http://127.0.0.1:43123.
The first screen asks for her name, the baby’s birth date, how she gave birth, how she is feeding, and whether a clinician has cleared more movement. After that, Today is a check-in. Move, Nourish, Soothe, and Progress are the rest of the house: the session player, the plates, the pain notes, and an optional weight record.
If Ollama is asleep, the same catalog still builds the day and says so. The check-in still never leaves the computer.

Code

https://github.com/HumayounBaig/marigold

Marigold

Marigold is a private postpartum recovery companion. It was made for one person: the weeks after birth, when weight is changing, pain is ordinary and sometimes not, and the last thing she needs is an account on someone else’s server.

Each day she logs sleep, energy, mood, where it hurts, and a few symptoms that should never be coached through. An open-weight model, running on the same computer, writes a short plan from a fixed catalog:

  • a movement small enough for her stage, clearance, and today’s pain
  • meals that keep recovery fed, including a snack when she is nursing or running on empty
  • two comfort practices for the places that hurt
  • a plain instruction to call a clinician when the check-in says so

Weight can be recorded. The app will not set a calorie target, and it will say so if the loss is fast enough to threaten energy…






The pieces that matter:
  • src/lib/catalog.ts holds the movements, meals, and comfort steps. The model is not allowed to invent a workout.
  • src/lib/recovery.ts decides what she is allowed to do, writes the prompt, and throws away model output that leaves the catalog or starts talking about deficits.
  • src/app/api/plan/route.ts sends that prompt only to Ollama on 127.0.0.1. ## How I Built It The open model is Qwen2.5 3B Instruct, Apache-2.0 weights, served by Ollama on the same machine as the app. A day plan is one local chat completion. No cloud model is in the path. The app around it is Next.js, TypeScript, and Tailwind. She gets a check-in, a session player, a meal list, a pain guide, and a quiet weight record. Safety is not left to the prompt. Before the model speaks, the server drops anything she should not be offered yet: core work before clearance, bridges and squats when the pelvis is loud, walks when bleeding is more than light, and every workout when the check-in includes heavy bleeding, chest pain, a severe headache, a one-sided swollen calf, fever, a worrying incision, or thoughts of harm. Those days become rest, and the note points to a person. In the US that includes 988 and Postpartum Support International at 1-800-944-4773. The model has to answer in JSON and may only use ids from that day’s allowed list. If it picks two snacks and no plate, or writes “cut calories,” or names a session she will not actually do, that part is replaced. The explanation has to name the movement that remains. Another open model is one environment variable: OLLAMA_MODEL. The behavior she gets is the catalog and systemPrompt() in src/lib/recovery.ts, which we can edit. ## Why Does Open Innovation Matter? This is health information from the hardest weeks of a marriage: pain, bleeding, mood, feeding, weight. A closed coaching app would upload that to a company we do not control, then answer with a model we cannot open, swap, or tell to refuse a calorie target. The open setup made four things possible. It runs after the weights are downloaded, with no internet and no per-day bill. The first note takes a little while on a laptop CPU. Later notes are a few seconds. That is an acceptable cost for a plan she might make at 2 a.m. Her data stays in browser storage. The plan request goes to our own Next.js server, which talks only to Ollama on localhost. A closed API cannot make that promise, because the product is the upload. We can change the agent. Sessions, meals, and the system prompt are files. When the small model wrote fluffy encouragement, or tried to skip the real meal, the fix was a rule in our code, not a support ticket. Qwen still chooses among the safe options. It does not get to invent medicine, a fast, or a target weight. It cost nothing beyond the computer we already had. A postpartum subscription would have charged us to hold the same notes. Marigold is not a clinician, a pelvic floor therapist, or emergency care. Open weights do not make it one. What they made possible is a companion that will sit on our machine, take the pain seriously, and refuse to turn her recovery into a diet.

My Agent Session

Built in Cursor. The session is here:
https://cursor.com/agents/bc-76c9d47c-407c-412c-91a5-c6132dfd58db

Prize Categories

This is an entry for the overall challenge. I did not use a partner product, so I am not entering a partner category.

Top comments (0)