Documentation maintenance rules live in
AGENTS.md. Current project truth lives indocs/CONTEXT.md. Full historical notes live indocs/HISTORY.md.
CatHub is in MVP development. The web app currently supports account auth, cat profiles, avatar uploads through Vercel Blob, health records, weight logs, social timeline posts, daily check-ins, video posts, and lineage tracking. The Expo React Native mobile app now has mobile auth endpoints, login/register screens, token storage, dashboard cat list with create/refresh-on-focus, cat creation, cat profile editing, cat detail screen with timeline/health/weight/check-in summary plus paginated full-list screens, owner-only timeline post creation with image upload, owner-only daily check-in / health / weight entry forms, lineage inbox with accept/decline/cancel, manual identity-code connect, and QR-code scanning for lineage connection requests.
The lineage system now supports:
- Internal parent links for cats owned by the same user.
- Recursive ancestor and descendant views with user-selectable display depth.
- Owner-only identity codes.
- External identity-code connection requests that require the shared cat owner to accept before an external lineage edge is confirmed.
- Added
docs/README.mdas the documentation index and owner-decision follow-up list. - Added
docs/DEVELOPMENT.mdfor local setup, web/mobile development, mobile mock/dev API modes, validation, schema notes, documentation updates, and safety boundaries. - Linked the new docs from
README.md,CONTRIBUTING.md, anddocs/CONTEXT.mdwithout drafting license, security, or code of conduct policy commitments.
Validation:
git diff --check
- Added
CONTRIBUTING.mdas the contributor-facing entry point for the GitHub-native maintenance flow. - Linked the guide from
README.mdand kept authoritative project rules inAGENTS.md,docs/CONTEXT.md,VISION.md, anddocs/GITHUB_WORKFLOW.md. - Documented validation, documentation routing, mobile mock/dev API checks, and owner approval boundaries without making license, security policy, or code of conduct decisions.
Validation:
git diff --check
- Expanded
README.mdfrom a minimal link list into a compact maintainer entry point. - Added quick-start commands for install, local web, Expo mobile, mobile mock preview, real mobile API port override, validation, schema generation, and documentation map.
- Kept detailed project truth in
docs/CONTEXT.mdand linked README back to the GitHub workflow authorization boundaries.
Validation:
git diff --check
- Added
pnpm mobile:mock-preview:checkto execute the mock API adapter without starting Expo, Next.js, a database, or network services. - The smoke now verifies mock mode detection, login token issuance, signed-out current-user rejection, signed-in current user, dashboard cat payload, and unsupported endpoint behavior for the first mock slice.
- Documented the check in
mobile/.env.exampleanddocs/CONTEXT.md.
Validation:
pnpm mobile:mock-api:checkpnpm mobile:mock-preview:checkpnpm --filter @cathub/mobile typecheckpnpm lintpnpm buildgit diff --check
- Added explicit
EXPO_PUBLIC_MOBILE_API_MODE=mocksupport for the mobile API client. - Mock mode now supports the login, register, current-user, and dashboard path with representative local data, while unsupported endpoints return a clear first-slice boundary error.
- Documented the mock mode in
mobile/.env.exampleanddocs/CONTEXT.md, and addedpnpm mobile:mock-api:checkas a no-network guard.
Validation:
pnpm mobile:dev-api:checkpnpm mobile:mock-api:checkpnpm --filter @cathub/mobile typecheckpnpm lintpnpm buildgit diff --check
- Added
EXPO_PUBLIC_API_PORTsupport to the mobile API client's local fallback URL, while keepingEXPO_PUBLIC_API_BASE_URLas the full override. - Documented the port override in
mobile/.env.exampleanddocs/CONTEXT.md. - Added
pnpm mobile:dev-api:checkas a no-network guard for the local mobile API fallback contract.
Validation:
pnpm mobile:dev-api:checkpnpm --filter @cathub/mobile typecheckpnpm lintpnpm buildgit diff --check
- Added
VISION.mdas the product/roadmap alignment anchor for future maintenance work. - Linked the vision from
README.mdanddocs/CONTEXT.md. - Updated
docs/GITHUB_WORKFLOW.mdto reflect routine maintenance standing authorization while preserving explicit approval gates for deploy, release, production, sensitive credential, destructive git, and major direction changes.
Validation:
git diff --check
- Added
POST /api/mobile/catsaccepting JSON{ name, breed?, sex?, birthdate?, description?, colorMarkings?, microchipId?, isNeutered?, isPublic? }. Authenticated user becomes the owner. Slug is generated via the sameslugifyfromtransliterationas the web action; same-owner slug collisions get a timestamp suffix. - Added
MobileCatCreateInputandMobileCatCreatePayloadto@cathub/shared. - Added
createCatin the mobile API client. - Added
mobile/app/cats/new.tsxmirroring the edit form (name, breed, sex chips, birthdate, color, microchip, description, neutered + public toggles); on success replaces to the new cat detail screen. - Dashboard now shows an "Add cat" button alongside "Lineage inbox" and refreshes the cat list on focus (so newly created cats appear immediately when the user navigates back).
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm lintpnpm build(route appears as/api/mobile/cats)
- Added
GET /api/mobile/cats/[catId]/timeline?offset=&limit=returning timeline posts with anextOffsetcursor (default page size 20, max 50). Public cats accessible to any auth user; private cats owner-only. - Added
GET /api/mobile/cats/[catId]/health?offset=&limit=with the same pagination shape. - Added
GET /api/mobile/cats/[catId]/weightsreturning up to the 200 most recent weight logs (no pagination — chart needs full series). - Added
MobileTimelineListPayload,MobileHealthListPayload,MobileWeightListPayload, andMOBILE_LIST_PAGE_SIZEto@cathub/shared. - Added
getCatTimeline,getCatHealth, andgetCatWeightsin the mobile API client. - Added
mobile/app/cats/[catId]/timeline.tsxandmobile/app/cats/[catId]/health.tsxwith "Load more" pagination. - Added
mobile/app/cats/[catId]/weights.tsxwith a latest/min/max summary card and per-row bars that scale to the cat's observed weight range. - The cat detail Timeline / Health / Weight sections now show a "View all →" link below populated content that routes to the corresponding list screen.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm lintpnpm build- End-to-end pagination not exercised against a real DB here.
- Added
PATCH /api/mobile/cats/[catId]accepting JSON with optional fields name, breed, sex, birthdate, description, colorMarkings, microchipId, isNeutered, isPublic. Owner-only; partial updates allowed. - Renaming a cat re-runs the same
slugifyfromtransliterationused by the web action; same-owner slug collisions get a${slug}-${timestamp}suffix. - Added
MobileCatUpdateInput,MobileCatUpdatePayload, andcat*Maxconstants to@cathub/shared. - Added
updateCatin the mobile API client. - Added
mobile/app/cats/[catId]/edit.tsxwith name/breed/birthdate/color/microchip/description text inputs, sex chip grid, neutered + public toggles, prefilled fromgetCatDetail. Non-owner access is rejected at load time. - Detail screen top bar now shows an owner-only "Edit" button next to "Back".
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm lintpnpm build- End-to-end PATCH not exercised here; needs a logged-in mobile session against a real
DATABASE_URL.
- Added
GET /api/mobile/lineage/requestsreturning pending incoming and outgoing lineage connection requests for the authenticated user, reusing the existinggetLineageConnectionInboxquery helper. - Added
PATCH /api/mobile/lineage/requests/[requestId]accepting{ action: "accept" | "decline" | "cancel", responseNote? }. Responder-only for accept/decline; requester-only for cancel. Accept replays the web action's full edge-creation logic: role/sex validation, cycle check, same-pair-other-role detection, and disputed-takeover when an existing same-role parent conflicts. - Added
MobileLineageRequestSummary,MobileLineageInboxPayload,MobileLineageRespondAction, andMobileLineageRespondPayloadto@cathub/shared, pluslineageResponseNoteMax. - Added
getLineageInboxandrespondLineageRequestin the mobile API client. Hardened therequest()helper Content-Type check against undefined bodies. - Added
mobile/app/inbox.tsxwith incoming/outgoing tabs, per-card accept/decline (incoming) or cancel (outgoing) actions, success/error banners, and post-action refresh. - Dashboard now shows a "Lineage inbox" entry below the connect actions.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm lintpnpm build(routes appear as/api/mobile/lineage/requestsand/api/mobile/lineage/requests/[requestId])- End-to-end accept/decline/cancel not exercised here; needs a logged-in mobile session against a real
DATABASE_URL.
- Added
POST /api/mobile/cats/[catId]/healthaccepting JSON{ type, title, date, description?, vetName?, vetClinic? }. Owner-only. - Added
POST /api/mobile/cats/[catId]/weightsaccepting JSON{ weightKg, recordedAt, notes? }. Owner-only.weightKgvalidated as a positive number (≤ 50 kg) with up to 2 decimals. - Added
healthRecordTypeValues,HealthRecordType,weightLog*constants,MobileHealthCreatePayload, andMobileWeightCreatePayloadto@cathub/shared. - Added
createHealthRecordandcreateWeightLogin the mobile API client. - Added
mobile/app/cats/[catId]/health-new.tsx(type chip grid, title, date, vet name/clinic, description) andmobile/app/cats/[catId]/weight-new.tsx(decimal-pad weight input, date, notes). - Detail screen Health and Weight sections now show owner-only "New record" / "Log weight" actions, including when no prior entries exist.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm lintpnpm build(routes appear as/api/mobile/cats/[catId]/healthand/api/mobile/cats/[catId]/weights)- End-to-end submission not exercised here; needs a logged-in mobile session against a real
DATABASE_URL.
- Added
POST /api/mobile/cats/[catId]/checkinsaccepting JSON{ date, appetiteScore (1-5), energyScore (1-5), bowelStatus, moodEmoji?, notes? }. Owner-only. Same-day duplicates return 409. - Added
bowelStatusValues,BowelStatustype,dailyCheckin*constants, andMobileCheckinCreatePayloadto@cathub/shared. - Added
createDailyCheckinin the mobile API client. - Added
mobile/app/cats/[catId]/checkin-new.tsxwith date input (defaults to today), 1-5 appetite/energy tick selectors, bowel status options, emoji preset row plus custom emoji entry, and notes textarea. - Detail screen now shows an owner-only "New check-in" action on the Latest check-in section, including when no prior check-in exists.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm lintpnpm build(route appears as/api/mobile/cats/[catId]/checkins)- End-to-end check-in submission not exercised here; needs a logged-in mobile session against a real
DATABASE_URL.
- Added
POST /api/mobile/cats/[catId]/timelineaccepting multipart/form-data withcontent, optionalimage(JPEG/PNG/WEBP/GIF, 5 MB cap), optionalisHealthAlert, and optional comma-delimitedtags. Owner-only. - Server uploads any attached image to Vercel Blob via
put(), then inserts the timeline post and returns the created row asMobileTimelineCreatePayload. - Added
expo-image-picker(~55.0.19) to the mobile workspace and configured the photos permission via theexpo-image-pickerconfig plugin inmobile/app.json. - Added
MOBILE_TIMELINE_*constants andMobileTimelineCreatePayloadto@cathub/shared. - Updated the mobile API client
request()helper to leave Content-Type unset when the body is FormData (so fetch generates the multipart boundary). - Added
createTimelinePostandMobileTimelineImageInputinmobile/src/lib/api.ts. - Restructured
mobile/app/cats/[catId].tsxintomobile/app/cats/[catId]/index.tsxand addedmobile/app/cats/[catId]/post-new.tsxwith content textarea, image picker preview, health-alert toggle, and submit flow that returns to the detail screen on success. - Detail screen now exposes an owner-only "New post" action button on the Timeline section.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm --filter @cathub/mobile exec expo install --checkpnpm lintpnpm build(route appears as/api/mobile/cats/[catId]/timeline)- End-to-end image upload not exercised here; needs a logged-in mobile session and a real
BLOB_READ_WRITE_TOKENin the API server environment.
- Added
GET /api/mobile/cats/[catId]returning cat record, owner brief, last 10 timeline posts, last 5 health records, last 30 weight logs, and the latest daily check-in (owner only). - Access rule: owners see any of their cats; other authenticated users only see cats with
isPublic = true. - Added
MobileCatDetailPayloadand supporting row types (MobileCatTimelinePost,MobileCatHealthRecord,MobileCatWeightLog,MobileCatCheckin) to@cathub/shared. - Added
getCatDetail(catId)in the mobile API client. - Added
mobile/app/cats/[catId].tsx: hero (avatar, owner, neutered/public flags, description), latest check-in card (owner only), recent weights, recent health, recent timeline posts. - Dashboard cat rows are now
Pressableand route to/cats/{id}.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm lintpnpm build- The new route shows up as
/api/mobile/cats/[catId]in the Next.js build output.
- Added
expo-camera(~55.0.16) to the mobile workspace and configured the camera permission via theexpo-cameraconfig plugin inmobile/app.json. - Added
mobile/app/scan.tsx: aCameraViewQR scanner that accepts either thecathub://connect?code=...deep link or a rawCAT-XXXX-XXXX-XXXXpayload, validates withidentityCodeSchemafrom@cathub/shared, and forwards to/connectwith the parsed code. - Permission flow handles unprompted, can-ask-again, and denied states with a manual-entry fallback.
- Added a "Scan QR" tertiary button on
mobile/app/connect.tsxand a Scan QR / Enter code action row onmobile/app/dashboard.tsx. - The full lineage connection request flow is now: scan QR → /connect prefilled → cat lookup → choose own cat + sire/dam → submit.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm --filter @cathub/mobile exec expo install --checkpnpm lintpnpm build- Camera and on-device scanning not yet exercised; an iOS dev build is required (Xcode currently not available on this machine).
- Started the local Next.js API server on
localhost:3000in a detachedscreensession namedcathub-api. - Verified
/api/mobile/auth/mereturns401 Not authenticated, confirming the mobile API layer is reachable without touching the database. - Added QR rendering to the owner-only identity code card using
qrcode. - QR payload opens
cathub://connect?code=...; mobile/connectnow pre-fills the code from that deep-link query.
Validation:
pnpm --filter @cathub/mobile typecheckpnpm --filter @cathub/shared typecheckpnpm lintpnpm build
- Added
/api/mobile/connect/identity-codefor authenticated identity-code lookup and external lineage request creation. - Added
mobile/app/connect.tsxwith manual identity-code search, parent preview, own-cat selection, sire/dam selection, optional note, and request submission. - Added a Dashboard entry point for mobile identity-code connection.
- Extended shared mobile API types for identity-code lookup and lineage request responses.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm --filter @cathub/mobile exec expo install --checkpnpm lintpnpm build
- Added mobile JSON APIs:
/api/mobile/auth/login,/api/mobile/auth/register,/api/mobile/auth/me, and/api/mobile/dashboard. - Added
src/lib/mobile-auth.tswith signed mobile Bearer tokens; mobile auth is intentionally separate from Auth.js browser cookies. - Added mobile login, registration, session restore, sign-out, and dashboard cat-list screens.
- Added
expo-secure-storefor native token storage, withlocalStoragefallback for Expo Web previews. - Added
pnpm mobile:ios:runfor local iOS simulator development builds once full Xcode is installed. - Confirmed this machine currently points at Command Line Tools only, so
xcodebuildandxcrun simctlare unavailable until full Xcode is installed and selected.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm --filter @cathub/mobile exec expo install --checkpnpm lintpnpm build
- Added
pnpm-workspace.yamlwithmobile/andpackages/*workspaces while leaving the current Next.js web app at the repository root. - Added
mobile/as an Expo SDK 55 TypeScript app using Expo Router, typed routes, and thecathub://scheme. - Added
packages/shared/with shared app constants, lineage role/sex types, identity-code validation, and anApiResult<T>response shape. - Added root mobile scripts:
pnpm mobile,pnpm mobile:ios,pnpm mobile:android, andpnpm mobile:web.
Validation:
pnpm --filter @cathub/shared typecheckpnpm --filter @cathub/mobile typecheckpnpm --filter @cathub/mobile exec expo install --checkpnpm lintpnpm build
- Added
src/components/layout/cat-paw-overlay.tsxexportingCatPawOverlayandGlassOverlay. CatPawOverlayrenders an SVG cat paw (semi-realistic, cute, 5-claw) that lerps toward the pointer, rotates to face it, and performs a claw-swipe pulse on fast pointer motion or after ~2.5s idle with cursor on screen.- Per-swipe color randomized from a warm palette (brand orange, flame, sunshine 700, bright yellow, pink variants) that fits DESIGN.md warm spectrum.
GlassOverlayis a full-screen fixed layer (z-index: 1) withbackdrop-filter: blur(26px) saturate(1.25)that blurs the paw painted below it, leaving page content sharp.- Added
.glass-overlayutility inglobals.csswith light/dark tinted variants. - Root layout wraps content in
relative z-10wrapper so Navbar/main/Footer stay above the glass. - Gated by
(pointer: fine)andprefers-reduced-motion: no-preference— overlay is inert on touch-only devices and users who opt out of motion.
Validation:
- Lint / build not run in this worktree (node_modules not installed here). User to run
pnpm install && pnpm lint && pnpm buildbefore commit. - Manual smoke test recommended: landing page pointer tracking, dashboard readability, lineage page contrast.
AGENTS.mdexpanded into the single source of truth for all coding-agent rules.CLAUDE.mdremains a pointer toAGENTS.md.- Old detailed
DEVLOG.mdmoved todocs/HISTORY.md. - New
docs/CONTEXT.mdadded as the quick project context file for humans and agents. DEVLOG.mdreduced to a short current-progress entry point.
Validation:
- Documentation-only change.
git diff --checkpassed.
- Added
lineage_connection_requestsandlineage_connection_status. - Added owner-only external identity-code request form on the Lineage page.
- Added Dashboard incoming/outgoing lineage request review.
- Added request / accept / decline / cancel Server Actions with action-level auth checks.
- Confirming a request writes an external
cat_lineage_edgesrow only after responder approval. - Cycle checks recurse through the full confirmed descendant path and are not limited by UI display depth.
Validation:
pnpm db:generatepnpm db:pushpnpm lintpnpm build- Database transaction tests for pending request constraints, accepted external edge, and 30-generation cycle detection.
- Vercel dev logged-in smoke test for Dashboard request visibility and owner Lineage external request form.
- Added
cat_identity_codesandcat_identity_code_visibility. - Added owner-only identity code card on the Lineage page.
- Non-owners cannot see identity codes on public Lineage pages.
Validation:
pnpm db:generatepnpm db:pushpnpm lintpnpm build- Database uniqueness checks and Vercel dev public privacy smoke test.
Recommended next feature slice:
- Switch mobile image upload to Vercel Blob client direct upload via a signed-URL endpoint to bypass the Vercel route-handler 4.5 MB body limit and lift the 5 MB cap toward video support.
- Mobile cat avatar upload (slot in once the direct-upload endpoint exists).
- Mobile token refresh/revocation or session table before production use.
- iOS dev build via EAS once Xcode is available, to exercise scanner / image picker / forms / inbox / edit / lists / create end-to-end.
- Product vision:
VISION.md - Current context:
docs/CONTEXT.md - Full history:
docs/HISTORY.md - GitHub workflow:
docs/GITHUB_WORKFLOW.md - Agent rules:
AGENTS.md - Deployment notes:
ref/DEPLOYMENT.md