DEV Community

CBT Tools
CBT Tools

Posted on Edited on

How I Built a Zero-Dependency Mental Health Toolkit in Vanilla JavaScript — 22 Tools, No Framework, No Backend, No Signup

Developer burnout is at an all-time high. Imposter syndrome is practically a job requirement. Anxiety, depression, and sleep problems are epidemic in tech.

I've been there. So I built something about it.

What I built

22 interactive CBT (cognitive behavioral therapy) tools. All free. No signup. No backend. No framework. Just vanilla JS + localStorage.

Every tool runs entirely in your browser. Your data never leaves your device. No accounts, no tracking, no paywall.

?? Bookmark the hub: CBT Toolkit

The tools

Foundational CBT tools (7)

# Tool What it does
1 Interactive Thought Record The core CBT tool. 7-step process: situation ? thought ? emotion ? distortion ? reframe ? outcome
2 Cognitive Distortion Checker Paste a thought, see which of 11 thinking traps apply. Pattern matching with confidence levels
3 How to Do a Thought Record Complete guide with worked example. Start here if you've never done one
4 Printable Template Classic 7-column worksheet. Print-optimized CSS, fillable online
5 Exercises & Worksheets Hub 10 core CBT techniques with step-by-step instructions
6 Mood Tracker Log daily mood, view trends, behavioral activation tips
7 Stop Negative Thoughts 7 techniques + interactive Negative Thought Reframer

Condition-specific guides + interactive tools (15)

# Tool Interactive widget
8 CBT for Anxiety 5-4-3-2-1 grounding exercise
9 CBT for Depression Activity Scheduler (behavioral activation)
10 CBT for Burnout Burnout Diary (WHO-recognized occupational phenomenon)
11 CBT for Imposter Syndrome Evidence Log (the hallmark technique)
12 CBT for Social Anxiety Exposure Hierarchy Builder
13 CBT for Panic Attacks Panic Diary
14 CBT for OCD ERP Tracker (exposure & response prevention)
15 CBT for Perfectionism Perfectionism Tracker
16 CBT for Anger Anger Diary
17 CBT for Low Self-Esteem Core Belief Tracker + Positive Data Log
18 CBT for Health Anxiety Symptom Diary
19 CBT for Intrusive Thoughts Intrusive Thought Tracker
20 CBT for Sleep (CBT-I) Sleep Diary
21 CBT for Procrastination Procrastination Tracker
22 CBT for Relationship Anxiety Relationship Thought Record

How they work (the tech)

Each tool uses the same architecture:

Cognitive distortion detection - keyword-pattern matching against 11 common thinking traps. When you enter a thought, the tool identifies which distortions are present and generates a balanced reframe.

localStorage persistence - all entries saved to the browser. No server, no database, no signup. Export to JSON anytime.

Aggregate insights - each tracker computes trends from your logged entries: distress over time, recovery rate, most common triggers, belief trends.

Zero dependencies - no npm, no framework, no build step. Just HTML + CSS + JS. Each page is self-contained.

The distortion detection is the interesting part. It's not AI - it's pattern matching. But it works surprisingly well because cognitive distortions have characteristic language patterns:

"always" / "never"     ? all-or-nothing thinking
"should" / "must"      ? should statements
"they think" / "everyone knows" ? mind-reading
"what if"              ? catastrophizing
"I'm a [label]"        ? labeling
"it's all my fault"    ? personalization
Enter fullscreen mode Exit fullscreen mode

This is a simplification of what a therapist does, but it's enough to get started.

Why CBT?

CBT is the most evidence-based psychotherapy for anxiety, depression, OCD, PTSD, and insomnia. It's structured, skill-based, and works well as self-help for mild-to-moderate issues.

The core insight: your thoughts cause your emotions, not your situations. Change the thought, change the feeling.

These tools don't replace therapy. But therapy is expensive ($100-300/session) and often inaccessible. These tools are free, immediate, and private.

The optional upsell

If you want structured tracking in Notion, I made a CBT Thought Record Notion template ($7). The free tools above are the core - the template is for people who prefer a journal format.

What I learned building 22 tools with zero dependencies

  1. You don't need a framework for interactivity. Vanilla JS + localStorage handles everything. No React, no state management library, no build step. The thought record tool is ~600 lines of JS and does more than most React apps I've built.

  2. localStorage is enough for personal tools. No database, no auth, no backend. Your data stays in your browser. The tradeoff: no sync across devices. But for a personal mental health tool, privacy > sync.

  3. Keyword matching beats AI for this use case. Cognitive distortions have predictable language patterns. A 50-line pattern matcher is more reliable than an LLM prompt - it's deterministic, fast, and doesn't hallucinate distortions that aren't there.

  4. Self-contained HTML files are underrated. Each tool is one file. No routing, no bundling, no dependencies. Deploy by pushing to GitHub Pages. Total deploy time: git push. Total hosting cost: $0.

  5. Structured data matters. Each page has Article + FAQPage + BreadcrumbList JSON-LD so search engines can understand the content. This is how you get rich snippets.

Try them

Start here: CBT Toolkit Hub

If you're a developer dealing with burnout or imposter syndrome (and statistically, you are), try the Burnout Diary or Impostor Syndrome Evidence Log.

Everything is free. No signup. No tracking. Your data never leaves your browser.


If you found this useful, I'd appreciate a reaction or comment. And if you're struggling, please talk to someone - a friend, a therapist, or a helpline. These tools help, but they're not a substitute for professional support.

Top comments (0)