ae28e7ffd8
- analysis_options.yaml: activate custom_lint plugin (analyzer.plugins) without this riverpod_lint/drift_lint rules were silently ignored - pubspec.yaml: bump stale major constraints to latest resolvable versions go_router ^14 -> ^17 (resolved 17.1.0) flutter_local_notifications ^17 -> ^21 (resolved 21.0.0) flutter_lints ^5 -> ^6 (resolved 6.0.0) - CLAUDE.md: correct go_router version note and tech stack entries flutter analyze: no issues, flutter test: 1/1 passed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4.6 KiB
4.6 KiB
KittieMobile — CLAUDE.md
Project Overview
KittieMobile is an ADHD-friendly task manager with a virtual pet companion. Users manage tasks while caring for a pet (dog, cat, or capybara) that reacts to task completion and daily energy levels. The app is offline-first with optional sync to a remote backend.
Tech Stack
- Frontend: Flutter 3.x (Dart 3.x), targeting iOS and Android
- State Management: Riverpod 3.x (
flutter_riverpod+riverpod_annotation+riverpod_generator) - Local Database: Drift 2.x (SQLite, offline-first; mirrors the PostgreSQL schema)
- Animations: Rive 0.14.x (pet animations via
.rivfiles inassets/animations/) - Navigation: go_router 17.x
- Fonts: Google Fonts (Lexend, Atkinson Hyperlegible)
- Notifications: flutter_local_notifications 21.x
- Remote Sync:
httppackage to backend REST API atlocalhost:8090
Architecture
Feature-first structure with clean separation of concerns:
lib/
core/
constants/ # App-wide constants (colors, sizes, durations, energy levels)
theme/ # ThemeData, color scheme, text styles
router/ # go_router configuration and route name constants
data/
models/ # Drift table definitions and generated data classes
repositories/ # Data access layer (abstracts Drift + HTTP)
db/ # Drift database class and migration strategy
domain/
entities/ # Pure Dart domain entities (decoupled from DB schema)
use_cases/ # Business logic (complete task, reset day, sync, etc.)
pet/ # Pet engine: mood state machine, Rive controller, reward logic
features/
tasks/ # Task CRUD, list view, detail/edit screens
screens/
widgets/
providers/
onboarding/ # First-run flow: name input, pet selection (dog/cat/capybara)
screens/
widgets/
providers/
zen_mode/ # Distraction-free single-task view
screens/
widgets/
providers/
daily_reset/ # Morning check-in: energy level selection (1-3)
screens/
widgets/
providers/
shared/
widgets/ # Reusable UI components (EnergyBadge, TaskCard, PetDisplay)
utils/ # Date helpers, formatters, extensions
assets/
animations/ # .riv pet animation files (per pet type and mood)
fonts/ # Custom font files (if self-hosted; otherwise use google_fonts)
Ports & Infrastructure
| Service | Port | Notes |
|---|---|---|
| Backend REST API | localhost:8090 |
Remote sync target |
| PostgreSQL | 5432 (Docker internal), 5439 (host-mapped) |
via docker-compose |
API base URL: http://localhost:8090/api/v1/
Naming Conventions
- Files:
snake_case.dart - Classes:
PascalCase - Riverpod providers:
camelCaseProvider/camelCaseNotifier - Drift tables: class
PascalCase, column namescamelCase(maps to snake_case in DB) - Feature structure: each
features/X/dir containsscreens/,widgets/,providers/ - Route names: string constants in
core/router/routes.dart - Use cases:
VerbNounUseCasee.g.CompleteTaskUseCase,ResetDayUseCase
Build Commands
# Install dependencies
flutter pub get
# Generate code (Drift tables + Riverpod providers)
dart run build_runner build --delete-conflicting-outputs
# Watch mode (during development)
dart run build_runner watch --delete-conflicting-outputs
# Run on connected device/emulator
flutter run
# Static analysis
flutter analyze
# Run tests
flutter test
# Check environment
flutter doctor
Database Schema (Drift mirrors PostgreSQL)
Tables:
users— device identity, pet selection (dog/cat/capybara), pet nametasks— title, description, energy_level (1-3), status (pending/done/snoozed/someday/archived), deadline, photo_path, sort_order, synced_at, local_idpet_state— energy_today (1-3), streak_days, total_tasks_done, unlocked_itemstask_completions— completion log for rewards and analytics
Energy levels: 1 = low, 2 = medium, 3 = high
Sync Strategy
- Drift local SQLite is the source of truth on device
synced_atandlocal_idcolumns ontaskstrack sync statedata/repositories/sync_repository.dartpushes unsynced tasks tolocalhost:8090- Conflict resolution: last-write-wins on
updated_at
Package Versions (as of project init)
- flutter_riverpod: ^3.0.0 (3.3.1)
- riverpod_annotation: ^4.0.0 (4.0.2)
- riverpod_generator: ^4.0.0 (4.0.3)
- drift: ^2.22.0 (2.32.0)
- drift_flutter: ^0.2.0 (0.3.0)
- drift_dev: ^2.22.0 (2.32.0)
- go_router: ^17.0.0 (17.1.0)
- rive: ^0.14.0 (0.14.4)
- google_fonts: ^8.0.0 (8.0.2)
- flutter_local_notifications: ^21.0.0 (21.0.0)