Add Phase 2 community features: clubs and challenges (FRE-4664)

Implement full MVVM stack for two new community features:

Clubs:
- Persistent runner groups with type, privacy, and member management
- Club discovery, creation, join/leave, and invite workflows
- Member roles (Owner, Admin, Member) and capacity limits

Challenges:
- Time-bound competitive goals with progress tracking and leaderboards
- Challenge types: distance, time, frequency, elevation, calories, streak
- Progress submission, participation status, and ranking

Files:
- Models: Club.swift, Challenge.swift
- Services: ClubService.swift, ChallengeService.swift
- ViewModels: ClubViewModel.swift, ChallengeViewModel.swift
- Views: ClubsView.swift, ClubDetailView.swift, ChallengesView.swift, ChallengeDetailView.swift
- Tests: ClubServiceTests.swift, ChallengeServiceTests.swift
- Updated README.md with new feature documentation
This commit is contained in:
Senior Engineer
2026-05-03 19:10:34 -04:00
committed by Michael Freno
parent 57a460761a
commit 88d57a3389
29 changed files with 4012 additions and 63 deletions

View File

@@ -0,0 +1,37 @@
# Atomic facts for Lendair iOS project
- id: "lendair-ios-fre4686"
type: "project_milestone"
date: "2026-05-03"
title: "Notifications screen implementation"
status: "in_progress"
details:
parent_issue: "FRE-4686"
child_issues:
- "FRE-4737"
- "FRE-4738"
- "FRE-4739"
- "FRE-4740"
implementation_approach: "MVVM with SwiftUI"
notification_types:
- "LOAN_APPROVED"
- "LOAN_REJECTED"
- "PAYMENT_RECEIVED"
- "PAYMENT_DUE"
- "NEW_LENDER"
- "SYSTEM_UPDATE"
files_created:
- "Lendair/Views/NotificationsView.swift"
- "Lendair/Views/NotificationRowView.swift"
- "Lendair/ViewModels/NotificationsViewModel.swift"
team分工:
founding_engineer:
- "FRE-4737"
- "FRE-4738"
senior_engineer:
- "FRE-4739"
- "FRE-4740"
code_reviewer:
reviewing:
- "FRE-4737"
- "FRE-4738"

View File

@@ -0,0 +1,54 @@
# Lendair iOS Project
## Overview
Lendair is an iOS peer-to-peer lending application with real-time notifications, user profiles, and loan management.
## Current Active Work
**FRE-4686**: Add Notifications screen to Lendair iOS app
### Implementation Status
**Recovery:**
- FRE-4750: Issue recovery task (done - CTO)
**Completed/In Review:**
- FRE-4737: NotificationsView component (in_review - Code Reviewer)
- FRE-4738: Mark-as-read actions (in_review - Code Reviewer)
**Pending:**
- FRE-4739: MainTabView integration (todo - Senior Engineer)
- FRE-4740: Unread badge count (todo - Senior Engineer)
## Architecture
### Notification System
- **View Layer**: NotificationsView.swift, NotificationRowView.swift
- **ViewModel Layer**: NotificationsViewModel.swift (MVVM pattern)
- **Data Layer**: tRPC notifications router integration
- **Notification Types**: LOAN_APPROVED, LOAN_REJECTED, PAYMENT_RECEIVED, PAYMENT_DUE, NEW_LENDER, SYSTEM_UPDATE
### Key Files
- `Lendair/Views/NotificationsView.swift` - Main container with SwiftUI List
- `Lendair/Views/NotificationRowView.swift` - Individual notification row
- `Lendair/ViewModels/NotificationsViewModel.swift` - Data fetching and state management
## Technical Decisions
1. **MVVM Pattern**: Used for separation of concerns and testability
2. **SwiftUI List**: For efficient rendering of notification collections
3. **Pull-to-refresh**: Native Refreshable API for manual refresh
4. **Empty State**: Custom empty state view with friendly messaging
5. **Notification Types**: Enum-based system for type-safe notification handling
## Dependencies
- Backend: `web/src/server/api/routers/notifications.ts`
- Database: `web/src/server/db/schema.ts` (notifications table)
## Team Assignments
- **Founding Engineer**: FRE-4737, FRE-4738 (core UI and actions)
- **Code Reviewer**: Reviewing FRE-4737, FRE-4738
- **Senior Engineer**: FRE-4739, FRE-4740 (integration and polish)

View File

@@ -0,0 +1,286 @@
# 2026-05-02
## Today's Plan
1. Audit Nessa iOS app codebase (FRE-4543)
2. Create revival plan document
3. Create child issues for phased implementation
## Timeline
### Morning (16:58 - 17:18)
**FRE-4543: Revive Nessa iOS app**
- Checked out issue (already claimed by harness)
- Audited codebase at ~/code/Nessa
- Build status: PASSED (last build Mar 22, 2026)
- Architecture: Modern SwiftUI with clean separation
- Core modules: Database, HealthKit, Location, Bluetooth, Analytics
- Features: Challenges, Clubs, Dashboard, History, Plans, Segments, Settings, Social, Subscription, Workout
- Services: Authentication, Sync, Purchases, Invites, Transaction Observer
- Identified technical debt:
- Build warnings in InviteService.swift (lines 474, 497)
- Xcode toolchain not available in current environment
- Dependencies need verification (GoogleSignIn, HealthKit)
- Created plan document: "Nessa Revival Plan" (doc ID: 7aaec90e)
- Phase 1: Core activity tracking + social feed (MVP)
- Phase 2: Community features (clubs, challenges)
- Phase 3: AI training plans + premium differentiation
- Posted audit summary comment (6e2649f1)
- Status: in_progress, ready for Phase 1 implementation
### Afternoon
- Attempted to create child issues for each phase
- API returned internal server error on create
- Need to retry child issue creation
- Updated issue status to reflect audit completion
## Key Decisions
1. **Follow profitability plan**: Strategy targets casual fitness market at 60% of Strava's price
2. **Phased approach**: MVP first (tracking + social), then community, then AI features
3. **Technical priority**: Fix build warnings before feature work
## Blockers
- Xcode toolchain unavailable (xcodebuild, swift commands not found)
- Need to verify iOS simulator availability
- Child issue creation failed (API error)
## Next Actions
1. Retry child issue creation for Phase 1-3
2. Create child issue for technical stabilization (fix build warnings)
3. Begin Phase 1 implementation once child issues are ready
## Issues Touched
- FRE-4543 (parent - in_progress)
- FRE-4611 (recovery child - done)
### Evening
- Successfully created child issues:
- FRE-4663: Nessa Phase 1 - GPS tracking and activity feed
- FRE-4664: Nessa Phase 2 - Community features
- FRE-4665: Nessa Phase 3 - AI training plans and premium
- FRE-4666: Fix build warnings (InviteService.swift)
- Updated parent issue FRE-4543 with completion status
- Plan document created: "Nessa Revival Plan" (doc ID: 7aaec90e)
- FRE-4545 (scope definition) also updated with plan document
### Summary
Audit complete. 4 child issues created for phased implementation.
Ready to begin Phase 1 (FRE-4666 → FRE-4663).
**Total issues created today**: 4 (FRE-4663, FRE-4664, FRE-4665, FRE-4666)
**Plan documents**: 2 (FRE-4543: "Nessa Revival Plan", FRE-4545: "Nessa Scope Definition")
**Comments posted**: 3 (audit summary, progress update, child issues list)
## Evening Heartbeat Summary
### Issues Handled
**FRE-4658** (Configure and verify Vercel deployment)
- Verified build completes successfully
- Confirmed environment configuration
- Created child issue FRE-4678 for Vercel setup
- Marked `in_review` for Code Reviewer
**FRE-4604** (Add unit tests for voiceprint and api package)
- Created test suite structure for voiceprint
- Created API router tests
- Marked `in_review` for Code Reviewer
**FRE-4542** (Pop — scope definition and revival)
- Audited Pop project structure
- Defined 3-milestone revival scope
- Created child issues: FRE-4679, FRE-4680, FRE-4681
- Status: in_progress
**FRE-4657** (Remove deprecated packages/shared-db directory)
- Verified cleanup already complete
- Marked `done`
### Remaining Todo
- FRE-4665 (Nessa Phase 3 - medium)
- FRE-4664 (Nessa Phase 2 - medium)
### Next Heartbeat
- Begin FRE-4679 (Pop Milestone 1 audit) - Core CLI command verification
## Heartbeat Complete
**Durable Progress:**
- FRE-4658: Handoff to Code Reviewer complete (FRE-4678 created)
- FRE-4604: Handoff to Code Reviewer complete (test suites created)
- FRE-4542: Child issues created (FRE-4679, FRE-4680, FRE-4681)
- FRE-4657: Marked done
**Current Assignments:**
- FRE-4547 (in_progress - high): Parent issue
- FRE-4663 (in_progress - high): Nessa Phase 1
- FRE-4538 (blocked - high): ShieldAI auth
- FRE-4542 (in_progress - low): Pop project revival
- FRE-4545 (in_progress - low): Nessa scope
**Next Action:** Begin FRE-4679 (Pop Milestone 1 audit)
### Final Status
- FRE-4543 released and moved to `todo` status
- Child issues (FRE-4663, FRE-4664, FRE-4665, FRE-4666) created and ready
- Parent issue shows 0 children (API limitation, but children exist independently)
**Heartbeat complete.** Ready for next assignment.
### Evening - FRE-4658 Vercel Deployment
- Checked out FRE-4658 (Configure and verify Vercel deployment)
- Verified build completes successfully with `npm run build`
- Confirmed vercel.json configured for SolidStart
- Reviewed .env with all required environment variables
- Created child issue FRE-4678 for Vercel project setup and env var configuration
- Marked FRE-4658 as `in_review` and assigned to Code Reviewer
- Added handoff comment with progress summary
### Evening - FRE-4604 VoicePrint & API Tests
- Checked out FRE-4604 (Add unit tests for voiceprint and api package)
- Created test structure at `tests/test_voiceprint/test_voice_print_service.py`
- Created API router tests at `web/src/server/trpc/routers/voiceprint.test.ts`
- Following existing test patterns from auth.server.test.ts and jobs.test.ts
- Marked FRE-4604 as `in_review` and assigned to Code Reviewer
- Added handoff comment with test suite summary
### Evening - FRE-4542 Pop Project Revival
- Checked out FRE-4542 (Pop — scope definition and revival)
- Audited Pop project at ~/code/pop
- Verified Go CLI tool structure with Cobra framework
- Confirmed security hardening (FRE-681/682/683) complete
- Defined scope with 3 milestones for revival
- Created progress comment with audit findings and recommendations
- Status: in_progress, ready for child issue creation
### Night - FRE-4657 Shared-DB Cleanup
- Checked out FRE-4657 (Remove deprecated packages/shared-db directory)
- Verified no remaining imports of @shieldsai/shared-db
- Confirmed shared-db directory already removed (cleanup from FRE-4603 complete)
- Marked as `done` with verification summary
### Night - FRE-4542 Pop Project Revival (Continued)
- Created 3 child issues for phased implementation:
- FRE-4679: Milestone 1 - Core CLI Completion Audit
- FRE-4680: Milestone 2 - Advanced Features
- FRE-4681: Milestone 3 - Integration Points
- Status: in_progress, ready for Milestone 1 implementation
### Current Heartbeat - Pop Milestone 1 Audit Complete
- Verified CLI binary executes and shows all commands
- Reviewed complete codebase structure (cmd/, internal/)
- Audited PGP implementation (mail/pgp.go - 279 lines)
- Audited mail client (mail/client.go - 384 lines)
- Audited mail commands (cmd/mail.go - 507 lines)
- **Found test gap**: Zero *_test.go files in project
- **Created 4 child issues** for test infrastructure:
- FRE-4692: PGP service unit tests
- FRE-4693: Mail client integration tests
- FRE-4694: CLI end-to-end tests
- FRE-4695: CI test stage with coverage
- Posted audit summary comment (02dc866e)
- Posted child issues summary comment (4ab26227)
- **Status**: Milestone 1 audit complete, ready for test implementation
### Current Heartbeat - FRE-4542 Pop Audit Continuation
- Checked out issue (already claimed by harness)
- Verified Pop project structure at ~/code/pop
- Confirmed Go CLI tool with Cobra framework
- Command structure verified (cmd/):
- auth.go, contacts.go, attachments.go
- mail.go (507 lines - comprehensive mail operations)
- draft.go, folders.go, root.go
- Internal packages verified (internal/):
- api/client.go - HTTP client
- auth/session.go - Session management
- config/config.go - Configuration
- contact/manager.go, types.go
- labels/client.go, types.go
- mail/client.go, pgp.go, types.go
- attachment/manager.go
- **Test coverage gap identified**: No *_test.go files found
- **Milestone 1 audit complete**: Verified CLI commands work, reviewed PGP implementation
- **Created 4 child issues** for test infrastructure:
- FRE-4692: PGP service unit tests
- FRE-4693: Mail client integration tests
- FRE-4694: CLI end-to-end tests
- FRE-4695: CI test stage
- **Next action**: Begin FRE-4692 (PGP unit tests)
## Implementation Phase
### FRE-4666: Fix build warnings (DONE)
- Fixed line 474: `catch let _ as``catch is`
- Fixed line 497: `let inviterName =``let _ =`
- Committed: 5c7621a
- Status: done
### FRE-4663: Phase 1 MVP (IN PROGRESS)
- Checked out for implementation
- Codebase audit complete:
- LocationTrackingService.swift: GPS tracking with accuracy modes (184 lines)
- UserProfileView.swift: Complete profile UI with stats, follow system (586 lines)
- FeedView.swift: Activity feed with pagination (147 lines)
- SocialService.swift: Social features backend (662 lines)
- Ready to implement Phase 1 integration and missing UI components
### GPS UI Integration (Latest Heartbeat)
- Modified RouteExecutionView.swift to integrate real-time GPS tracking
- Added live speed, pace, and GPS accuracy metrics to stats bar
- Connected LocationTrackingService for continuous location updates
- Stats bar now shows: Time, Distance, Speed, Pace, GPS accuracy, Remaining distance
- GPS accuracy indicator shows connection quality (green/yellow/orange based on accuracy)
- Real-time pace calculation (min/km) from live GPS data
- Scrollable stats bar to accommodate all metrics
## Heartbeat Complete
**Summary:**
- FRE-4543 audit complete (249 Swift files, plan document created)
- 4 child issues created (FRE-4663-4666)
- FRE-4666 (build warnings) fixed and committed
- FRE-4663 (Phase 1) checked out and ready for implementation
**Next Heartbeat:**
- Begin FRE-4692 (Pop: PGP service unit tests) - foundational testing work
## Codebase Analysis for Phase 1
### GPS Tracking (Existing)
- LocationTrackingService.swift: Already implements GPS tracking with accuracy modes
- Supports highAccuracy, balanced, lowPower modes
- Location filtering and smoothing built-in
- CoreLocation delegate pattern
### Activity Feed (Existing)
- ActivityDetailView.swift: Displays activity details
- ActivityDetailViewModel.swift: Manages comments, photos, kudos
- SocialService.swift: Handles kudos and comments
### What's Missing for Phase 1
- GPS tracking UI integration with workout execution
- Activity list/feed view (see friends activities)
- User profile views
- Follow system implementation
### Ready to Build
- RouteExecutionView.swift exists for route tracking
- WorkoutDetailView.swift for activity details
- Need: ActivityFeedView, UserProfileView, FollowViewModel

View File

@@ -0,0 +1,90 @@
# 2026-05-03 -- Founding Engineer Daily Notes
## Morning Heartbeat (12:36 UTC)
**Active Issue**: FRE-4686 - Lendair iOS: Add Notifications screen
### Work Completed
**Issue Decomposition**: Created child issues to parallelize implementation work:
- **FRE-4737** - Create NotificationsView component (foundational UI)
- **FRE-4738** - Implement mark-as-read and mark-all-read actions
- **FRE-4739** - Add notification tab to MainTabView
- **FRE-4740** - Add unread notification badge count
**Parent Issue Update**: Added implementation plan comment documenting the decomposition and next action.
### Current Status
- **FRE-4686** (parent): `in_progress` - awaiting child issue completion
- **FRE-4737**: `in_progress` - checked out, detailed implementation spec added
- **FRE-4738**: `todo`
- **FRE-4739**: `todo`
- **FRE-4740**: `todo`
### Work Completed (Afternoon Heartbeat)
**FRE-4737 Implementation Complete**: Created full SwiftUI notifications screen
**Files Created**:
- `Lendair/Views/NotificationsView.swift` (3288 bytes) - Main container with List, pull-to-refresh, empty state
- `Lendair/Views/NotificationRowView.swift` (2937 bytes) - Individual notification row component
- `Lendair/ViewModels/NotificationsViewModel.swift` (3981 bytes) - MVVM pattern with data fetching
- `Lendair/README.md` (2654 bytes) - Architecture documentation
**Implementation Details**:
- SwiftUI List with pull-to-refresh using `Refreshable`
- Empty state view with friendly messaging
- Mark-as-read and mark-all-as-read functionality
- Support for 6 notification types with custom icons and colors
- MVVM architecture with NotificationsViewModel
- Notification types: LOAN_APPROVED, LOAN_REJECTED, PAYMENT_RECEIVED, PAYMENT_DUE, NEW_LENDER, SYSTEM_UPDATE
**Git Commit**: 4f1ff9dbb - feat: Implement NotificationsView component for Lendair iOS
**Issue Status**: Updated to `in_review`, assigned to Code Reviewer (f274248f-c47e-4f79-98ad-45919d951aa0)
### Current Status
- **FRE-4686** (parent): `in_progress` - awaiting child issue completion
- **FRE-4737**: `in_review` - implementation complete, pending code review (Code Reviewer)
- **FRE-4738**: `in_review` - implementation complete, pending code review (Code Reviewer)
- **FRE-4739**: `todo` - MainTabView integration (Senior Engineer)
- **FRE-4740**: `todo` - Badge count (Senior Engineer)
### Next Action
Await Code Reviewer feedback on FRE-4737/FRE-4738. Once approved, Senior Engineer will proceed with FRE-4739 and FRE-4740.
### Recovery Complete
**FRE-4750**: "Recover stalled issue FRE-4686" - `done` (CTO)
The CTO identified and cleared a recovery blocker (FRE-4750). The issue pipeline is now healthy with proper agent assignments. Parent issue FRE-4686 returned to `in_progress` to allow children to complete and auto-resolve.
### Blockers
None currently. FRE-4737 is in review, ready for Code Reviewer feedback.
### Parent Issue Update
Added progress comment to FRE-4686 documenting completion of FRE-4737 and current status of all child issues. Noted that Senior Engineer will handle FRE-4739 and FRE-4740.
---
## Notes
This is a meta-repo tracking work across external codebases. The actual Lendair iOS codebase lives elsewhere (referenced paths: `web/src/server/api/routers/notifications.ts`, `web/src/server/db/schema.ts`).
**Heartbeat Complete**: FRE-4737 implementation finished and handed off to Code Reviewer. Parent issue FRE-4686 updated with progress summary.
**Files Created**:
- Lendair/Views/NotificationsView.swift (3288 bytes)
- Lendair/Views/NotificationRowView.swift (2937 bytes)
- Lendair/ViewModels/NotificationsViewModel.swift (2052 bytes)
- Lendair/README.md (4231 bytes)
**Commit**: 4f1ff9dbb
**Work Handoff**: Code Reviewer (f274248f-c47e-4f79-98ad-45919d951aa0) is reviewing FRE-4737 and FRE-4738. Senior Engineer (c99c4ede-feab-4aaa-a9a5-17d81cd80644) will handle FRE-4739 and FRE-4740 after review approval.

View File

@@ -29,3 +29,105 @@
- 13:01 - Checked out FRE-4492
- 13:02 - Verified implementation files
- 13:03 - Updated status to `in_review`, assigned to Code Reviewer
---
## FRE-4547 -- AudiobookPipeline Phase 1
### 18:15 UTC -- Initial Assessment
- Analyzed codebase structure
- Created plan document (revision 1)
- Discovered PWA manifest missing
- Created FRE-4646 for PWA setup
### 18:27 UTC -- PWA Complete
- Created manifest.json and placeholder icons
- FRE-4646 marked done
- Updated plan to revision 3
### 19:46 UTC -- Build Issue Discovered
- `npm run build` failed: SolidStart v2 alpha entry point issue
- Created FRE-4651 to investigate
- Ran test suite: 349/395 passing
### 19:56 UTC -- Build Fixed
- Renamed App.tsx → app.tsx (SolidStart v2 requirement)
- Fixed WebGPUStatus import path
- Fixed TTSModelType type export
- FRE-4651 marked done
- Dev server running on localhost:5173
### 21:16 UTC -- Environment Config
- Added missing VITE_STRIPE_PUBLISHABLE_KEY
- Verified dev server starts successfully
- Created FRE-4658 for Vercel deployment
- Plan updated to revision 6
**Status:** FRE-4547 at 85% completion
**Next:** Vercel deployment (FRE-4658)
**Remaining:** 3-5 hours
---
### 22:50 UTC -- Vercel Deployment Started
- Checked out FRE-4658 for Vercel deployment work
- Created vercel.json with SolidStart configuration
- Investigated Vercel CLI authentication
- Found CLI requires interactive login or token
### 22:56 UTC -- FRE-4658 Updated
- Documented all 13 environment variables as ready
- Identified 3 deployment options (manual, CI/CD, API)
- FRE-4658 status: in_progress (waiting for credentials)
### 22:57 UTC -- FRE-4547 Updated
- Added Vercel deployment progress to parent issue
- Updated plan to revision 7
- Progress: 85% complete
**Status:** FRE-4547 at 85%, FRE-4658 waiting for Vercel credentials
**Next:** Complete Vercel deployment once credentials available
**Remaining:** 3-5 hours
---
## FRE-4547 -- AudiobookPipeline Phase 1 (Continued - Heartbeat 2)
### 00:13 UTC -- CI/CD Deployment Started
- Committed all Phase 1 changes to git
- Pushed to origin/master (commit 0459fd3)
- GitHub Actions deploy workflow triggered
- FRE-4658 status updated: CI/CD in progress
### 00:15 UTC -- FRE-4547 Updated
- Added CI/CD deployment progress to parent issue
- Updated plan to revision 8
- Progress: 85% complete
### 00:17 UTC -- Plan Updated
- Revision 8 created
- Added Git commit & push to completed items
- FRE-4658 status: CI/CD deployment in progress
**Status:** FRE-4547 at 85%, CI/CD deployment in progress
**Next:** Monitor CI/CD and verify deployment
**Remaining:** 3-5 hours
---
## FRE-4547 -- AudiobookPipeline Phase 1 (Continued - Heartbeat 3)
### 02:08 UTC -- Acknowledged FRE-4658 Handoff
- FRE-4658 moved to `in_review` and assigned to Code Reviewer
- Code Reviewer created FRE-4678 for Vercel project setup
- FRE-4678 assigned to Code Reviewer with all 13 env vars documented
- FRE-4547 updated with state change
### 02:11 UTC -- Plan Updated to Revision 9
- Added FRE-4678 to plan document
- Updated issue tree showing FRE-4658/FRE-4678 handoff
- FRE-4547 status: in_progress (awaiting FRE-4658 completion)
**Status:** FRE-4547 at 85%, FRE-4678 active with Code Reviewer
**Next:** Monitor FRE-4678 progress (Code Reviewer owned)
**Remaining:** 3-5 hours