Skip to content

Latest commit

 

History

History
67 lines (49 loc) · 2.61 KB

File metadata and controls

67 lines (49 loc) · 2.61 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands

  • Build: bun run build (builds all packages and apps)
  • Dev: bun run dev (starts API on port 3001 and Web Client on port 5173)
  • Desktop Dev: bun run desktop:dev (builds web then starts Electrobun desktop app)
  • Desktop Build: bun run desktop:build (builds web and Electrobun package)
  • Lint: bun run lint (runs ESLint across the monorepo)
  • Lint Fix: bun run lint:fix
  • Format: bun run format (runs Prettier)
  • Test: bun run --filter @notetaiker/desktop test
  • Single Test: bun run --filter @notetaiker/desktop test <test-file-name>

Architecture

notetAIker is a local-first, AI-enhanced note-taking desktop application organized as a monorepo.

Monorepo Structure

  • Package Manager: Bun (with built-in workspace support)
  • Apps:
    • apps/desktop: Main application (Electrobun desktop, Hono API, React frontend)
    • apps/cli: CLI tool
    • apps/website: Marketing/landing site
  • Packages:
    • packages/env: Shared environment configuration
    • packages/eslint-config: Shared ESLint configuration
    • packages/tsconfig: Shared TypeScript configuration

Desktop App (apps/desktop)

The desktop app contains the API backend, web frontend, and Electrobun main process:

  • src/main/ - Electrobun main process entry point
  • src/api/ - Hono backend (routes, services, types)
  • src/web/ - React frontend (components, hooks, contexts)

Frontend (src/web)

  • Framework: React 19 + Vite
  • Styling: Tailwind CSS v4
  • State/Data: TanStack Query
  • Editor: CodeMirror 6 (with markdown support)
  • Routing: React Router DOM

Backend (src/api)

  • Server: Hono (running on Bun)
  • Database: SQLite (via bun:sqlite + sqlite-vec) - used for indexing and job queues, NOT for note storage
  • AI Integration: Vercel AI SDK (supports Anthropic, OpenAI, Google)
  • Async Processing: p-queue for background tasks

Data Model

  • Storage: Local filesystem. Notes are atomic Markdown files.
  • Indexing: A background process indexes notes into SQLite for search and AI analysis.
  • Tags: Generated by AI agents and stored in the frontmatter of markdown files.

Development Style

  • Type Safety: TypeScript is used throughout. Shared types should be defined in packages or inferred from Zod schemas.
  • Validation: Zod is used for runtime validation.
  • Local-First: Always assume data is stored locally on disk.
  • Code Style: Follow the existing ESLint and Prettier configurations.