4.3 KiB
4.3 KiB
AGENTS.md
This file is the fastest orientation doc for future coding agents working in this repository.
Project Summary
relationship_saver is a Flutter app for capturing and maintaining
relationship context locally. The app already supports:
- people profiles with aliases, notes, tags, facts, important dates, and preference signals
- moments, ideas, reminders, and dashboard tasks
- Android/in-app share-intake flows with inbox-first review for ambiguous content
- local notification scheduling for reminders
- fake-backend auth/sync flows and REST/OpenAPI scaffolding for later backend work
The current product posture is local-first and prototype-oriented, not a fully server-backed production app.
Canonical Code Paths
Start here before changing behavior:
lib/main.dart: app entrylib/app/relationship_saver_app.dart: root widget, auth gate, global listenerslib/app/presentation/app_shell.dart: responsive shell and navigationlib/app/data/relationship_repository.dart: aggregate local-first write boundarylib/features/sync/data/sync_queue_repository.dart: queued mutation storelib/integrations/backend/backend_gateway_provider.dart: fake vs REST gateway selectionlib/core/config/app_config.dart: runtime flags
Architecture Reality
The repo is in a vertical-slice migration.
- Canonical structure is
lib/app,lib/features,lib/core,lib/integrations - Many older files at slice roots are compatibility exports
- Prefer editing canonical files under:
presentation/application/domain/data/
- Avoid expanding legacy compatibility files unless the task is specifically about keeping old imports working
Useful orientation docs:
lib/README.mdlib/app/README.mdlib/features/README.mdlib/core/README.md- slice READMEs inside
lib/features/*
Main Product Slices
people: primary relationship workspace and richest data modelshare_intake: normalized shared payloads, review flows, inbox routingsync: queued changes, push/pull orchestration, rejection repairreminders: local reminder rules and notification schedulingdashboard: overview metrics and graph preview/explorersettings: trust/privacy copy, AI config, share simulation, environment diagnosticsauth: sign-in UI and session lifecycle
Storage And Data Flow
- Local state is centered on
LocalDataStateinlib/app/state/ LocalRepositorypersists a mostly single aggregate snapshot- Default local store is Hive; shared preferences remains as legacy fallback and migration path
- Sync queue state is persisted separately through the sync store abstraction
- The app is intentionally offline-safe in fake-backend mode
Runtime Flags
Defined in lib/core/config/app_config.dart:
USE_FAKE_BACKEND=trueby defaultBACKEND_BASE_URLUSE_HIVE_LOCAL_DB=trueby defaultENABLE_BACKGROUND_SYNC=trueby defaultBACKGROUND_SYNC_INTERVAL_SECONDS=180by defaultENABLE_LOCAL_NOTIFICATIONS=trueby defaultENABLE_WHATSAPP_SHARE_INTAKE=trueby default
If behavior seems surprising, check the active --dart-define values first.
Backend Boundary
- Transport contract is documented in
docs/api/openapi.yaml - Architectural rationale lives in
docs/ADR/0002-backend-protocol-rest-openapi.md BackendGatewayFakeis still the default development pathBackendGatewayRestis the real transport boundary when fake mode is off
Known Limitations
- iOS share extension work is deferred; see
docs/open-tasks.md - Native share-entry support is stronger on Android than iOS
- Sync scaffolding exists, but not all newer local entities are mapped to the backend protocol yet
- The repo currently contains a lot of in-flight migration work and compatibility exports
Working Guidance
- Read the relevant slice README before changing a feature
- Treat existing uncommitted changes as user work unless you created them
- Prefer canonical slice files over compatibility exports
- Keep docs aligned with the verified code, not with older plans
- When changing architecture-level behavior, update the nearest README or this file if it affects future orientation
Useful Commands
flutter pub get
flutter test
flutter analyze
dart run build_runner build --delete-conflicting-outputs