Skip to content

ericmarkarian/brain-dump

Repository files navigation

brain dump

A personal assistant for the thoughts that fly through your head during the day. Speak or type whatever's on your mind — Claude decides whether it's a todo or a calendar event, picks the right category, and files it. Browse your list grouped by category. Get a weekly digest email with patterns Claude noticed.

Built for the moments when you think "oh, I need to email so-and-so" or "I should work on that newsletter" — captures that usually evaporate because stopping to file them properly costs too much.

What it does

  • Capture anything by voice (Web Speech API) or by typing. One screen, one textbox, one mic button.
  • Classify with Claude Haiku. Explicit date + time → calendar event. Soft deadline → todo with due date. General idea → todo. Category picked automatically; if Claude's unsure, it asks you.
  • Route: todos live inside the app, grouped by category. Calendar events get pushed to your Outlook calendar.
  • Weekly digest emailed every Sunday — Claude reads the week's raw captures + open todos and writes you a short reflection on patterns, untouched items, and themes.

Screenshots

The vibe is bullet journal: warm paper background, Fraunces + Instrument Serif, a subtle ruled-paper grain, highlighter-pastel category accents. Works on your phone as a PWA (add to home screen) and on your laptop as a web app.

Stack

  • Next.js 15 (App Router) + React 19 + TypeScript
  • Neon Postgres (serverless driver, free tier)
  • Anthropic SDK (Claude Haiku 4.5 for classification + digest)
  • Microsoft Graph API for Outlook calendar writes
  • Resend for digest email
  • Tailwind for styling
  • Deploys to Vercel (free tier)

Cost

About $1–3 per month for heavy personal use, all in. Claude is the only non-free component; a typical brain dump costs ~$0.0015 at Haiku rates. Vercel, Neon, Resend, and Microsoft Graph are all free at personal volume.

Setup

1. Clone and install

git clone https://github.com/YOUR_USERNAME/brain-dump.git
cd brain-dump
npm install

2. Get your keys

Anthropic API key (required)https://console.anthropic.com → Settings → API Keys. Add $5 of credit; that will last you many months.

Neon Postgres (required)https://neon.tech → new project → copy the connection string. Free tier is 0.5GB, way more than you'll ever need for text todos.

Microsoft OAuth app (optional — only for Outlook sync)https://portal.azure.com → Azure Active Directory → App registrations → New registration.

  • Supported account types: "Personal Microsoft accounts only" (or multi-tenant if you want it to work for others)
  • Redirect URI (Web): http://localhost:3000/api/auth/microsoft/callback
  • After creating: go to "Certificates & secrets" → New client secret → copy the value
  • Go to "API permissions" → Add → Microsoft Graph → Delegated → add Calendars.ReadWrite, User.Read, offline_access

Resend API key (optional — only for weekly digest)https://resend.com → API Keys. Free tier is 3,000 emails/month.

3. Environment

cp .env.example .env.local
# fill in the values

4. Config

cp config.example.yaml config.yaml
# edit your name, categories, and digest email

Categories take a slug (used internally), a name (shown in the UI), and a color — one of stanford, harvard, asa, side for the pre-built highlighter pastels. You can remap any color name to any category; they're just visual labels.

5. Initialize the database

npm run db:init

This runs db/schema.sql against your Neon database.

6. Run locally

npm run dev

Open http://localhost:3000. Start dumping.

7. (Optional) Connect Outlook

Visit http://localhost:3000/api/auth/microsoft. You'll be redirected to Microsoft, sign in, and the callback stores your refresh token. From then on, any captured event is pushed to your calendar.

Deploying to Vercel

npm install -g vercel
vercel

Then, in the Vercel dashboard:

  1. Environment variables — copy everything from .env.local into the project's env var settings.
  2. Update MS_REDIRECT_URI to https://your-app.vercel.app/api/auth/microsoft/callback, and add that same URL to your Azure app's allowed redirect URIs.
  3. Cron jobvercel.json already configures a weekly digest at Sunday 14:00 UTC. Adjust the schedule if you want. Set CRON_SECRET in env vars to secure the endpoint.
  4. After deploy, visit https://your-app.vercel.app/api/auth/microsoft to connect Outlook in production.

Add to home screen

On iPhone: open the site in Safari → Share → "Add to Home Screen". Opens fullscreen, feels native. Same on Android via Chrome.

Using it

Capture screen (/):

  • Tap the textbox and type, or hit the mic button and speak.
  • ⌘/Ctrl + Enter submits. On mobile, just tap capture.
  • If Claude is confident, a card slides in showing what was filed. If it's uncertain about the category, a popup asks which one you meant.
  • The last 5 captures stay visible so you can dismiss or re-check.

Todos list (/todos):

  • Grouped by category in the order you defined them in config.yaml.
  • Click the circle to complete. Hover to delete.
  • Toggle between "open" and "done".

Weekly digest:

  • Runs automatically via Vercel cron (vercel.json), or trigger manually: npm run digest:send (needs dev server running), or npm run digest:send -- https://your-app.vercel.app/api/digest.

Architecture

┌─────────────────┐     ┌─────────────┐     ┌─────────────────┐
│  Capture screen │───▶ │ /api/       │───▶ │ Claude Haiku    │
│  (text + mic)   │     │  capture    │     │  classifier     │
└─────────────────┘     └─────────────┘     └─────────────────┘
                              │
                              ▼
                       ┌─────────────────┐
                       │ Neon Postgres   │
                       │ • todos         │
                       │ • events        │
                       │ • brain_dumps   │
                       │ • outlook_tokens│
                       └─────────────────┘
                              │
                ┌─────────────┴─────────────┐
                ▼                           ▼
       ┌─────────────────┐         ┌─────────────────┐
       │ Outlook calendar│         │  Todos view     │
       │ (MS Graph API)  │         │  (grouped)      │
       └─────────────────┘         └─────────────────┘

Every Sunday → /api/digest reads the past week → Claude writes
a reflection → Resend emails you.

The brain_dumps table stores every raw capture alongside Claude's classification response. It's what powers the weekly digest, and it's a useful debugging log when tuning the classifier prompt.

Customizing

Change the classifier behavior — edit the system prompt in lib/claude.ts. It's deliberately one function, easy to tweak.

Change categories — edit config.yaml. The app re-reads on startup.

Change the color palettetailwind.config.ts has the four accent colors; globals.css has the matching .swatch-* and .highlight-* utility classes. Add your own or remap the existing ones.

Swap Outlook for Google Calendar — implement a module with the same interface as lib/outlook.ts (createCalendarEvent) and switch backends.calendar in config.yaml. The capture route just calls createCalendarEvent; it doesn't care about the backend.

License

MIT.

Contributing

Issues and PRs welcome. A few things on the wishlist:

  • Google Calendar backend
  • Todoist / Notion backends for todos
  • Search across past brain dumps
  • Snooze / reschedule todos
  • Category stats in the digest
  • Dark mode (currently paper-only)
  • Replace placeholder icons with something better

About

A personal assistant for the thoughts that show up and immediately leave. Say or type anything—it turns into tasks or events and organizes itself. Built for me because I always forget what I was just about to do.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors