Inspiration
1 in 5 teens experiences a mental-health condition each year, and roughly 50% of all lifetime mental illness begins by age 14. Yet existing mental-health apps demand sign-ups, mood data, and constant connectivity — meaning surveillance, stigma, and a paywall stand between a struggling teen and help.
We asked: what if a teen in a tough moment could get meaningful support in 60 seconds, completely privately, with zero risk of their words leaking?
What it does
Anchor is not a chatbot — it's an on-device reflection engine built on Cognitive Behavioral Therapy (CBT) principles:
- You check in — pick a mood and write what's on your mind, like texting a friend.
- Anchor reads it — scores the emotional load and matches your words against 8 cognitive distortions from CBT (all-or-nothing thinking, catastrophizing, mind-reading, labeling, "should" pressure, overgeneralizing, discounting the positive, emotional reasoning).
- It reflects back — names the thinking trap (not a label about you), offers a gentler reframe, and suggests one small actionable thing to try (box breathing, grounding exercises, reaching out).
- It shows your trend — your week's moods, stored only on your device, so you can see the storm pass.
Everything runs 100% in the browser. No server, no API call, no tracking. A teen can use Anchor on a cheap phone, offline, with zero risk of their words ever leaking.
How we built it
Anchor is a single self-contained HTML file with zero dependencies:
- Tone Scoring Engine: Weighted positive/negative lexicons (46 negative, 25 positive words) combined with mood selection produce an emotional-load score (0-100).
- CBT Distortion Detector: Regex patterns map natural language to 8 cognitive distortions, each with a warm reframe question and kinder thought.
- Coping Router: Context-aware action suggestions that match the themes in the user's entry (breathing for anxiety, reaching out for loneliness, grounding for spiraling).
- Local Trend Tracker: In-memory 7-day mood chart with seeded demo data.
- Design System: A calming "night-sea to dawn" palette with a living breathing orb, glassmorphic header, and staggered card animations.
- Accessibility: Full ARIA attributes, `prefers-reduced-motion` support, keyboard focus styling.
The code includes a clearly marked LLM swap-in hook — point it at any endpoint and the UI keeps working while the privacy-first on-device path stays the default.
Challenges we ran into
- Crafting regex patterns that accurately detect cognitive distortions without over-matching casual language was tricky — we iterated through many false positive scenarios.
- Balancing the tone of reframes to be warm and non-preachy without being dismissive of real feelings.
- Designing the emotional-load scoring to feel accurate across very different types of entries (short vs. long, explicit distress vs. subtle).
Accomplishments that we're proud of
- A fully functional CBT-based reflection engine that runs with zero dependencies and zero network.
- The app detects real cognitive distortions and provides genuinely helpful, therapist-informed reframes.
- Privacy isn't a feature toggle — it's the architecture. Nothing can leak because nothing is ever sent.
- The UI creates a genuinely calming experience with the breathing orb and night-sea aesthetic.
What we learned
- That CBT distortions can be meaningfully detected with carefully crafted heuristics — you don't always need an LLM.
- That for mental health tools, privacy IS the product — trust enables vulnerability.
- That teens don't need another chatbot — they need something that helps them name what they're feeling and take one small step.
What's next for Anchor
- localStorage persistence so mood trends survive browser sessions.
- More distortion patterns and richer reframe libraries.
- Optional LLM integration using the built-in swap-in hook for deeper personalization.
- PWA support for home screen installation and true offline-first experience.
- Multilingual support to reach teens globally.
Built With
- cbt
- css3
- html5
- javascript
- regex
Log in or sign up for Devpost to join the conversation.