|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +Clover Map is a Nuxt 4 project management application that visualizes workflows using interactive treemap visualizations. It's a client-side application with no backend database - all data is stored locally in the browser using Pinia's persisted state. |
| 8 | + |
| 9 | +## Commands |
| 10 | + |
| 11 | +### Development |
| 12 | +- `pnpm run dev` - Start the development server at http://localhost:3000 |
| 13 | +- `pnpm run build` - Build the application for production |
| 14 | +- `pnpm run start` - Start production server |
| 15 | + |
| 16 | +### Testing |
| 17 | +- `pnpm run test` - Run unit tests with Vitest in watch mode |
| 18 | +- `pnpm run test:coverage` - Run tests with coverage report |
| 19 | +- `pnpm run test:e2e` - Run Playwright E2E tests |
| 20 | +- `pnpm run test:precommit` - Run tests once (used by pre-commit hooks) |
| 21 | + |
| 22 | +### Code Quality |
| 23 | +- `pnpm run lint` - Run ESLint on all files |
| 24 | +- `pnpm run lint --fix` - Auto-fix linting issues |
| 25 | + |
| 26 | +## Architecture |
| 27 | + |
| 28 | +### Tech Stack |
| 29 | +- **Framework**: Nuxt 4.1.3 with Vue 3.5.7 composition API |
| 30 | +- **Styling**: Tailwind CSS v4 with dark mode support |
| 31 | +- **State Management**: Pinia v3 with pinia-plugin-persistedstate (browser storage) |
| 32 | +- **Testing**: Vitest v3 for unit tests, Playwright for E2E tests |
| 33 | +- **Package Manager**: pnpm |
| 34 | + |
| 35 | +### Core Data Model |
| 36 | +The application revolves around three main types (defined in `types/index.ts`): |
| 37 | +- **Project**: Contains sections and custom statuses |
| 38 | +- **Section**: Hierarchical tree nodes with key, name, optional status, and children |
| 39 | +- **Status**: Customizable workflow states with name and color |
| 40 | + |
| 41 | +### Application Structure |
| 42 | +- **app/components/** - Vue components organized by feature |
| 43 | + - `TreeMap.vue` and `TreeNode.vue` - Core treemap visualization |
| 44 | + - `ProjectPanel.vue` - Sidebar project management interface |
| 45 | + - `config/` - Configuration drawer components for status and view settings |
| 46 | + - `project/` - Project creation and editing components |
| 47 | + - `ui/` - Reusable UI components |
| 48 | +- **app/composables/** - Shared logic and Pinia store |
| 49 | + - `store.ts` - Central Pinia store for all application state |
| 50 | + - Other composables provide feature-specific logic |
| 51 | +- **app/pages/** - Nuxt page routing |
| 52 | + - `index.vue` - Main project list |
| 53 | + - `projects/[id].vue` - Individual project treemap view |
| 54 | + |
| 55 | +### State Management |
| 56 | +The entire application state is managed through a single Pinia store (`app/composables/store.ts`) that: |
| 57 | +- Manages projects, sections, and their relationships |
| 58 | +- Handles UI state (panel collapse, dark mode, view settings) |
| 59 | +- Persists all data to browser storage automatically |
| 60 | +- Maintains a parent-child mapping for efficient tree navigation |
| 61 | + |
| 62 | +### Key Features Implementation |
| 63 | +- **Treemap Visualization**: Recursive components render hierarchical data with dynamic sizing based on viewport settings |
| 64 | +- **Drag & Drop**: Native HTML5 drag and drop for reorganizing sections |
| 65 | +- **Status Management**: Customizable statuses with color coding that cycle on click |
| 66 | +- **Data Persistence**: All changes automatically save to browser storage via Pinia plugin |
| 67 | +- **Import/Export**: JSON file upload/download for project backup and sharing |
0 commit comments