Skip to content

AI-powered journaling web app with local Markdown storage and Claude-powered reflection

License

Notifications You must be signed in to change notification settings

austinatneuko/ai-journal

Repository files navigation

AI Journal

An AI-powered journaling web app with local Markdown storage and Claude-powered reflection.

Features

  • Chat-First Journaling: Select a template, chat with AI, save when ready
  • Local Storage: Entries stored as Markdown files you own forever
  • AI Reflection: Claude-powered conversations that help you reflect
  • Voice Input: Speech-to-text transcription (Chrome/Edge)
  • Text-to-Speech: Listen to AI responses
  • Templates: Gratitude, morning pages, evening reflection, and more
  • Goals Tracking: Set and track personal goals
  • Insights: AI-generated patterns and weekly summaries
  • PWA: Install as app on mobile, works offline
  • Authentication: Password-protected with optional encryption
  • Dark Mode: Light and dark theme support

Quick Start

# Install dependencies
npm install

# Create .env file
cp .env.example .env
# Add your ANTHROPIC_API_KEY to .env

# Start development server
npm run dev

Open http://localhost:5173 in your browser.

Requirements

Environment Variables

Create a .env file based on .env.example:

# Required
ANTHROPIC_API_KEY=your-api-key-here

# Optional
SESSION_SECRET=your-session-secret-here

# Optional: Supabase for cloud sync
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_KEY=your-service-key

Commands

npm run dev          # Start frontend + backend in development
npm run build        # Production build
npm run start        # Start production server
npm run prod         # Build + start in one command
npm test             # Run tests

Architecture

Frontend (React + Vite)  →  Backend (Express)  →  Claude API
        :5173                    :3001
                                   ↓
                            Local files (entries/, config.json)
  • Frontend: React, Vite, React Router
  • Backend: Express.js with TypeScript
  • AI: Anthropic Claude API
  • Storage: Local filesystem (Markdown with YAML frontmatter)
  • Auth: Argon2 password hashing, express-session

Entry Format

Entries are stored as Markdown files with YAML frontmatter:

---
date: '2026-01-24T10:30:00.000Z'
title: Morning Reflection
tags: []
emotions: []
templateId: free-write
---

Your journal entry here...

## AI Conversation

**User:** What patterns do you see?
**AI:** I notice you often mention...

Production Deployment

For local network access (e.g., from your phone):

npm run prod

The server displays local network URLs. Install as PWA on mobile for best experience.

Keep Running with pm2

npm install -g pm2
npm run build
pm2 start "node --import tsx server/index.ts" --name ai-journal
pm2 startup  # Auto-start on boot
pm2 save

Project Structure

src/
  pages/          # React pages
  components/     # UI components
  contexts/       # React context (auth)
  hooks/          # Custom hooks
  lib/            # API client
  styles/         # CSS tokens and base styles

server/
  routes/         # API endpoints
  services/       # Business logic
  middleware/     # Auth middleware

entries/          # Journal data (git-ignored)
config.json       # User settings (git-ignored)

Voice Input

Voice input requires browser support for Web Speech API:

  • Chrome/Edge: Full support
  • Safari: Partial support
  • Firefox/Brave: Limited/no support

License

MIT

About

AI-powered journaling web app with local Markdown storage and Claude-powered reflection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages