This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
What I Built
OpenWhen is a private comfort app I built for "a close friend", who "often feels low and alone, especially at night".
When you feel low, generic motivational quotes don't help. What helps is hearing from people who actually know you. So the app works like digital "open when..." letters: people who care about my friend (including me) recorded voice notes and wrote messages, each tagged with a feeling. My friend taps how they feel, optionally types a few words, and the app brings back the right message from a real person. A small local AI model writes a one-line, gentle introduction, but it never tries to be the comforter. The comfort comes from people.
It also has:
- Log a win: a place for my friend to save things they got through, which the app surfaces on harder days ("Remember this?").
- I have a challenge: the AI breaks a problem into one tiny five-minute step.
- Saved for later: favorite messages that stay available even when the server is offline. (remove if not built)
- A safety layer: if my friend writes something that suggests self-harm, the AI is bypassed completely and the app shows a fixed message with one-tap buttons for Tele-MANAS (14416), my phone number, and 112.
It is a comfort tool, not therapy, and the app says so.
Demo
Code
Open When...
Open When... is a small, private web app that keeps a few kind words close by for someone who is having a hard day. When they say how they feel, it shows them a message or voice note from someone who loves them, or one of their own logged wins. It runs entirely on one laptop and talks to no company's servers.
It is built to be read and changed by one person, not scaled. If you are looking for a product, this is not it. If you are looking for something warm, small and yours, it might be.
What it is, and who it is for
The person who uses it is one specific friend who often feels low or alone They open it on their phone or laptop, tap how they feel, and get back something human that already existed — a note from a parent,…
How I Built It
Everything that touches my friend's feelings runs on my own laptop (i5-12450HX, 16 GB RAM, RTX 3050 with 4 GB VRAM).
- Model runtime: Ollama for local inference.
-
Chat model:
[MODEL YOU CHOSE, e.g. qwen2.5:3b], a small open-weight model. I compared [LIST THE MODELS YOU TESTED] on sample inputs and picked the warmest one. -
Embeddings:
[EMBEDDING MODEL, e.g. nomic-embed-text]for matching a feeling to the right message. - Backend: FastAPI and SQLite, with plain NumPy cosine similarity for retrieval. No heavy vector database was needed.
- Frontend: a plain HTML/CSS/JS installable PWA with no frameworks, no CDNs and no external fonts, so it works with zero internet.
- Phone access: [HOW YOU DID IT: e.g. Tailscale / Cloudflare Tunnel], with a passcode login (remove if not added).
- Built with an open-source agent: I wrote the build as a sequence of prompts and used OpenCode as the coding agent. [MENTION WHICH MODEL POWERED OPENCODE, and note that it only wrote code and never saw my friend's data.]
Design decisions I'm proud of
- Retrieval first, generation second. Because the comfort comes from real messages, a small model is enough, and it can't invent a memory it was never given.
- Safety runs before the model. Crisis checks use keywords plus an optional model check, and a crisis match never reaches the model. The response is fixed and human-written.
- Contributors are never blocked. I first screened loving notes from friends with the same filter, which falsely flagged them. I fixed it so the filter protects what my friend types, and only flags contributor notes for my review.
Honest limitations
- A 3B-parameter model is less fluent than the biggest closed models, especially in [Hinglish/Hindi, if relevant].
- A keyword safety filter is a minimum safeguard, not a guarantee.
- It's only as good as the messages people record, and it can't replace real support.
Why Does Open Innovation Matter?
I couldn't have built this the same way with a closed API.
- Privacy: my friend's most vulnerable moments are about as personal as data gets. With an open-weight model on my own laptop, none of it is sent to a third-party server.
- Cost: it costs nothing per message, so there's no usage bill and no subscription that could disappear.
- Control: I picked the model by testing several, wrote the system prompts myself, and wrote the safety rules myself instead of inheriting a vendor's policy. When the safety filter wrongly blocked a loving note, I could open the code, find out why and fix it.
- It keeps working: it runs offline, and the messages and voice notes stay in a plain SQLite file and a folder I can back up. If any company changes its terms tomorrow, my friend's letters are still there.
Top comments (0)